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.

Answers (1)

help ode45

2 Comments

Can you please write the code using ode45 for the above problem. I will be highly obliged.
I need to plot u,v,u',v' against time.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!