Hello, I oringinally wrote this matlab code to model the FitzHugh-Nagumo action potential. Now I'm trying to modify the model to get a string of action potentials. To do this I need to change all the state variables to array shown below:
These equations:
% Fitzhugh-Nagoma model parameters
e=0.03; k=3; a=0.05;
Are changed to this:
% Fitzhugh-Nagoma model parameterse=[0.03 0.03]; k=[3 3]; a=[0.05 0.05];
However when I do this the code doesn't run. Can somebody explain what needs to change in the rest of the code to get it to work? Thanks a lot!
%Clear command window and workspace
clear close allclc% Fitzhugh-Nagoma model parameterse=[0.03 0.03]; k=[3 3]; a=[0.05 0.05]; i = 0.001;figure(1);hold onu=zeros(100000,1);v=zeros(100000,1);t=zeros(100000,1);% Initial conditions:
u(1)=0.6;v(1)=0.0;t(1)=0;dt=0.001;%==========================================================================
% Forvard Euler Method, for soluing the ODE
%==========================================================================for i=1:1:500000 t(i+1)=t(i)+dt; u(i+1) = u(i)+ dt*((1/e)*((k*u(i)*(u(i)-a)*(1-u(i)))-v(i))); v(i+1) = v(i)+ dt*(u(i)-v(i)); end% Getting the plot
figure(1);plot(t,u)legend('u','Trajectory')title('Time Series Plot')xlabel('Time')ylabel('u')xlim([0 5])
Best Answer