Symbolic Vector ODE numerical solution

조회 수: 3 (최근 30일)
Leonardo Dipilato
Leonardo Dipilato 2020년 6월 14일
댓글: Walter Roberson 2020년 6월 15일
I'm trying to solve an ODE using vectorized symbolic calculus.
N = 4;
syms theta(t) [1 N]
Q = tril(ones(N));
theta = theta*Q';
eq = diff(theta, t, t) - cos(theta);
Dt = diff(theta, t);
How can I use this with ode45 or other solvers?
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 6월 15일
To use that with ode45 or similar, I recommend reading the first example for odeFunction() as it shows the steps to use to prepare symbolic differential equations for use with ode45 or similar.

댓글을 달려면 로그인하십시오.

답변 (1개)

Paresh yeole
Paresh yeole 2020년 6월 14일
in your equation for 'eq', if you are looking for double differentiation then it should be
eq = diff(theta, t, 2) - cos(theta);
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 6월 14일
diff(theta, t, 2) and diff(theta, t, t) are treated the same, both become diff(theta, t, t) on output.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by