Solving ODE with multiple initial conditions

2 次查看(过去 30 天)
So I know people on these forums dont usually like to help people with homework quesitons, but I am genuinely stuck and any hints would be appriciated.
Question2.JPG
So far I have managed to produce the code bellow;
%Using y for theta and x for t
clear,clc,close;
g=9.81;
L=1;
syms y(x)
Eqn1='D2y+((g/L)*sin(y))=0';
Inits='[y(0)=[0.5;0.8],Dy(0)=[0;0]]';
y=dsolve(Eqn1,Inits);
This code returns an error, previously I could get it to run with a single input for both y(0) and Dy(0), but this would not be enough information for matlab to solve the equation so I would be returned with an error stating that no explicit solutions could be found.
After searching for help else where I was told that my answers had to be inputted as a vector, if this is true where am I going wrong?
Thanks for any help :)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by