You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This model describes of a hydraulic position servo, where a PI-controller is used to control the position. This consists of a proportional gain ($K_{p}$) and an integrator gain ($K_{i}$). The values of these gains will decide the speed and stability of the servo. It is thus desirable to find as good controller parameters as possible.
29
26
@@ -39,35 +36,39 @@ \section*{Using the optimization dialog}
Apart from minimizing the average difference, we also want to minimize the overshoot of the step response.
107
105
\begin{itemize}
@@ -110,55 +108,42 @@ \section*{Using the optimization dialog}
110
108
111
109
Now choose \enquote{Minimize} and \enquote{Overshoot}, and then click \enquote{Add Function}. In the box called \enquote{arg1}, change the value to 0.7.
112
110
113
-
\newpage
114
111
Now we have added a second objective function. The total objective function will the sum of these. As they may not be equally important or equally scaled, it is possible to weight the individual functions. Change \enquote{Weight} for the first function to 10. Now the page should look like this:
Click on \enquote{Start Optimization}. During the optimization the objective function values and the values of the optimization parameters are shown for the different points. The best point is shown in green, and the worst in red.
135
+
During the optimization the objective function values and the values of the optimization parameters are shown for the different points. The rows are sorted from best to worst.
Once the optimization has finished, we can evaluate the results. Parameters from a point can be written back to the original model by using the \enquote{Apply} buttons.
Click the \enquote{Apply} button for the point with green text (the best point). Then go back to the original model and click the Simulate button again.
164
149
@@ -178,7 +163,7 @@ \section*{Optimizing from script files}
178
163
Click on Save script file in the dialog.
179
164
180
165
\tutitem{Loading a script file}
181
-
To load a previously saved script file, click on Load script file in the dialog. You will be taken directly to the code tab. Go to the last tab and start the optimization as before. Note that the settings on the first three pages are not updated by the script. Going back to these might re-generate the script and overwrite the loaded code.
166
+
To load a previously saved script file, click on Load script file in the dialog. You will be taken directly to the code tab. Go to the "run" tab and start the optimization as before. Note that the settings on the first three pages are not updated by the script. Running the wizard again will re-generate the script and overwrite the loaded code.
182
167
183
168
\tutitem{Loading a script file from command terminal}
184
169
It is also possible to load a script file from the command terminal. Just write \enquote{exec} followed by the path to the file. Hopsan will automatically understand that this is an optimization script and start the dialog. You can use \enquote{pwd} to show current directory and \enquote{cd} to change directory if necessary. Example: \texttt{>{}> exec ..\textbackslash folder\textbackslash myscript.hcom}
0 commit comments