- 'ode45' function: https://www.mathworks.com/help/matlab/ref/ode45.html
- 'Saddle points': https://www.mathworks.com/videos/visualizing-a-simple-saddle-point-algorithm-in-matlab-99180.html
How to plot the convergence path to a saddle point
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Imagine the following dynamical system, characterized by two stable equilibria (A and B) and an internal saddle point (C) separating its two basins of attraction of A and B.
clear all
syms x y a b c d e f g h i
Fx = a*x*(x - 1)*(d - (f*x + c*(i - 1))*(y - 1) + g*(x - 1) + y*(f*x - h + c*(i - 1)))
Fy = b*y*(y - 1)*(x*(h - i*(e + c - f*x)) - h*(x - 1) + i*x*(c - f*x))
par = {[a b c d e f g h i], [0.05 0.05 30 20 10 2 5 2.5 0.4]}
The phase plot for the parameters above is as follows.
How can the only path converging at saddle point C (the one in green) be plotted?
Thank you to anyone who will try to help me.
0 Kommentare
Antworten (1)
Balavignesh
am 14 Nov. 2023
Hi Alessandro,
It is my understanding that you have a dynamical system, characterized by two stable equilibria. The internal saddle point 'C' is separating the two basins of attractions 'A' and 'B', and you would like to plot the path converging at the saddle point.
The path you're referring to, which converges to the saddle point is called the 'stable manifold' of the saddle point. Computing the path analytically can be challenging for a non-linear system. So, I would suggest you use 'ode45' function to approximate this path numerically by integrating the system's dynamics backwards in time from a point near the saddle.
The following example code may help you understand this. I am assuming the initial coordinate points near the saddle point. The choice of this point will affect the accuracy of the approximation.
% Initialize MATLAB
clc;
clear;
close all;
% Define system parameters
a = 0.05;
b = 0.05;
c = 30;
d = 20;
e = 10;
f = 2;
g = 5;
h = 2.5;
i = 0.4;
% Define system dynamics
Fx = @(x,y) a*x*(x - 1)*(d - (f*x + c*(i - 1))*(y - 1) + g*(x - 1) + y*(f*x - h + c*(i - 1)));
Fy = @(x,y) b*y*(y - 1)*(x*(h - i*(e + c - f*x)) - h*(x - 1) + i*x*(c - f*x));
% Define initial condition near the saddle point. Use your own initial
% conditions
x0 = 0.55; % replace with your value
y0 = 0.55; % replace with your value
% Integrate system dynamics backward in time
tspan = [0 -10]; % integrate backward for 10 time units
[t,xy] = ode45(@(t,xy) [Fx(xy(1),xy(2)); Fy(xy(1),xy(2))], tspan, [x0; y0]);
% Plot the path
figure;
plot(xy(:,1), xy(:,2), 'g');
xlabel('x');
ylabel('y');
title('Stable Manifold of Saddle Point');
Please refer to the following documentation links to have more information on the following:
Hope that helps!
Balavignesh.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!