Quantcast
Channel: Yet Another Math Programming Consultant
Browsing all 804 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Large Scale Aggregation Example

Teaching a course about GAMS modeling as USDA. A large real-world aggregation step cannot be ommitted! Here is an example how we can do many things in one step:Even though the raw data was too large to...

View Article


Simple Data Set to show equivalence of RAS algorithm and Entropy model

For the matrix balancing problem it is well known that the RAS algorithm and an Entropy model give the same results. Here is a small example with the data taken from...

View Article


GRAS (Generalized RAS) Example

 $ontext     Generalized RAS method    THEO JUNIUS & JAN OOSTERHAVEN    The Solution of Updating or Regionalizing a Matrix    with both Positive and Negative Entries    Economic Systems Research,...

View Article

Image may be NSFW.
Clik here to view.

SQL2GMS and Stored Procedures

Yes, that works. See:The stored procedure should return a result set which SQL2GMS will then store in the GDX file.

View Article

RAS Algorithm Refinement

In the post http://yetanothermathprogrammingconsultant.blogspot.com/2013/06/simple-data-set-to-show-equivalence-of.html a simple RAS algorithm was shown. A slightly better way is to use a convergence...

View Article


Image may be NSFW.
Clik here to view.

Creating sparse data

To test certain modeling constructs it may be useful to generate some random data. In GAMS this is usually done through something like: a(i,j,k) = uniform(-100,100);When we want to have a sparse data...

View Article

Image may be NSFW.
Clik here to view.

Neural Networks in GAMS

I was running some neural networks with a back propagation algorithm using a rather simple optimization tool (gradient descent). This actually ran pretty decent.  Now lets if we can formulate something...

View Article

Image may be NSFW.
Clik here to view.

GAMS = Nixon

From: http://www.amazon.com/Practical-Financial-Optimization-Library-Finance/dp/1405133716

View Article


Image may be NSFW.
Clik here to view.

Calling R from GAMS to produce high quality graphs

Here is a small demo script that shows how we can call R from GAMS to produce graphs using ggplot.* name of the R script to execute$set rscript  my_script.R* include file with data$include...

View Article


Image may be NSFW.
Clik here to view.

New GAMS CGE books

View Article

Aggregation: database vs GAMS

The following aggregation code in GAMS aggregates PRODUCTION and AREA HARVESTED from a relatively large data set from FAO (2.2 million records). Afterwards we recalculate YIELDS, as aggregating yields...

View Article

QP is convex or not?

I have a QP problem that is rejected (not convex) or solved depending on the solver or method:SolverObjectiveGurobi1.01022764e+02 (23 iterations, 0.16 seconds)Cplex*** CPLEX Error  5002: Q in %s is not...

View Article

Speeding up SMAX

The following GAMS code was very slow:ACCRLRLY(B,BA,Y,U)$SUM((H,T,UR), XSB7(B,BA,"NP",H,Y,T,U,UR))                              = ACRLRLY(BA,Y, U) * SMAX((H,T,UR), XSB7(B,BA,"NP",H,Y,T,U,UR));Note that...

View Article


Duopoly Example

This example is taken from the book “Complementarity Modeling in Energy Markets.”We have two firms i producing q(i). The total production Qtot is then defined by adding up these two quantities. Because...

View Article

Image may be NSFW.
Clik here to view.

GAMSification

The book “Complementarity Modeling in Energy Markets” has a number of interesting GAMS models in the back. Some of these models are presented in scalar format, i.e. bypassing the indexing facilities....

View Article


Microeconomic Principles

Another model illustrating tables 3.3 and 3.4 from “Complementarity Modeling in Energy Markets”.$ontext    Example from chapter 3: "Some Microeconomic Principles"   Reference:      Steven A. Gabriel,...

View Article

Image may be NSFW.
Clik here to view.

4D Interpolation

For a engineering design application we were offered a 4D lookup table that predicts Of course rather than “lookup” it is often better to do interpolation, so values in between are accepted. This still...

View Article


2D Interpolation With SOS2 variables

Using SOS2 variables to implement a 1D interpolation scheme is fairly easy (see: http://yetanothermathprogrammingconsultant.blogspot.com/2009/06/gams-piecewise-linear-functions-with.html). However, a...

View Article

Image may be NSFW.
Clik here to view.

Cplex solution pool

I am working on a fairly complex but small MIP model, where we want to find a large number of non-dominated, feasible solutions (Pareto solutions). In one of the models we have developed for this, we...

View Article

Pindyck

Robert Pindyck in “CLIMATE CHANGE POLICY: WHAT DO THE MODELS TELL US?”:ABSTRACT: Very little. ….One of the problems with these long range models is the use a discount rate. This rate can have large...

View Article
Browsing all 804 articles
Browse latest View live