How can I express a set of nonlinear differential equations in the form ๐‘ฅ ห™ = ๐ด ( ๐‘ฅ ) โ‹… ๐‘ฅ + ๐ต using MATLAB code ?

์กฐํšŒ ์ˆ˜: 6 (์ตœ๊ทผ 30์ผ)
Manish Kumar
Manish Kumar 2025๋…„ 2์›” 10์ผ
๋Œ“๊ธ€: Sam Chak 2025๋…„ 2์›” 28์ผ
dXdt = @(X) [
2*(x(1) + 0.005)^2 + 3*(x(1) + 0.005)*(x(2) + 0.003);
2*(x(1) + 0.005) + 4*(x(2) + 0.003)^2;
(x(1) + 0.005)^3 + (x(2) + 0.003)*(x(3) + 0.05);
2*(x(3) + 0.005) + (x(4) + 0.025)^2;
(x(1) + 0.005)*(x(5) + 0.0236) + (x(2) + 0.003) + (x(4) + 0.0125)
];
Given a set of nonlinear differential equations for dxdt , how can I express the system in the form x_dot = A(X)*X+B using MATLAB code?
X=[x(1), x(2)....x(5)] is the states
  ๋Œ“๊ธ€ ์ˆ˜: 2
Torsten
Torsten 2025๋…„ 2์›” 10์ผ
Given a set of nonlinear differential equations for dxdt , how can I express the system in the form x_dot = A(X)*X+B using MATLAB code?
Why do you want to do that ? MATLAB can solve the original nonlinear system directly.
Sam Chak
Sam Chak 2025๋…„ 2์›” 10์ผ
@Manish Kumar, If you are not referring to Jacobian linearization within the System Dynamics course, you must be implying Carleman linearization, which is typically not covered in undergraduate courses.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

๋‹ต๋ณ€ (1๊ฐœ)

Divyam
Divyam 2025๋…„ 2์›” 28์ผ
Assuming that you are referring to Jacobian linearization, for expressing a set of non-linear differential equations in the form , you can use the 'jacobian' function to find the linear part . Then you can identify any constant terms or terms that do not depend linearly on the state vector to form B.
syms x1 x2 x3 x4 x5 real
% Define the state vector
X = [x1; x2; x3; x4; x5];
% Define the nonlinear system
dXdt = [
2*(x1 + 0.005)^2 + 3*(x1 + 0.005)*(x2 + 0.003);
2*(x1 + 0.005) + 4*(x2 + 0.003)^2;
(x1 + 0.005)^3 + (x2 + 0.003)*(x3 + 0.05);
2*(x3 + 0.005) + (x4 + 0.025)^2;
(x1 + 0.005)*(x5 + 0.0236) + (x2 + 0.003) + (x4 + 0.0125)
];
% Compute the Jacobian matrix A(X)
A = jacobian(dXdt, X);
% Compute the constant term B by substituting X = 0
B = simplify(subs(dXdt, X, zeros(size(X))) - A * zeros(size(X)));
disp('A(X) = ');
A(X) =
disp(A);
โ—
disp('B = ');
B =
disp(B);
For more information regarding the 'jacobian' function, refer to the following documentation: https://www.mathworks.com/help/symbolic/sym.jacobian.html
  ๋Œ“๊ธ€ ์ˆ˜: 1
Sam Chak
Sam Chak 2025๋…„ 2์›” 28์ผ
Hi @Divyam,
But if you make as the Jacobian matrix , then this product term is simply untrue according to the principle of linearization or approximation via Taylor series.
You can test performing the Jacobian on . Does approximate at every point where is differentiable?

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Nonlinear Dynamics์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

Community Treasure Hunt

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

Start Hunting!

Translated by