MATLAB: Ode45 or oder15s any idea for solving the second order wave equation ode45 oder15s wave equation Hi! I'm a beginner and I'm trying to solve this eq with matlab, any idea/link/code as first step? thanks Best Answer function wavex10=...;x20=...;[T,Y] = ode45(@rhs,[0 12],[x10 x20]);plot(T,Y(:,1),'-',T,Y(:,2),'-.');function dy = rhs(t,y)w0=...;n=...;x=...;L=...;An=...;Ant=...;Ft=...;dy = zeros(2,1); % a column vectordy(1) = y(2);dy(2) = -w0^2*(n*x/L)^2*y(1)+(An+Ant)*Ft;endBest wishesTorsten. Related SolutionsMATLAB: How can i pull a corresponding y value for t=0.5, the matlab script below will out a list of values for y and t. Easiest is to use the interp1 function:y_t_05 = interp1(t, y, 0.5)y_t_05 = 1.093740231070597 MATLAB: Solve a second order differential equation % x1=y%x2=dyThen%dx1=dy=x2%dx2=d2y=-w^2*y=-w^2*x1save this function as yourfcnfunction dx=yourfcn(t,x)w=1dx(1)=x(2)dx(2)=-w^2*x(1)Then call the ode45 function[t,x]=ode45(@yourfcn,[0,pi],[0 0])Then deduce yy=x(:,1) Related QuestionSolve system of second order differential equations with ode45Problem in ezplot with simple equationSystem of differential equationsUsing ode 45 to estimate the derivative
Best Answer