Replies: 1 comment
-
For the first problem, it seems that using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I was trying to use the
OptimalControl.jl
package to solve some epidemiological optimal control problems (OCP) and have encountered some issues. I considered the following OCP:Problem 1: Strange Behavior with Concatenation/Plotting
I implemented both the direct method and the shooting method. The shooting method consists of two parts: the first one approximates the switching time, and the second one obtains the initial adjoint state values. Despite obtaining a small shooting error after the second shooting, the plots of the adjoint variables do not agree with the error provided by the shooting function. Specifically, the plots of the adjoint at the final time are not close to zero (indicating that the transversality condition is not satisfied), even though the shooting variable norm and values are close to zero.
Interestingly, if I plot the solution without using the concatenation operator
*
, and instead plot the upper bang part and then modify the plot (usingplot!
) with the lower bang part, the plot appears as expected. Is this a bug?Problem 2: Flow Function Convergence Error
I considered the same OCP with a quadratic cost function. This resulted in a bang-singular control solution. The direct method was implemented successfully, but the indirect method was not, because the resulting Hamiltonian system could not be solved by the
Flow
function. More specifically theFlow
function was unable to compute the “singular flow” (flow with singular control), even when different solvers were used. Does anyone have suggestions on how to manage this issue?Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions