My research is also in the area of optimal control, mostly in Industrial Engineering; and love MATLAB so much. May I contact you someday to discuss?
@ahmadhably806 ай бұрын
Of course
@40NoNameFound-100-years-ago Жыл бұрын
Hello Sir, thank you for such a great video. Is there any way you can share the code? On a google drive for example?
@rushabhdalal60723 жыл бұрын
How to find parameters a and b such that the sum of quadratic errors e=sum_i((ym_i-y(tm_i))^2) between measurements ym and model output y is minimal using optimizers such as fminunc and ODE. The model reads xt=[0 1; a b]*x; y=x; tm ym 0 1.0000 0.5000 0.6482 1.0000 -0.1047 1.5000 -0.6897
@priyaverma32473 жыл бұрын
How to solve optimal control problem with two control parameters, by matlab 2018.. Could you hwlp me?
@UsmanKhan-dg8kn2 жыл бұрын
Sir can you help me in making graph on MATLAB. Actually I have done my all part or numerical but still facing problem in MATLAB coding of optimal control strategies for infectious disease
@santanubhattacharya3162 жыл бұрын
Thank you Sir. I have one question. What type of control is this? Like bang bang or singular or anything else?
@ahmadhably802 жыл бұрын
optimal control type
@arthurmoreno1452 жыл бұрын
Hello Ahmad, Can you help me with problem ? I didn't understand why you didn't use the final state in the code even though you declared x1 as a global variable.
@ahmadhably802 жыл бұрын
what do you mean by the final state?
@maryyamirfan86202 жыл бұрын
Hi sir.. My MATLAB code show alot of errors then i clear all ...but still my code bot running .. can you please help in making my code???
@ahmadhably802 жыл бұрын
Please share it
@maryyamirfan86202 жыл бұрын
@@ahmadhably80 in comments???
@ahmadhably802 жыл бұрын
By email
@ihebkharab2 жыл бұрын
Hi sir, thank you for this helpful video, I have an issue with coding the same principle but, I have a two variable function in an SI model and I want to minimize the infections by adding the travel restriction function u , and can be treated as a signal or so as you did in the video, could you please help me? I have errors on the coding part that I do not know how to fix. Thank you in advance
@ahmadhably802 жыл бұрын
what is the type of your input?
@Sinanmmd3 жыл бұрын
Sir, can you please the same for SIR model? I need this code for optimal control in Mathematical Biology
@ahmadhably803 жыл бұрын
Can you give your model
@lidia16533 жыл бұрын
Thank you for sharing your knowledge! Could you please help me understand your "way of a contraction of U"? I used your example to find the optimal control for a simple SIR model with a control variable from 0 to 1. And I expected to obtain the graphic for U from 0 to some optimal value U. However, in the results, I got that the initial point of the control was not equal to zero but greater to zero. Could you please help understand why the control is not equal to zero at the initial point?
@ahmadhably803 жыл бұрын
Could you share your code ?
@lidia16533 жыл бұрын
@@ahmadhably80 Thank you for your reply! I did it. Graph U already has the correct results. The graph is not very smooth, but the values are correct. I will attach the code below if you are still interested in it. How do you think is it possible to transform this problem into a multi-objective problem? Ex. to minimize the cost integral (objective function for the integral of the control), and simultaneously to maximize the second objective function, say, to maximize the number of recovered. global T N I0 np S0 R0 Y0 x0 T=30; N=10; I0=1; np=169; S0=np-I0; R0=0; Y0=0; x0=[S0;I0;R0;Y0]; lesu_init=zeros(1,N); u_out = fmincon(@cost3, lesu_init, [],[],[],[],zeros(1,N),ones(1,N),@nonlcon); [t,x]=ode45(@my_ode2, [0 T], x0, [], u_out); figure (1) umin2=[u_out u_out(:,end)]; t2=(0:T/N:T); ui=smooth(t2,umin2) ; stairs(0:T/N:T, umin2,'r'); hold on plot(t2, ui,'b'); xlabel('temps') legend('u optimal'); hold off figure (2) plot(t,x(:,1:3)); xlabel('temps') legend('x1','x2','x3'); figure (3) plot(t,x(:,4)); xlabel('temps') legend('x4'); function xdot=my_ode2(t,x,lesu) lamda = 0.005; gamma = 0.04; q=1.5; u=udet2(t, lesu); xdot=zeros(4,1); xdot(1)=- lamda *x(1)*x(2); %S xdot(2)=lamda * x(1)*x(2) - gamma *x(2)-u*x(2); xdot(3)=gamma * x(2)+u*x(2); xdot(4)=q*u*u; end % U function vector=udet2(t, lesu) global T N a=N*t/T; if a==0 vector=lesu(:,1); else vector=lesu(:, abs(ceil(a))); end end %Cost function we want to minimize x(2)+int(q*u^2)dt function J2=cost3(lesu) global T x0 u_out [t,x]=ode45(@my_ode2,[0,T],x0,[],lesu); J21=(x(end,2)); J22=(x(end,4)); J2=J21+J22; end function [c,ceq]=nonlcon(lesu) global T x0 [t,x]=ode45(@my_ode2,[0,T],x0,[],lesu); c=[]; ceq=[]; end
@لياحبلي Жыл бұрын
انا ليا يا عمو ❤
@marieaimeineza22243 жыл бұрын
Thx for this video, it really helpfully but i tried to run these codes in MATLAB 2018a unfortunately they are not working. they keep giving errors like not enough inputs argument. need your help!!!!!!!!
@ahmadhably803 жыл бұрын
Send them by email please. They are working on my desktop
@tareqahmad44843 жыл бұрын
hi sir, how i can make matlab for discrete cost function ?
@ahmadhably803 жыл бұрын
What do you mean? Sum instead of integral?
@melikagolgoon9628 Жыл бұрын
@@ahmadhably80 Yes. My objective function is the derivative of the Lyapunov function and I want to find the optimal u that minimizes Vdot. I don't have an integral in my objective function in this case. Should I add an integral with some time span? Because, after all, I want to see how the optimal u changes as the state goes through that time span.
@ahmadhably80 Жыл бұрын
What is the type of your system. If it is linear try to use lqr. To minimize a riccati equation.
@啸宇周3 жыл бұрын
Thank you sir! Can you please show another example about solving the optimal control problem with the final time tf free which is also called the linear quadratic minimum-time problem?
@ahmadhably803 жыл бұрын
Please send me the formulation of it?
@righteousnasheed71313 жыл бұрын
@@ahmadhably80 Hi Ahmed, how to assign x(0)=x(tf) in fmincon along with other bound and constraints such as xmin
@ahmadhably803 жыл бұрын
Please see trajectory optimization
@righteousnasheed71313 жыл бұрын
@@ahmadhably80 where? could you please help me with a problem?
@aymenbalti59634 жыл бұрын
great
@ravikhandelwal29964 жыл бұрын
Sir please make videos on State space analysis simulation...in simulink... your content is awesome
@ahmadhably804 жыл бұрын
Visit my channel there are a complete course on the subject
@منوعاتثقافيةتعليمية3 жыл бұрын
can you provide me the code please?
@zeynabjoorsara14572 жыл бұрын
that's great. Can you share the code with me?
@ahmadhably802 жыл бұрын
no I cannot :-)
@UsmanKhan-dg8kn2 жыл бұрын
Any body here can help me about optimal control stratigies for infectious diseases graphing on MATLAB coding?
@ahmadhably802 жыл бұрын
What do you mean by graphing?
@priyaverma32473 жыл бұрын
Thank you sir, But this command is not work in matlab 2018 version
@ahmadhably803 жыл бұрын
Thank you for this comment. Would you explain in which sense it does not work?
@nhanNguyen-wo8fy3 жыл бұрын
@@ahmadhably80 Professor I laugh so hard at your answer. Your answer made my day. That answer is very coder. =)))) You know, like this guy in Vietnam control engineering student think about Matlab much like an App not a programming language. I also thought "What the hell why this guy think this may not work on Matlab2018a". Just like you. But I quickly understand why.
@أزهارعباسخضر3 жыл бұрын
@@ahmadhably80 great Can you healp Me about obtiml control of Nonlinear Systems
@أزهارعباسخضر3 жыл бұрын
And about robust control of linear descriptor system