SOlving Simultaneous Differential Equations

I want to solve the following simultaneous equations
y1''=(y2')^2*sin(y1)*cos(y1)
y2''=-2*y1'*y2'*cot(y1)
I have tried the following code but didn't work.
clc; clear all;
syms u(t) v(t)
Du = diff(u,t);
Dv = diff(v,t);
ode1 = diff(u,t,2) == diff(v,t,1)^2*sin(u)*cos(u);
ode2 = diff(v,t,2) == -2*diff(u,t,1)*diff(v,t,1)*cot(u);
odes = [ode1; ode2];
cond1 = u(0) == pi/12;
cond2 = Du(0) == 0;
cond3 = v(0) == 0;
cond4 = Dv(0) == 20;
conds = [cond1; cond2; cond3; cond4];
[uSol(t), vSol(t)] = dsolve(odes,conds)
Please suggest an alternative and simple technique to solve the problem.

回答 (1 件)

John D'Errico
John D'Errico 2018 年 5 月 9 日

0 投票

help ode45

2 件のコメント

Muhammad Ahsan Tariq
Muhammad Ahsan Tariq 2018 年 5 月 13 日
Can you please write the code using ode45 for the above problem. I will be highly obliged.
Muhammad Ahsan Tariq
Muhammad Ahsan Tariq 2018 年 5 月 13 日
I need to plot u,v,u',v' against time.

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

カテゴリ

質問済み:

2018 年 5 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by