A program to recognize and reward our most engaged community members
Applications that use the optimization feature of Embed
Hi WoodyRKW,
There are two types of optimization: per time step and per simulation run. Which one are you interested in? Also, have you looked at the optimization examples under Examples > Optimize.
Best Regards,
Karen
Hi Karen
Thanks for the reply.
I have reviewed the examples under Optimize but not able to resolve issue.
Am I able to send you a couple of files ———- I think would make it easier to determine
why I am experiencing the present situation.
Reg
Hi Reg,
If you could attach the diagrams to this discussion, it will be easier for Embed team and Tech Support to review and make recommendations.
Thanks,
Hi Karen,
Many thanks for your replies.
I have attached some files for your reference.
I hope that I have not made some dumb mistake in settting up the optimization.
You will note that the optimizations files show some unexpected results. The ISE values are also higher that obtained using trial and error (selected) controller constants.
Do not hesitate to ask for clarification or additiional information.
I am making some mistake in my communication —————— how do I avoid the
YES/NO??? What should I do to avoid use of "Post Comment"?
Material I sent to you is not appropriate as a general comment.
Did you receive my communications ——— sent earlier today.
Hi Woody,
The optimizers will vary the parameter unknowns searching for a minimum cost solution. In the process it might try values that can disrupt your model if it isn't carefully constructed. In your case you had a sqrt in your plant that could go negative for certain values of a1 and a2, which causes a system fault to be detected and disrupts the optimization process. I added a limit block to prevent a negative value flowing into the sqrt and the optimization went fine. A few more points: you should use fixed bounds so can see the responses that the optimizer gets when trying different values, you should be sure to keep wires as short as possible to keep the diagram compact and easily understandable.
I've attached your modified diagram illustrating the points above.
Comments concerning October 4, 2025 message from pdarnell
I understand comment about limit in modified model. However the simulation is robust enough that selecting the choices of either retry and abort both result in stable simulation.
In the simulation reply, parameter bounds were set but simulation result reports controller constants which do not satisfy specified parameter bounds. Under what circumstances are parameter bounds ignored?
It is to be noted that the ISE value of 15.34…… exceeds the ISE value of 8.57…. using the selected constants of a0=1.0 and a1=0.02 ———- from trial and error simulations.
Good points Woody. only "Generalized Reduced Gradient" method supports limits on parameterUnknown blocks, however it appeared to ignore your bounds in this case (smells like a bug!). I created an "unknown" compound block that generates an error value if the unknown exceeds the bounds. The bounds are set via dialog constants (right click on the compound to change). There is an additional bounds error output proportional to the boundary error that is
added to the cost function to avoid a solution in an undesired unknown space.
It finds a solution of a0=2.7, a1=.31 for ISE=19.3 (see below), you also said that a0=1, a1=.02 should give ISE=15.3, but I get ISE=27.5 for those values. The modified diagram is attached below.
@pdarnell
Jocelyn has suggested that perhaps I should contact you.
I am not able to download the file of your October 25, 2025 communication.
When I attempt to dowload the simulation file the result is a line by line listing of primitive code.
I shll look for your guidance,
Many thanks.