How do I integrate a differential equation?

조회 수: 8 (최근 30일)
nashyshan
nashyshan 2015년 6월 1일
댓글: Walter Roberson 2015년 6월 2일
Hi, I want to integrate a differential equation dc/dt. Below is the code and the values of the variables.
clear all;
c1=.185;c0=2*10^-6;k3=.1*10^-6;
v1=6;v2=.11;v3=.09*10^-6;
Ca_ER=10*10^-6;Ca_cyto=1.7*10^-6;
p_open3=0.15;c=15*10^-6;
dcdt= (c1*(v1*(p_open3)+v2)*(Ca_ER)-c)-v3*((c)^2)/(c^2+(k3)^2);
I know there is an integral function but I am not sure how to apply for this equation. How do I proceed from here? Please help. The value of initial c, if needed, can be taken as 0.15*10^-6. Also, I need to plot the obtained result versus time. So will get an array of values or just a single value?

채택된 답변

Star Strider
Star Strider 2015년 6월 1일
Try this:
c1=.185;c0=2E-6;k3=1E-7;
v1=6;v2=.11;v3=9E-8;
Ca_ER=10E-6;Ca_cyto=1.7E-6;
p_open3=0.15;
ci=15E-6;
dcdt = @(t,c) (c1.*(v1.*(p_open3)+v2).*(Ca_ER)-c)-v3.*((c).^2)./(c.^2+(k3).^2);
tspan = linspace(0, 10, 25);
[t,c] = ode45(dcdt, tspan, ci);
figure(1)
plot(t, c)
grid
See the documentation for ode45 and Anonymous Functions for details.
  댓글 수: 4
nashyshan
nashyshan 2015년 6월 2일
@john D'Errico. I am supposed to obtain periodic oscillations, but am not able to do so. since I wasn't familiar with the ODE functions in MATLAB I though I was doing something wrong. But I think it has to do with the equations.
Walter Roberson
Walter Roberson 2015년 6월 2일
Use Star Strider's code but increase the upper time bound. For example,
tspan = linspace(0, 40, 75);
I do not understand why the wiggles are not visible if an upper time bound of 30 is used, but they are visible if 35 is used and clearly peak near 20.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by