Extend bvp4c for bvps
Show older comments
Hello everyone!!!
I have a question with bvp4c
Please help me!!!
--------------------------
I have an optimal control problem as below
>Supposed that, Problem formulation
x1_d=x1+x2^x1+exp(x1)+u;
x2_d=x1+x1^x2;
x1(0)=x1(Tf)=0;
x2(0)=x2(Tf)=1;
> Supposed that, I get a control signal u=x1(t)+sign(u(t-Ts))+sign(x(t-Ts)), Ts=time span,
It means that the moment input depends on the previous input and the previous output.
(I have problem that how to code the control signal into matlab)
And I don't know how to use bvp4c to solve this problem.
I-----------------
Please help me!!!
God bless you.
HD
3 Comments
Note: This is not Twitter. No # before the tags. Thanks.
u=x1(t)+sign(u(t-Ts))+sign(x(t-Ts))
This means also, that the function to be integrated is not smooth. Then Matlab's standard integrators are not designed to process this function.
You can use a fixed-step-ODE solver and Ts must be a multiple of the stepsize. To solve the BVP you need to write your own approach, e.g. a Newton method. But what exactly is the free parameter in this ODE? What do you use for x(t-Ts) at t=0?
Huy Ngoc Duong
on 1 Jun 2022
Jan
on 1 Jun 2022
Again: This is not twitter. Please do not start the tags with #. Using the names of contributors as tags is not useful also. Thank you.
What does "fix x(t-Ts) at t=0" exactly mean for the value of u? Is this u(0) the free parameter? Please take the time to define the problem clearly without assumption.
No, Matlab is not bad. Remember that the scientifically correct method of an integration uses a stepsize control and rejecting of steps. Then "previous step" is not even uniquely defined.
No programming language can provide tools, which match all possible problems. It is not hard to implement what you need with a few lines of code. Instead of blaming Matlab, start to create your code and ask here in the forum for a specific poroblem.
Answers (1)
If you have to refer to x(t-Ts) and u(t-Ts), you have a delay differential equation.
Take a look at DDE23 if it fits your needs.
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!