How to solve simultaneous differential equations?
Afficher commentaires plus anciens
% Parameters
mumax=0.2;
Ks=1.0;
Yxs=0.5;
Ypx=0.2;
Sf=10;
F=0.02;
Yps=1.0;
% Equaiotns
syms V(t) X(t) P(t) S(t)
Rg=mumax*(S/(S+Ks))*X;
Rp=Ypx*Rg;
% differential equations
ode1 = diff(V) == F;
ode2 = diff(X) == Rg-((X*F)/V);
ode3 = diff(P) == Rp-((P*F)/V);
ode4 = diff(S) == (F*(Sf-S)/V)-(Rg/Yxs)-(Rp/Yps);
cond1 = V(0) == 1;
cond2 = X(0) == 0.05;
cond3= P(0) == 0;
cond4 = S(0) == 10;
% Solution
sol1=dsolve(ode1,cond1);
sol2=dsolve(ode2,cond2);
sol3=dsolve(ode3,cond3);
sol4=dsolve(ode4,cond4)
This is my code, But sol4 is the message like "Warning: Symbolic solution not available." and dsolve 209 line.
What should I do fix the problem?
1 commentaire
Bjorn Gustavsson
le 4 Oct 2021
First: you have to call dsolve with all your coupled ODEs, see the dsolve-documentation for example of that.
Second: Not all differential equations have explicit analytical solutions - since X P and S are nonlinear in the solutions containing one factor of 1/V(t) this doesn't seem unlikely, it might be possible to find some cunning variable-transform that converts this into something with an analytical solution, that might be difficult. Therefore you might need to turn to numerical solutions, see the help and documentation for ode45, ode23, ode15s and their siblings.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Equation Solving dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


