2 views (last 30 days)

I have been trying to solve this problem for sometime and so far I have received an answer that requires the symbolic toolbox which I dont have - I would appreciate any help!

I need to solve these 2 differential equations simultaneously.

But I dont know how to code the dr*^3/dt. My code is below:

function dydt=odefcnNY_v3(t,y,D,Cs,rho,r0,N,V,Af)

dydt=zeros(2,1);

dydt(1)=(-3*D*Cs/rho*r0^2)*y(1)*(1-y(2));

dydt(2)=(D*4*pi*N*r0*(1-y(2))*y(1)-(Af*y(2)))/V;

end

y(1) = r* and

y(2) = C*

So

dydt(1) = dr*/dt and

dydt(2) = dC*/dt

In my case dydt(1) needs to be replaced with something that would solve dr*^3/dt and not dr*/dt. The rest of the code is below.

D=4e-9;%m2/s

rho=1300; %kg/m3

r0=10.1e-6; %m dv50

Cs=0.0016; %kg/m3

V=1.5e-6;%m3

W=4.5e-8; %kg

N=W/(4/3*pi*r0^3*rho);

Af=0.7e-6/60; %m3/s

tspan=[0 24*3600]; %s in 24 hrs

y0=[r0 0];

[t,y]=ode45(@(t,y) odefcnNY_v3(t,y,D,Cs,rho,r0,Af,N,V), tspan, y0);

plot(t/3600,y(:,1),'-o') %plot time in hr, and r*

xlabel('time, hr')

ylabel('radius,um')

legend('DCU')

plot(t/3600,y(:,2),'-') %plot time in hr, and C*

xlabel('time,hr')

ylabel('C* (C/Cs)')

legend('DCU')

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 9 Comments

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_768173

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_768173

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_768827

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_768827

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769169

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769169

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769172

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769172

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769180

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769180

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769202

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769202

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769621

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_769621

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_772554

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_772554

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_772570

⋮## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/491470-simultaneous-differential-equations-derivative-of-y-3-wrt-t#comment_772570

Sign in to comment.