Fixed final time and fixed final state optimal control problem

6 vues (au cours des 30 derniers jours)
Dhimas Mahardika
Dhimas Mahardika le 23 Juin 2020
Réponse apportée : Shlok le 25 Jan 2025
Hello, someboddy help me please with this optimal control problem of fixed end time and fixed end point using Pontryagin Minimum Principle
State equation
dx1(t)/dt = - (1/N)*d*x1(t)*x3(t) - u1*x1(t)
dx2(t)/dt = (1/N)*x1(t)*x3(t) - a*x2(t) - u2*x2(t)
dx3(t)/dt = a*x2(t) - b*x3(t) - u3*x3(t)
dx4(t)/dt = b*x3(t) - u4*x4(t)
with N=651
a=0.2
b=0.3
d=0.5
x1(0)=651 x1(T)=148
x2(0)=279 x2(T)=85
x3(0)=130 x3(T)=80
x4(0)=75 x4(T)=252
with T= 29
cost function minimize J = integral from 0 to 29 of 0.5*x1^2 + 0.5*x2^2 + 0.5*x3^2 + 0.5*x4^2 + 0.5*u1^2 + 0.5*u2^2 + 0.5*u3^2 + 0.5*u4^2
please help me with matlab coding
thank you very much
I appreciate for your help

Réponses (1)

Shlok
Shlok le 25 Jan 2025
Hi Dhimas,
I understand that you want to solve an optimal control problem using Pontryagin's Minimum Principle. To help you effectively code this solution yourself, follow the following steps:
1. Combine the cost function and state equations using costate variables and thus, formulate the Hamiltonian.
H = L(x,u) + p1*dx1dt + p2*dx2dt + p3*dx3dt + p4*dx4dt; % L is the cost function, pi are the costate variables
2. Determine the optimal control u* by minimizing the Hamiltonian (i.e. Pontryagin's Minimum Principle). This often involves setting the partial derivative of the Hamiltonian with respect to the control to zero.
dHdU = [dH/du1, dH/du2, dH/du3, dH/du4];
u_opt = solve(dHdU == 0, [u1, u2, u3, u4]);
3. Solve the state and costate equations simultaneously with the given boundary conditions. Then use this solution to find the optimal control inputs.
4. Simulate the system dynamics using the optimal control to verify the solution.
[t, x] = ode45(@(t,x) state_equations(t,x,u_opt), [0 T], x0);
To know more about solvers, refer to the following MathWorks documentation link:

Catégories

En savoir plus sur Optimization Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by