Dear all,
I never scaled my models before, but I'd like to try out if scaling will improve convergence speed and impact the precision of the solution.
However, I'm not sure how to scale my objective, which is cost(FinalTime). Suppose I run an optimization over 2 days (172800s), and I have the following simple model:
input Real a(nominal=a_nom);
Real b(nominal=b_nom);
Real cost(start=0, fixed=True);
equation
...
der(cost) = a * b;
Do I have to add a nominal attribute to cost? In this example, cost will vary by a factor of roughly 2e5 between starttime and finaltime. Should I add the estimated value at finaltime as nominal value?
Or do I need to create an intermediary variable, like this:
input Real a(nominal=a_nom);
Real b(nominal=b_nom);
Real cost(start=0, fixed=True);
Real der_cost(nominal=a_nom * b_nom);
equation
...
der_cost = a * b;
der(cost)=der_cost;
In this case, is the nominal attribute for der_cost required or will it be deviated from the equation?
And do I still need to specify a nominal attribute for cost?
Thanks for your advice,
Roel
Scaling of objective function
Dear all,
I never scaled my models before, but I'd like to try out if scaling will improve convergence speed and impact the precision of the solution.
However, I'm not sure how to scale my objective, which is cost(FinalTime). Suppose I run an optimization over 2 days (172800s), and I have the following simple model:
input Real a(nominal=a_nom);
Real b(nominal=b_nom);
Real cost(start=0, fixed=True);
equation
...
der(cost) = a * b;
Do I have to add a nominal attribute to cost? In this example, cost will vary by a factor of roughly 2e5 between starttime and finaltime. Should I add the estimated value at finaltime as nominal value?
I believe the principles for scaling a cost state is the same as those for scaling any other state (whatever they may be...). So your suggestion might be a good idea.
Or do I need to create an intermediary variable, like this:
input Real a(nominal=a_nom);
Real b(nominal=b_nom);
Real cost(start=0, fixed=True);
Real der_cost(nominal=a_nom * b_nom);
equation
...
der_cost = a * b;
der(cost)=der_cost;
In this case, is the nominal attribute for der_cost required or will it be deviated from the equation?
And do I still need to specify a nominal attribute for cost?
Thanks for your advice,
Roel
I'm quite certain no nominal attributes are set automatically based on the equations. So, yes, it would be beneficial to specify nominal attributes for both cost and der_cost. I am however unsure whether this reformulation would aid scaling.
Sorry for the lack of definite answers!