# GAMS Modeling Question

 0 Hi everyone, I hope there is someone who can urgently help me. How can I model the problem below in GAMS ? A quantity y is known to depend upon another quatity x. A set of corresponding values has been collected for x and y as is presented in the following table. x 0.0 0.5 1.0 1.5 1.9 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.6 7.0 7.6 8.5 9.0 10.0 y 1.0 0.9 0.7 1.5 2.0 2.4 3.2 2.0 2.7 3.5 1.0 4.0 3.6 2.7 5.7 4.6 6.0 6.8 7.3 Fit the best straigth line y = bx + a to this set of data points. The objective is to minimize the sum of absolute deviations of each observed value of y from the value predicted by the linear relationship. Fit the best straigth line where the objective is to minimize the maximum deviation of all the observed values of y from the value predicted by the linear relationship. Fit the best quadratic curve y = cx 2 + bx + a to this set of data points using the same objectives as in (1) and (2). Regards, Atif asked 22 Nov '16, 15:35 Atıf 11●2 accept rate: 0% Looks like problem 11 in Model Building in Mathematical Programming by H. Paul Williams. (22 Nov '16, 18:12) Rob Pratt Sounds like you have a homework or take-home exam problem which is urgently due. Forget about GAMS for the moment, and figure out what optimization problems you can or should formulate. Then worry about how to implement them in GAMS. Hint: Do you know anything about norms? (22 Nov '16, 20:07) Mark L Stone

 0 When I applied the model below, I got error which says " Symbol declared but no values have been assigned. Check for missing data definition, assignment, data loading or implicit assignment via a solve statement. A wild shot: You may have spurious commas in the explanatory text of a declaration. Check symbol reference list." Model Sets i indices/ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 /; Parameters x(i) x values / 1 0 2 0.5 3 1.0 4 1.5 5 1.9 6 2.5 7 3.0 8 3.5 9 4.0 10 4.5 11 5.0 12 5.5 13 6.0 14 6.6 15 7.0 16 7.6 17 8.5 18 9.0 19 10.0 / y(i) y values / 1 1 2 0.9 3 0.7 4 1.5 5 2.0 6 2.4 7 3.2 8 2.0 9 2.7 10 3.5 11 1.0 12 4.0 13 3.6 14 2.7 15 5.7 16 4.6 17 6.0 18 6.8 19 7.3 /; Variables a constant b slope e(i) absolute standart deviation; Equations equation1 objective function equation2(i) standard deviation calculation; equation1 .. z =e= sum((i), e(i) ; equation2(i) .. e(i) =e= abs(y(i)-a-b*x(i)); Model transport /all/ ; Solve transport using dnlp minimizing z ; Display a.l, a.m, b.l, b.m ; answered 22 Nov '16, 15:37 Atıf 11●2 accept rate: 0%
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×51