How to solve the Logistic Delay differential equation with out using dde23, ddesd, ddensd, deval functions? Need to use for loop or if condition.... Please help

1 Ansicht (letzte 30 Tage)
%% Dx(t) = r*x(t)*(1-x(t-tau))
%% r=0.5
%% x(0)=0.85
%% If tau=0
%% Dx(t) = r*x(t)*(1-x(t))
%% r=0.5
%% x(0)=0.85
%% We use Nonstandard finite difference scheme and obtain the code given below.
close all
clear all
clc
N=100;
h=0.2;
r=0.5;
x(1)=0.85;
for n=2:h: N
x(n)=(1+h*r)*x(n-1)/(1+h*x(n-1))
end
plot (x)
Please write the code using tau function (Means delay factor)
Please donot use built in functions....
  1 Kommentar
Steven Lord
Steven Lord am 10 Jan. 2019
The fact that you're asking not to use the built-in functions suggests to me that this is a homework assignment. If that's the case show us the full text of the assignment and what you've tried to do to solve the assignment and ask a specific question about where you're having difficulty and you may receive some guidance.
If this is not a homework assignment, why aren't you allowed to use the delay differential equation solvers included in MATLAB? Doing so probably would be easier and more robust than building your own.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by