Calculate steady state of a system of non-linear odes

58 views (last 30 days)
I'm trying to solve a system of non linear odes in Matlab as follows.
editparams %parameters
Tend = 50;
Nt = 100;
% Define RHS functions
RHS = @(t,x) ModelRHS(t,x,param); %anonymous function defining the set of odes
%Execution-----------------------------------------------------------------
x0 =[0.03;0.05;0.085]; %Initial condition
t = linspace(0,Tend,Nt); %TSPAN
[t x] = ode45(RHS, t, x0);
I need to find the steady state of the system and I'm trying to create a function for this. Apart from that, I thought I'd use the Jacobian to identify stable and unstable steady states. My equations are in an anonymous function which is defined as `f` in the code below.
Can someone please help me to code the steady state function?
function SS = SteadyState(param, E)
f = @(t,x)ModelRHS(t,x,param,E); %set of odes
SymbolicSystem = sym(f); %trying to make the anonymous function symbolic
SymbolicJacobian = jacobian(SymbolicSystem',x); %jacobian
Jacob = matlabFunction(SymbolicJacobian,x);
end
Thanks in advance!
  2 Comments
Sam Chak
Sam Chak on 4 Mar 2022
Is the function fsolve not sufficient to solve a system of nonlinear ODEs to find the equilibrium point(s)?
Bjorn Gustavsson
Bjorn Gustavsson on 4 Mar 2022
how could we possibly help with the information you've provided? We not absolutely nothing about your ODE-function except that it is non-linear. That is not sufficient to even start helping. What about just integrating the ODE numerically to see if it aproaches some steady-state level/behaviour?

Sign in to comment.

Answers (1)

Kartik Saxena
Kartik Saxena on 8 Dec 2023
Hi,
I understand that you need to find the steady state of a system of nonlinear ODEs.
You can use MATLAB's 'fsolve' function, which attempts to solve a system of equations defined by f(x) = 0. The steady state of an ODE system occurs when the derivatives (RHS of the ODEs) are zero, which means the system is at equilibrium.
Here's an outline of how you can create a function to find the steady state and use the Jacobian to identify the stability:
  • Define the Steady State Function.
  • Find the Steady State.
  • Determine Stability Using the Jacobian.
For more detailed information on 'fsolve' and options for solving nonlinear equations, you can refer to the following MathWorks documentations:
I hope this resolves your issue.

Community Treasure Hunt

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

Start Hunting!