Calculate steady state of a system of non-linear odes
58 次查看(过去 30 天)
显示 更早的评论
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 个评论
Sam Chak
2022-3-4
Is the function fsolve not sufficient to solve a system of nonlinear ODEs to find the equilibrium point(s)?
Bjorn Gustavsson
2022-3-4
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?
回答(1 个)
Kartik Saxena
2023-12-8
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:
- 'fsolve': https://www.mathworks.com/help/optim/ug/fsolve.html
- Optimization Options: https://www.mathworks.com/help/optim/ug/optimoptions.html
- 'eig': https://www.mathworks.com/help/matlab/ref/eig.html
I hope this resolves your issue.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!