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!