the required problem is 2x''+9x=0 x(0)=1 x'(0)=2he gave us what should be the solution but i cant get it to turn outsystem1.m>>edit %in system1.mf=zeros(2,1);functionf=f(t,x)f=zeros(2,1);f(1)=(2);f(2)=-4.5*x(1);system2.m>>edit%in system2.mtime=0:0.001:15;time=time';xo=[1;2][t,x]=ode45('system1.m',time,x0)plot(t,x(:,1));xlabel('time,sec');ylabel('displacement,m');title('first response simulation')>>system2any help??
2/1/2006 9:25:47 PM
http://www.thewolfweb.com/message_topic.aspx?topic=384293p.s. 2x''+9x=0 isnt the problem he gave us. it was just the example he did in class
2/1/2006 9:27:20 PM
i know but if i can get that one to work then i can do the other one....
2/1/2006 9:30:40 PM
heres the example, then use the other thread%system1.mfunction f=f(t,x)f=zeros(2,1);f(1)=x(2);f(2)=-4.5*x(1)%this is an executable to simulate vibration %described by system1.m%filename: myluckyday.m%free response simulationtime=0:0.01:15;time=time';x0=[1:2]; %initial condition[t,x]=ode45('system1',time,x0);plot(t,x(:,1));xlabel('time, sec')ylabel('Displacement, m');title('First Try')
2/1/2006 9:32:38 PM
that's exactly it. so all you have to do is just change your f(2) and you x0
2/1/2006 9:39:39 PM