Clear Filters
Clear Filters

Solving ODE with multiple initial conditions

1 view (last 30 days)
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 :)

Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!