J =
MATLAB Phase Plane App: Can I Increase the Precision of the Reported Equilibrium Eigenvalues?
Afficher commentaires plus anciens
The dynamics are very sensitive to whether the real part is slightly negative, zero, or positive, so I would like to view eigenvalues with precision on the order of 10^{-6} to 10^{-8} (or better).
My questions are:
- Is there a way to increase the displayed precision of eigenvalues in the MATLAB Phase Plane App?
- Does the app internally compute eigenvalues with higher precision and simply truncate the display?
- If the app is limited to double precision and fixed display formatting, is there a recommended workflow for extracting the equilibrium point and computing the Jacobian/eigenvalues outside the app with higher accuracy?
- Has anyone used the Phase Plane App to investigate weak foci or equilibria near Hopf bifurcations where eigenvalues are very close to zero?
I have already tried tightening the solver tolerances, but the displayed eigenvalues still do not show the level of precision I need.
Any suggestions would be appreciated.
The Phase plane app looks like screenshot attached, I'm not sure what the name is, it just says "Phase Plane" and I found it in the app section
4 commentaires
Please give a link to the app you are talking about.
Is it
from the MATLAB File Exchange ?
I could imagine that calling MATLAB's "eig" and "eigs" directly will give more flexibility to answer questions that arise with the interpretation of the results you obtain:
dpb
le 22 Août 2026
Which Phase Plane app is that, specifically? Don't find anything in base MATLAB by that name.
As for the precision of displayed values, that will depend upon how the app returns its calculated results. If it can return the values to local variables, you should be able to output those to whatever precision is desired. If it only outputs results in some text box or other control inside the app itself, you may be at its mercy unless it also provides the source and not just a compiled/bound app.
But, start by telling what app it is you're acutally using.
Kaylie
le 22 Août 2026
Can't do anything with just the image...no such app is installed by default and don't recognize the specific app from the list of those in the "Add Apps" search of which some half-dozen or more are returned from which to choose. Need an author/version or some other way to identify explicitly.
Still the answer to question will revolve about how you can get the result back from it that isn't at all able to be known from the menu launch icon. A link to its help documentation or source location would be the ticket.
As @Torsten notes above, comparing the values you are able to see from it as compared to the builtin functions will probably let you ascertain just what it is using internally if the documentation doesn't explicitly say/explain the basic algorithms. Using that you would be able to get the response directly and with whatever display precision desired up to the limit of what a double will be able to hold. There's virtually no doubt the app will be written around those builtin functions which will be based on standard doubles internally.
Réponses (1)
This is what AI gives as an answer to your first three questions:
No, there is no built-in toggle or setting to change the displayed precision of eigenvalues directly inside the user interface of the modern MATLAB Phase Plane App. The application relies on a hardcoded string format (typically %.4f) to render the text within its App Designer components. [1, 2, 3]
However, the app does compute the values with full double precision internally. If you are looking at highly sensitive behaviors (like a weak focus or equilibria near a Hopf bifurcation), you can work around the limited user interface display using two methods: [1]
Method 1: Modify the Source Code (Permanent Fix)
Because the Phase Plane and Slope Field apps are distributed as open MATLAB App Designer files (.mlapp) via the File Exchange, you can manually adjust the formatting: [1]
- Locate the downloaded file named PhasePlane.mlapp.
- Open it in MATLAB by typing appdesigner('PhasePlane.mlapp') in the Command Window.
- Switch to the Code View tab in the App Designer interface.
- Search (Ctrl + F) for the function that computes or displays the equilibrium data (look for terms like eig, Jacobian, or sprintf).
- Locate the text update assignment (e.g., app.EigenvaluesLabel.Text = sprintf('%.4f', ...)).
- Change the format specifier from %.4f to a higher precision choice like %.8f or %e (scientific notation).
- Save and run the app. [1, 2, 3]
Method 2: Extract and Calculate via Command Line (Recommended Workflow)
If you do not want to alter the app's internal files, you should export or reconstruct your system parameters in the MATLAB Command Window where you have full analytical control: [1, 2]
- Define your system symbolic or numerical equations in the Command Window.
- Identify the coordinates of the equilibrium point \((x^*, y^*)\) found by the app.
- Compute the Jacobian matrix (J) manually or using the Symbolic Math Toolbox.
- Run the following commands to view the eigenvalues with maximum precision: [1, 2, 3, 4, 5]
% Set display to show 15 decimal places
format long
% Compute precision-accurate eigenvalues
eigenvalues = eig(J)
If double precision is still insufficient to determine if a real part is truly zero, you can pass the symbolic matrix into the Variable Precision Arithmetic function by typing vpa(eig(sym(J))) to resolve the values to 32 digits or more. [1, 2]
Here is a possible workflow for a simple problem (dx/dt = x - y, dy/dt = x + y):
syms x y
dxdt = x - y;
dydt = x + y;
sol = solve([dxdt==0,dydt==0],[x,y]) % determine equilibrium point
x0 = sol.x;
y0 = sol.y;
J = jacobian([dxdt;dydt]) % get Jacobian at equilibrium point
format long
eigenvalues = double(eig(subs(J,[x,y],[x0,y0]))) % get eigenvalues of Jacobian at equilibrium point
2 commentaires
dpb
le 23 Août 2026
Presuming the above AI 'bot is correct that it is just a .mlapp file, then one could likely add an additonal menu item that allowed one to set the format of the display interactively without much more trouble than the hardcoded fix. Or, just add a disp() call where/after it is calculated internally and it'll dump it to the command window using the current format setting.
Hi @Kaylie
Can you manually "stamp" the eigenvalues in the plot using the desired numerical precision, without being restricted by the Phase Plane app? Here is the basic code setup for the root-locus plot (complex s-plane). However, I am unsure how you would like them to be displayed in the phase-plane Hopf Bifurcation plot. Though you can label the eigenvalues of the Jacobian matrix for a nonlinear Hopf system. See @Torsten's demo above.
% choose the desired formatting
format longg
% an almost marginally stable 2nd-order system (with negative real parts)
b = 2e-7;
c = 1;
A = [ 0, 1
-c, -b];
sys = ss(A, [0; 1], [1, 0], 0);
% find the eigenvalues (poles)
eigs= eig(sys)
% visualize the poles on the root locus plot
figure
rlocus(sys), grid on
hold on;
plot(real(eigs), imag(eigs), 'kx', 'MarkerSize',8, 'LineWidth',1.5);
% label the poles with the desired precision, say %.8f, using text() command
labels = arrayfun(@(z) sprintf('%.8f%+.8fi', real(z), imag(z)), eigs, 'UniformOutput', false);
text(real(eigs), imag(eigs), labels, 'VerticalAlignment','bottom', 'HorizontalAlignment','left');
hold off;
Phase Plane plot
% Parameters
omega = 2.0; % Rotation frequency
tspan = [0, 10]; % Simulation time span
y0 = [0.5; 0.5]; % Initial condition (start slightly off-center)
% Test cases for the bifurcation parameter mu
mu_values = [-0.5, -0.1, 0.0, 1.5];
titles = {'\mu = -0.5: Stable Spiral (Sink)', ...
'\mu = -0.1: Orbitally stable', ...
'\mu = 0: Hopf Bifurcation Point', ...
'\mu > 0: Unstable Center + Stable Limit Cycle'};
figure
for i = 1:length(mu_values)
mu = mu_values(i);
% Solve the 2D ODE system
[t, y] = ode45(@(t, y) hopf_system(t, y, mu, omega), tspan, y0);
% Plot the phase portrait (x vs y)
subplot(2, 2, i)
plot(y(:,1), y(:,2), 'b-')
hold on;
% Plot the origin (equilibrium point)
plot(0, 0, 'ro', 'MarkerFaceColor', 'r', 'MarkerSize', 1)
% If mu > 0, draw the theoretical limit cycle radius (r = sqrt(mu))
if mu > 0
th = linspace(0, 2*pi, 100);
r = sqrt(mu);
plot(r*cos(th), r*sin(th), 'r--')
legend('Trajectory', 'Equilibrium', 'Theoretical Limit Cycle', 'Location', 'best')
else
legend('Trajectory', 'Equilibrium', 'Location', 'best')
end
xlabel('x')
ylabel('y')
title(titles{i})
axis equal
grid on
axis([-2 2 -2 2])
end
% Hopf system
function dydt = hopf_system(~, y, mu, omega)
x = y(1);
y_coord = y(2);
% r^2 term used for the nonlinear damping
r2 = x^2 + y_coord^2;
% ODEs
dxdt = mu*x - omega*y_coord - x*r2;
dydt = omega*x + mu*y_coord - y_coord*r2;
dydt = [dxdt; dydt];
end
Catégories
En savoir plus sur Installing Products dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

