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 Kommentare

Jan
Jan am 1 Jun. 2022
Bearbeitet: Jan am 1 Jun. 2022
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
Huy Ngoc Duong am 1 Jun. 2022
Of course, here, I just supposed and there is an assumption to fix x(t-Ts) at t=0.
But I think if there isn't solver to save the previous data of the previous step, It's so bad. Matlab is so bad.
Jan
Jan am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Torsten
Torsten am 1 Jun. 2022
Bearbeitet: Torsten am 1 Jun. 2022

0 Stimmen

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.

Kategorien

Tags

Gefragt:

am 1 Jun. 2022

Bearbeitet:

am 1 Jun. 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by