How do I integrate a differential equation?

7 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Star Strider
Star Strider il 1 Giu 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
See the documentation for ode45 and Anonymous Functions for details.
  4 Commenti
nashyshan
nashyshan il 2 Giu 2015
@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 il 2 Giu 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Numerical Integration and Differential Equations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by