Trouble with system of ODEs: dsolve
Show older comments
Hello,
Sorry if this is an obvious answer, but I am fairly new to Matlab and want to make sure I'm doing this correctly.
I am trying to model a biological system through a system of 5 ODEs. My code is below with the constant values k1-k5 currently with values of 1, but will be filled in with actual values using experimental data. I am getting an error stating:
"Warning: Explicit solution could not be found. > In dsolve (line 201) "
My question is, am I setting this code incorrectly or is it just that my constants are such that it is not allowing the equations to converge? Basically, once I get the actual k values will it work or is there something fundementally wrong with the way I set it up?
if true
% % Symbolic Variables
syms P(t) Cx(t) Ci(t) Co(t) Cdna(t) k1 k2 k3 k41 k42 k5 mu Y
% Constants Definitions
k1 == 1; % Product rate constant;
k2 == 1; % Nonproducing -> Producing rate constant
k3 == 1; % Death rate constant of producing cells
k41 == 1; % DNA transfection, 1/cells*min
k42 == 1; % DNA transfection, 1/mg*min
k5 == 1; % DNA precipitation/aggragation
mu == 1; % Cell growth rate constant, 1/min
%ODE Definitions
eqn1 = diff(P) == k1*P;
eqn2 = diff(Cx) == k2*Ci - k3*Cx;
eqn3 = diff(Ci) == k41*Co*Cdna - k2*Ci;
eqn4 = diff(Co) == mu*Co - k41*Co*Cdna;
eqn5 = diff(Cdna) == -k42*Co*Cdna - k5*Cdna;
% Initial Conditions
c1 = P(0) == 0;
c2 = Cx(0) == 0;
c3 = Ci(0) == 0;
c4 = Co(0) == 20E6; %cells/ml
c5 = Cdna(0) == 20; %mg/ml of DNA from James
[PSol(t) CxSol(t) CiSol(t) CoSol(t) CdnaSol(t)] = dsolve(eqn1, eqn2, eqn3, eqn4, eqn5, c1, c2, c3, c4, c5);
end
1 Comment
Torsten
on 8 Dec 2015
Use ode15s (i.e. a numerical solver) instead of a symbolic one.
Your system appears too difficult for an analytical solution.
Best wishes
Torsten.
Answers (0)
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!