# Has anyone modelled calcium oscillations using Matlab software? [closed]

I have been trying to model calcium oscillations using MatLab, but I cannot obtain the oscillation.

I created a function where I put all the equations and used ode15s to call the function. I have listed the equations and the code.

Can anyone tell me why I am not obtaining the oscillations?

These are the equations along with the codes:

r(:,3) = ( (((.029*0.13*1.049 + .21.*.5.*.144).*initi(:,1)) ./  (.144.*1.049.*(.5+ .13)) ) .*( 1- initi(:,3)) ) - (( (.21 *.5 + .029 *.9434) ./ (.5 +.9434) ).*initi(:,3));


The values of the upper case Ks are obtained as follows:

and the value of p is 0.5

a(:,1) = power (( (.5 .* initi(:,1) .*(1 - initi(:,3))) ./ ((.5 + .13 ).*(initi(:,1) + .0823)) ),3); % p_o


Jserca is directly substituted in the equation shown below

r(:,1) = (( 1.11.*  a(:,1) + .02 ) .* (  initi(:,2) - initi(:,1) ) ) -( .9 .*  power(initi(:,1),2)) ./ ( power(.1,2) + power(initi(:,1),2) );


 r(:,2) = - r(:,1) .*5.5; % Ce


The constants are shown here:

And this is the desired result:

But I obtain this!

And this is my code:

function[t, initi, r,a]= deyoung()
clear all;
clc;
close all;

%--------------------------------------------------------------------------
% Initial conditions
%--------------------------------------------------------------------------
initi(:,1) = 0;  %  C
initi(:,2) = .9; %  y
initi(:,3) = .5; %  Ce

%--------------------------------------------------------------------------
% ODEs
%--------------------------------------------------------------------------
icon=initi;

tspan=[0 100];

options = odeset('RelTol', 1e-08, 'AbsTol', 1e-08);

[t,initi] = ode15s(@(t,initi) oper(t,initi),tspan,icon, options );

[r,a] = oper(t,initi);

figure();
plot(t,initi(:,1),t,initi(:,3));

end

function [r,a]=oper(t,initi)

initiSize = size(initi);

initiColumnCount = initiSize(2);

if ( initiColumnCount == 1)
initi = initi';
a = zeros(1,1);
else
initiRowCount = initiSize(1);
a = zeros(initiRowCount, 1);
r = zeros(initiRowCount, initiColumnCount);
end

% y
r(:,3) = ( (((.029*0.13*1.049 + .21.*.5.*.144).*initi(:,1)) ./  (.144.*1.049.*(.5+ .13)) ) .*( 1- initi(:,3)) ) - (( (.21 *.5 + .029 *.9434) ./ (.5 +.9434) ).*initi(:,3));

%Po
a(:,1) = power (( (.5 .* initi(:,1) .*(1 - initi(:,3))) ./ ((.5 + .13 ).*(initi(:,1) + .0823)) ),3); % p_o

%C
r(:,1) = (( 1.11.*  a(:,1) + .02 ) .* (  initi(:,2) - initi(:,1) ) ) - ( .9 .*  power(initi(:,1),2)) ./ ( power(.1,2) + power(initi(:,1),2) );

%Ce
r(:,2) = - r(:,1) .*5.5; % Ce

r = r';

end

• Welcome to Biology.SE. The problem is either specific to programming (there's a bug in your code) or to biology (you did not understand the process you want to simulate). I don't actually know the concept of calcium oscillation but no one can correctly answer your question for the moment. You should add your code, describe it, describe the output and explain why the output is different from what you expected. I vote to close for the moment and will retract my close vote when the question will be improved. Jun 29 '15 at 1:26
• @Remi.b Is that okay now? Jun 29 '15 at 1:37
• Yep, that seems to be answerable now. Good improvement +1. Jun 29 '15 at 2:01
• @AliceD That is the default line that comes if I select the custom close. Anyways this is clearly off-topic. Jun 29 '15 at 5:55
• @nashynash You are using the equations from a published study, right. So they should work: therefore I assume that the problem must be with the code. In stackoverflow, you need not explain calcium oscillation because your question is not really about if the model works (it works because it is already done by the people who published it. Your program is not replicating it). But before asking in SO try editing your code and examine if you have mistyped any parameter. Do the basic bug checks. You can try this site too: scicomp.stackexchange.com Jun 29 '15 at 6:39