The differential equation problem with variable solution by using ode45
Mostrar comentarios más antiguos
I have four coupled diffrential equation shown bellow :-
In which a ,b ,c ,d ,e,f are constant and x[t] we will get from the solution of this second order diffrential equation
.how to write code for it in matlab.plz help
4 comentarios
Walter Roberson
el 31 de Oct. de 2019
If you have the symbolic toolbox then I recommend that you look at the flow of calls in the first example under the odeFunction documentation.
abhishek singh
el 31 de Oct. de 2019
darova
el 31 de Oct. de 2019
Solve this equation first
Use results to solve the system of ODE
abhishek singh
el 31 de Oct. de 2019
Respuesta aceptada
Más respuestas (6)
abhishek singh
el 31 de Oct. de 2019
0 votos
1 comentario
darova
el 31 de Oct. de 2019
It means
सदस्यता सूचकांकों को वास्तविक धनात्मक पूर्णांक या तार्किक होना चाहिए।
In your language. Any ideas what the problem it might be?
abhishek singh
el 31 de Oct. de 2019
0 votos
Walter Roberson
el 31 de Oct. de 2019
[t1,x1] = ode45(@noscillator,[0:100],[0 1]);
[t2,s1] = ode45(@(t,s) xotss(t,s,t1,x1(:,1)), [0:100], [1 0 0 0]);
for ti = 0:1:100
rho11(ti+1)=s1(ti+1,1).*s1(ti+1,1)'-s1(ti+1,3).*s1(ti+1,3)';
rho12(ti+1)=s1(ti+1,1).*s1(ti+1,2)'+s1(ti+1,3).*s1(ti+1,4)';
rho21(ti+1)=s1(ti+1,2).*s1(ti+1,1)'+s1(ti+1,4).*s1(ti+1,3)';
rho22(ti+1)=s1(ti+1,2).*s1(ti+1,2)'-s1(ti+1,4).*s1(ti+1,4)';
end
3 comentarios
darova
el 31 de Oct. de 2019
Thanks bro! It works fine!
abhishek singh
el 1 de Nov. de 2019
Walter Roberson
el 1 de Nov. de 2019
Note that s1(ti+1,1)' means the conjugate complex transpose of s1(ti+1,1) . It is, however, a scalar, so transpose does not make any change. The You are also expecting real-valued results, so the conjugate is probably not makeing any changes. I suspect you are doing the equivalent of squaring the value.
I worry that you might have that that s1(ti+1,1)' is the derivative of s1(ti+1,1) .
abhishek singh
el 1 de Nov. de 2019
0 votos
1 comentario
Rik
el 1 de Nov. de 2019
Please do not post your comments as answer. Their order can change, which makes it confusing.
abhishek singh
el 1 de Nov. de 2019
0 votos
1 comentario
Walter Roberson
el 1 de Nov. de 2019
I wonder: do you happen to be using MacOS Catalina ?
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!