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

Jan
Jan 2022년 6월 1일
편집: Jan 2022년 6월 1일
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 2022년 6월 1일
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 2022년 6월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Torsten
Torsten 2022년 6월 1일
편집: Torsten 2022년 6월 1일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

태그

질문:

2022년 6월 1일

편집:

2022년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by