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 Center および File ExchangeNumerical 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