Solve a second order differential equation with ODE45, RK4 and draw with power series

9 ビュー (過去 30 日間)
jaehyeong park
jaehyeong park 2019 年 11 月 23 日
回答済み: JONNALA SISINDRA REDDY 2021 年 6 月 7 日
Hi, I am completely new to Matlab and am looking to solve a simple second order differential equation:
y''+x*y=0, −∞ < x < .
I am looking to solve for y(x) with rk4, ode45
And plotting with power series these general solutions.
I understand this is a simple equation to solve and have done it fine on paper. However I have been trying different ways to solve it on matlab but to no avail.
Thanks in advance
  2 件のコメント
Jan
Jan 2019 年 11 月 23 日
Do you want a numerical solution for a certain initial value or a symbolic solution?
jaehyeong park
jaehyeong park 2019 年 11 月 27 日
編集済み: jaehyeong park 2019 年 11 月 27 日
symbolic solution

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

回答 (2 件)

Jyotsna Talluri
Jyotsna Talluri 2019 年 11 月 26 日
Second order differential equations can be slved using 'dsolve'
syms y(x)
Dy = diff(y);
eqn = diff(y,x,2) == -x*y;
y(x) = dsolve(eqn);
y = simplify(y);
Refer to the dsolve for more information

JONNALA SISINDRA REDDY
JONNALA SISINDRA REDDY 2021 年 6 月 7 日
syms y(x)
Dy = diff(y);
eqn = diff(y,x,2) == -x*y;
y(x) = dsolve(eqn);
y = simplify(y);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by