Here is the link to the theory. This is where the equations I'll be using are defined. (EQ-1 and EQ-2) I'll also post an image of the equations so you don't have to really go to this page if you don't want.
Here is the actual assignment.
ok, so I know I need two functions for each differential equation. Here are the functions I wrote:
Function 1: (For Part 1)
function [THWdot] = dsysEQ1(t,THW) g=9.8; l=10; % x -->TH % y -->W x=THW(1,1); y=THW(2,1); xdot=y*(t); ydot=(-g/l)*sind(x*(t)); THWdot(1,1)=xdot; THWdot(2,1)=ydot; end
Function 2: (For Part 2)
function [THWdot] = dsysEQ2(t,THW) g=9.8; l=10; % x -->W % y -->TH x=THW(1,1); y=THW(2,1); A=[0,1;(-g/l),0]; B=[y;x]; THWdot=A*THW+B; end
Here is my script. I haven't been able to get it to work for the first function and haven't begun writing script to utilize the other function or for labeling plots and such. I don't need help with plotting and if I can get some help writing script that makes the first function work, I should be able to finish the rest of it from there.
tSPAN=[0,60]; IC1=[0.25;0]; IC2=[1.50;0]; [t,THW]=ode45(@dsysEQ1,tSPAN,IC1); plot(t,THW) axis([0,60,-1,1])
Thank you for any help offered.