solver:some_notes_on_scaling

This shows you the differences between two versions of the page.

Next revision | Previous revision | ||

solver:some_notes_on_scaling [2007/09/21 16:00] 127.0.0.1 external edit |
— (current) | ||
---|---|---|---|

Line 1: | Line 1: | ||

- | ====== Some Notes on Scaling ====== | ||

- | Contributed by Arne Drud: If you look at the equation listing for your model you will see: | ||

- | <code> | ||

- | ---- E_DHEDGE =E= | ||

- | |||

- | E_DHEDGE.. - (2.581140E+7)*X(1) - D_HDG =E= 0 ; | ||

- | |||

- | (LHS = 4.1541556E+9, INFES = 4.1541556E+9 ***) | ||

- | </code> | ||

- | Nonlinear models can be hard to solve if terms and derivatives are very large. And 2.8e7 = 28 million is very large. 4.15e9 is very very large. | ||

- | |||

- | You can scale the model using the ''.scale'' and ''.scaleopt'' feature in GAMS. The objective is to get derivatives that are not too much over one in absolute value. The equation scale is selected to be of the order of the largest derivative or term in the equation, for example ''e_dhedge.scale = 1.e6;'' | ||

- | |||

- | The equation says ''d_hdg =e= ...'' and in order to preserve the coefficient 1 for ''d_hdg'' you must also have ''d_hdg.scale = 1.e6;'' | ||

- | |||

- | Now ''d_hdg'' is scaled and it appears in | ||

- | <code> | ||

- | E_HEDGE .. D_HDG =E= TARGET; | ||

- | </code> | ||

- | so you will also need | ||

- | <code> | ||

- | e_hedge.scale = 1.e6; target.scale = 1.e6; | ||

- | </code> | ||

- | And finally you must tell GAMS to use scaling with the statement | ||

- | <code> | ||

- | Hedge.scaleopt = 1; | ||

- | </code> |

IMPRESSUM / LEGAL NOTICE
PRIVACY POLICY
solver/some_notes_on_scaling.1190383200.txt.gz ยท Last modified: 2007/10/20 07:16 (external edit)