Warning: Unable to find explicit solution.

I was trying to use dsolve for a system of ODE's (line 19 is the dsolve function)
  1. d(Ca)/d(t)=-(k*ca*cb)-(vo*ca)/(Vo+vo*t)
  2. d(Cb)/d(t)=-(k*ca*cb)+(vo(cbo-cb))/(Vo+vo*t)
  3. d(Cc)/d(t)=(k*ca*cb)-(vo*cc)/(Vo+vo*t)
  4. d(Cd)/d(t)=(k*ca*cb)-(vo*cd)/(Vo+vo*t)
k=2.2;
vo=0.05;
cbo=0.025;
Vo=5;
cao=0.05;
tspam=0:100:500;
syms cb(t) ca(t) cc(t) cd(t)
s=dsolve(diff(ca)==-(k*ca*cb)-(vo*ca)/(Vo+vo*t),diff(cb)==-(k*ca*cb)+(vo*(cbo-cb))/(Vo+vo*t),diff(cc)==(k*ca*cb)-(vo*cc)/(Vo+vo*t),diff(cd)==(k*ca*cb)-(vo*cd)/(Vo+vo*t),cc(0)==0,cd(0)==0,ca(0)==cao,cb(0)==cbo);
Warning: Unable to find explicit solution.
> In dsolve (line 201)
In Ejercicio4_29 (line 19)

Answers (1)

dsolve() is not able to solve the problem so use ode45() instead:
k=2.2;
vo=0.05;
cbo=0.025;
Vo=5;
cao=0.05;
% tspam=0:100:500; %%?
syms cb(t) ca(t) cc(t) cd(t)
eq1 = diff(ca)==-(k*ca*cb)-(vo*ca)/(Vo+vo*t);
eq2 = diff(cb)==-(k*ca*cb)+(vo*(cbo-cb))/(Vo+vo*t);
eq3 = diff(cc)==(k*ca*cb)-(vo*cc)/(Vo+vo*t);
eq4 = diff(cd)==(k*ca*cb)-(vo*cd)/(Vo+vo*t);
vars = [cb(t); ca(t); cc(t); cd(t)];
V = odeToVectorField([eq1,eq2,eq3,eq4])
M = matlabFunction(V,'vars', {'t','Y'})
interval = [0 1.5]; %time interval
y0 = [cao cbo 0 0]; %initial conditions
ySol = ode45(M,interval,y0);
tValues = linspace(interval(1),interval(2),1000);
yValues = deval(ySol,tValues,1); %number 1 denotes first solution likewise you can mention 2 , 3 & 4 for the next two solutions
plot(tValues,yValues)

3 Comments

First: Thank you so much for giving me a little or your time!!
it works for the first value but for the other it doesn`t. It`s supossed to be like the figure down hereWhatsApp Image 2019-04-11 at 1.00.42 AM.jpeg
Upload your equations in latex form and the initial conditions.
I'm sorry I don't understand, how do i change them to that latex form?.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!