Solving a system of differential equations

Context: r is radius of a particle and C is the concentration in a solution - the below is a form of the Noyes-Whitney equation, but solving for the changing particle radius and concentration dynamically.
I would like to solve this set of differential equations simultaneously for both C and r with time (t). Eventually I would like to plot both variables with time. All the other parameters are constant.
Note: dr^3/dt is the derivative of r^3 with respect to t

댓글 수: 2

To confirm, is to be cubed, or is it the triple differentiation of r with respect to t, or is it the derivative of with respect to t ?
Nora Rafael
Nora Rafael 2019년 10월 6일
Hi there - It is the derivative of r^3 with respect to t.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 10월 6일

0 개 추천

syms r(t) C(t)
Pi = sym('pi');
dr_cubed = diff(r^3,t);
dC = diff(C,t);
eqn1 = dr_cubed == -3*D*C_s/(rho*r0^2)*r*(1-C/Cs);
eqn2 = dC == D*4*Pi*r0*N*(1-C/Cs)*r/V;
sol = dsolve([eqn1, eqn2, r(0)==r0, C(0)==Cs]); %not sure I got the right initial conditions

댓글 수: 2

If there is no closed form solution, then I recommend looking at the documentation for odeFunction https://www.mathworks.com/help/symbolic/odefunction.html which shows the steps to use to convert symbolic equations into anonymous functions that can be handled by ode45() and kin.
Nora Rafael
Nora Rafael 2019년 10월 7일
Thanks very much, but is there a way to do it without the Symbolic Math Toolbox?

댓글을 달려면 로그인하십시오.

카테고리

질문:

2019년 10월 6일

댓글:

2019년 10월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by