How do I integrate a differential equation?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
nashyshan
am 1 Jun. 2015
Kommentiert: Walter Roberson
am 2 Jun. 2015
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?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Jun. 2015
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
4 Kommentare
Walter Roberson
am 2 Jun. 2015
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!