MATLAB Answers

How to adjust initial condition to nondimensionalization of coupled ODE?

조회 수: 8(최근 30일)
Muhammad Usman
Muhammad Usman 2021년 6월 2일
Here is the code for dimenional and non-dimensional form of coupled ODEs using ode45, but both results are not agreeing. Please help me in this regard.
close all;clear all;clc;
options = odeset('RelTol',1e-2,'AbsTol',[1e-2 1e-2]);
[T,Y] = ode45(@cbyjw_d,[0 30],[90000, 6000],options);
r = 4;
K = 1000000;
beta = 0.0002;
delta = 0.8;
[T1,Y1] = ode45(@cbyjw_nd,[0 30],[90000/K, 6000*(beta/r)],options);
figure(1);
plot(T,Y(:,1),'b-',T,Y(:,2),'b-.');
hold on;
plot(T1,Y1(:,1),'g-',T1,Y1(:,2),'g-.');
function dy = cbyjw_d(t,y)
dy = zeros(2,1);
A = 0;
r = 4;
K = 1000000;
beta = 0.0002;
alpha = 4e-6;
delta = 0.6;
gamma_B = 130;
gamma_W = 40;
dy(1) = r*y(1)*(1-y(1)/K)-beta*y(1)*y(2)-gamma_B*A*y(1);
dy(2) = alpha*y(1)*y(2)-delta*y(2)-gamma_W*A*y(2);
end
function dy = cbyjw_nd(t,y)
dy = zeros(2,1);
A = 0.02;
r = 4;
K = 1000000;
beta = 0.0002;
alpha = 4e-6;
delta = 0.8;
gamma_B = 130;
gamma_W = 40;
theta = (gamma_B*A)/r;
phi = (gamma_W*A*delta)/beta;
sigma = delta*alpha*K/beta;
exi = delta^2/beta;
dy(1) = y(1)*(1-y(1))-y(1)*y(2)-theta*y(1);
dy(2) = sigma*y(1)*y(2)-exi*y(2)-phi*y(2);
end
For more details about the model and it's non dimensionalized form please visit: Coupled ODEs.
Thanks

답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by