solve a differential equations system with DSOLVE
Mostrar comentarios más antiguos
Hello.
I need to solve a differential equation's system in matlab composed by 6 equations: 5 of them are differential and se sixth one is linear without derivatives. All the equations contain both the corresponding unknown variable and one or two other unknown variables that are to be calculated in the other equations. Moreover, in each equation I have coefficients that depend from the unknown quantities.
I tried to write in Matlab (i give an example with only 3 derivatives dTi/dt plus a simple linear equation, and without coefficients):
DTg = ((Tg^2+Tamb^2)*(Tg+Tamb))*(Tamb-Tg)+((Tg^2+Tamb^4)*(Tg+Tamb))*(Tpv-Tg);
DTpv = ((Tg^2+Tamb^2)*(Tg+Tamb))*(Tg-Tpv)+(Tf-Tpv)+(Tamb-Tpv);
DTf = ((Tpv-Tf)-(Tf2-Tf0));
Tf2 = 2*Tf-Tf0;
The unknown variables are Tg,Tpv, Tf and Tf2, which are both in the derivatives and in the second member of the equations.
How can I solve that? I tried using:
dsolve('DTg','DTpv','DTf','Tf2','Tg(0)=Tamb','Tpv(0)=300','Tf(0)=Tf0');
but of course it doesn't work because matlab wants to know tha values of Tg, Tpv, Tf and Tf2 in the second members of the equations.
No idea of how to solve this system.
Thank you to everybody answers!
1 comentario
Valentina
el 16 de Mzo. de 2012
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 16 de Mzo. de 2012
Did you define those variables as syms?
syms Tg Tpv Tf Tf2
first.
6 comentarios
Valentina
el 16 de Mzo. de 2012
Sean de Wolski
el 16 de Mzo. de 2012
Or as constants, but yes, they have to be defined.
Valentina
el 17 de Mzo. de 2012
Walter Roberson
el 17 de Mzo. de 2012
Do not name your own script dsolve.m !
arnold ing
el 4 de Sept. de 2017
Editada: arnold ing
el 4 de Sept. de 2017
Hi Its the same for me..its not about the script name
Walter Roberson
el 4 de Sept. de 2017
What shows up for
which -all dsolve
Categorías
Más información sobre Symbolic Math Toolbox 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!