필터 지우기
필터 지우기

Trying to plot response after the transients have died out

조회 수: 1 (최근 30일)
ADITYA CHETANKUMAR SHAH
ADITYA CHETANKUMAR SHAH 2022년 1월 31일
답변: Balavignesh 2024년 3월 15일
clear H L year
H(1) = 10; L(1) = 10;
% For simplicity, keep track of the year as well
year(1) = 1845;
% Set up parameters (note that c = a in the model below)
br = 0.6; df = 0.7; a = 0.014;
nperiods = 365; % simulate each day
duration = 90; % number of years for simulation
% Iterate the model
for k = 1:duration*nperiods
%c = br; % constant food supply
b = br*(1+0.5*sin(2*pi*k/(4*nperiods))); % varying food supply
H(k+1) = H(k) + (b*H(k) - a*L(k)*H(k))/nperiods;
L(k+1) = L(k) + (a*L(k)*H(k) - df*L(k))/nperiods;
year(k+1) = year(k) + 1/nperiods;
if (mod(k, nperiods) == 1)
% Store the annual population
Ha((k-1)/nperiods + 1) = H(k);
La((k-1)/nperiods + 1) = L(k);
end;
end;
% Store the final population
Ha(duration) = H(duration*nperiods+1);
La(duration) = L(duration*nperiods+1);
% Plot the populations of rabbits and foxes versus time
figure(3); clf;
plot(1845 + [1:duration], Ha, 'b.-', 1845 + [1:duration], La, 'g.--');
%
axis([1845 1944 0 250]);
xlabel('Year');
ylabel('Population');
legend('hares','lynxes')
title('Varying food supply')
This is the code I have and I have found the transient response of the system but however, I am looking to find the response after the transients have died out but I am not able to know how to do it. It would be great if I can find any help.
  댓글 수: 2
Image Analyst
Image Analyst 2022년 1월 31일
What do you consider a transient in this plot:
ADITYA CHETANKUMAR SHAH
ADITYA CHETANKUMAR SHAH 2022년 1월 31일
The plot is the transient plot with 90 samples.

댓글을 달려면 로그인하십시오.

답변 (1개)

Balavignesh
Balavignesh 2024년 3월 15일
Hi Aditya,
It looks like you have found the transient response of the system, and now you would like to analyze the steady state characteristics i.e., after all the transients have died out. Transients in dynamical systems typically die out after sufficient time has passed, leaving the system in a behavior that is representative of it's long-term dynamics.
Since your transients haven't died out within the 90-year simulation, I extended the duration to 200 years to allow more time for the system to settle. The system didn't reach steady state even then, but continued following the same pattern.
Hence, I would suggest adjusting the model parameters so that the system will reach an expected behaviour. The adjustments could involve changing the birth rate, death rate, or other parameters to see how the affect the system's long-term behavior.
Remember, the goal is to let the simulation run long enough that you can confidently say the dynamics you're observing are representative of the system's behavior, independent of its initial conditions.
Hope this helps!
Balavignesh

카테고리

Help CenterFile Exchange에서 Thermal Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by