简体   繁体   中英

How do i solve coupled stochastic differential equation in Matlab

I have single Hindmarsh-Rose(HR) neuronal model as follows

x' = y - a*x^3 + b*x^2 -z + I0 + I1*cos*w*t + D*Zyi(t);

y' = c - d*x^2 -y;

z' = r[s(x - x0) - z ];

where a,b,I1,I0,D,c,d,r,s,x0 are parameters.

I want to vary "w"(in x' of I1*cos w t) and include white gaussian noise(Zyi(t)) with D intensity and capture the frequency sensitivity for range [20 to 60]. This is a problem of Stochastic Resonance where system is dependent on frequency and at particular frequency there is coherence(In this case 40) which can be captured through SNR.

Initially I simply used ODE45 to solve the system when it was deterministic(No Noise term ie Zyi(t)) and it produced correct result but when added gaussian noise could not reproduce exact result ie could not capture the frequency sensitivity over different simulations.

Then I used SDEToolbox to solve it in Matlab. I used Euler-Maruyama and Milstein in-build Algorithms in the toolbox but of no use.

function [] = sd1

a=1;
b=3;
c=1;
d=5;
s=4;
r=0.006;
x0=-1.6;
I1=0.2;
I0=1.31; %for I0=1.32 and no noise term all neurons fire.


T = 0:0.01:2000; 
xi = [0.1 0.01 0.1];  %initial conditions

zyi = 0.2 * randn; %Noise term with D=0.2

f = @(T,X)[X(2) - a*X(1)^3 + b * X(1)^2 - X(3) + I0 + (I1 * cos(40 * T)) + zyi;c - d*X(1)^2 - X(2) ; r*(s*(X(1) - x0) - X(3))]; 

y = sde_euler(f,g,T,xi); % Integrate
figure;
plot(T,y(:,1));
end

This does produce some result but for different value of "w" it does not produce exact result. ie if "w" is less(>20 and <40), then number of spikes generated should be less and for w between 40 and 50(approx) the no. of neuronal spikes should be maximum and for "w" >50 and "w" < 60 the neuronal spikes should be less again.Can anyone tell me how do i capture this.

As far as i can tell from https://github.com/horchler/SDETools/blob/master/SDETools/sde_euler.m ,

the function f should only describe the deterministic part of the SDE (what you solve with the ODE), while g should describe the noisy/diffusion part. It seems like you are putting the noise (zyi) into the deterministic f, which naturally messes everything up.

Where do you set the g in your code? It should be set to g=0.2, ie g=D.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM