Second order ordinary differential equation

9 ビュー (過去 30 日間)
Abdul
Abdul 2024 年 1 月 15 日
コメント済み: Sam Chak 2024 年 1 月 16 日
I am trying to find the exact solution of this differential equation, but the error 'explicit solution not found' occur -y''(x) +2cos2x*y(x) -lambda*y(x) =0
  3 件のコメント
Abdul
Abdul 2024 年 1 月 15 日
I am using the command dsolve for finding the exact solution of this problem. If you have a code that works, kindly share it thanks
Walter Roberson
Walter Roberson 2024 年 1 月 15 日
The notation is a bit ambiguous.
Note that it matters in the end.
syms y(x) lambda
dy = diff(y);
d2y = diff(dy);
eqn = d2y + 2 * cos(2*x) * y - lambda*y == 0
eqn(x) = 
dsolve(eqn)
Warning: Unable to find symbolic solution.
ans = [ empty sym ]
eqn2 = d2y + 2 * cos(2*x * y) - lambda*y == 0
eqn2(x) = 
dsolve(eqn2)
Warning: Unable to find symbolic solution.
ans = [ empty sym ]

サインインしてコメントする。

回答 (1 件)

Sam Chak
Sam Chak 2024 年 1 月 15 日
I believe that 'explicit solution not found' is more of a notification than an error message. Upon closer inspection, your second-order system appears to resemble the Mathieu Differential Equation. If that's the case, the solution is provided in the form of the Mathieu function. For additional information, please refer to the following file on File Exchange:
  1 件のコメント
Sam Chak
Sam Chak 2024 年 1 月 16 日
@Abdul, I don't know how to express the Mathieu functions in MATLAB, but I simulated the Mathieu differential equation for different values of lambda (λ) to observe the stability of the solutions.
lambda = 1:6;
t = 0:0.01:60;
y0 = [1; 0];
for j = 1:numel(lambda)
sol = ode45(@(t, y) MathieuDE(t, y, lambda(j)), t, y0);
y = deval(sol, t);
subplot(2, 3, j)
plot(y(1,:), y(2,:)), grid on
xlabel('y_{1}'), ylabel('y_{2}')
title("\lambda = "+string(lambda(j)))
axis equal
end
%% Mathieu Differential Equation
function dydt = MathieuDE(t, y, lambda)
dydt = zeros(2, 1);
dydt(1) = y(2);
dydt(2) = 2*cos(2*t)*y(1) - lambda*y(1);
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by