Borrar filtros
Borrar filtros

How to solve a partial derivative equation in MATLAB?

3 visualizaciones (últimos 30 días)
Westin Messer
Westin Messer el 24 de Nov. de 2018
Respondida: Torsten el 26 de Nov. de 2018
Hello, orgininally I solved this set of differential equations using Euler's method:
Equations.JPG
they were solved with this:
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
Now I have a similar set of equations as shown below:
equations.JPG
Can anyone explain how I might go about adjusting my code to solve for this partial derivative in the new equations? Thank you so much!
Here is the full source code:
%Clear command window and workspace
clear
close all
clc
% Fitzhugh-Nagoma model parameters
e=0.03; k=3; a=0.05;
i = 0.001;
figure(1);
hold on
u=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])

Respuestas (1)

Torsten
Torsten el 26 de Nov. de 2018
Use "pdepe".
Best wishes
Torsten.

Categorías

Más información sobre Mathematics en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by