Solving a nonlinear equation numerically

5 ビュー (過去 30 日間)
Nivedita Tanksali
Nivedita Tanksali 2020 年 10 月 29 日
コメント済み: Nivedita Tanksali 2020 年 10 月 30 日
I want to solve the nonlinear equation d^2(x)/dt^2 +(k)sinx = 0, numerically.
alternatively, this can be written as

回答 (1 件)

John D'Errico
John D'Errico 2020 年 10 月 29 日
It looks as if you don't need to solve it numerically.
syms x(t)
xpp = diff(x,t,2)
syms k
dsolve(xpp + k*sin(x) == 0)
dsolve(xpp + k*sin(x) == 0)
ans =
0
2*jacobiAM((2^(1/2)*(C1 - k)^(1/2)*(C2 - t)*1i)/2, -(2*k)/(C1 - k))
-2*jacobiAM((2^(1/2)*(C1 - k)^(1/2)*(C2 - t)*1i)/2, -(2*k)/(C1 - k))
Of course, it would help if you had some initial or boundary conditions. Then you might get a better answer.
But if you really, really need to solve it numerically, then you need to start with a tool like ODE45, and you need to pose a set of initial conditions, etc. As well, you need to define the value of k. No numerical solution can be found unless you specify k as a NUMBER.
  2 件のコメント
Nivedita Tanksali
Nivedita Tanksali 2020 年 10 月 30 日
The method that you've written the code for, what kind of method is it exactly?
as for boundary conditions,as im trying to solve the equation of motion for a nonlinear pendulum, i would think x=[0,pi/2] could be used.
The value of K is indeed a number, so that's not a problem.
Nivedita Tanksali
Nivedita Tanksali 2020 年 10 月 30 日
also, the initial conditions are that is, initial displacement is the amplitude
and and initial circular velocity is 0

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

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by