Question: Write a MATLAB function to solve the generic 2nd order, linear, constant coefficient, non-homogeneous, differential equation: d2x dx a + b + cx = F(t)
Write a MATLAB function to solve the generic 2nd order, linear, constant coefficient, non-homogeneous, differential equation: d2x dx a + b + cx = F(t) Where a, b, and c are all constants and F(t) is a function of time. Your MATLAB script should use the ode45 solver to determine the solution. The first line of the functiorn should be function [tyl = hw4-lastname(a,b,c,ty_at-end) where: . a, b, c: constant coefficients in differential equation f: handle to the function Fit) VLO: 2-element vector containing the initial conditions . tend: final time for solution Once your function is working, run it for the initial value problem: mi + 5x = 10 cos(3t); i(0) = x(0) = 0 Have your script plot both the solution x(t) and the forcing function F(t) on the same graph
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
