Question: (40 points) m( Put + ku(t) = psin(at), ,,(t = 0) =b, u(t = 0) = a, The second-order ODE, shown in Eq. (1), with

 (40 points) m( Put + ku(t) = psin(at), ,,(t = 0)

(40 points) m( Put + ku(t) = psin(at), ,,(t = 0) =b, u(t = 0) = a, The second-order ODE, shown in Eq. (1), with the initial conditions, shown in Eq. (2), can be solved numerically by using the Euler's method. Write your MATLAB code to solve the DFQ by using the Euler's method. To this end, the Euler's method should entail the following steps: * By using auxiliary variables, ui (t)-u(t) and u2(t)- , we decompose (1) into two first-order ODEs as: Out(t) = ta(t) ot 0%(t) = psin(wt)-kul (t) . Then, we update the values of t (t) and u2(t), starting from the initial conditions Our ot m(t = 0) = a and u2(t = 0) = b, as: = ui (t) + u2(t) t au2 In this example, consider m = 5, k = 10, p = 2, w = 1, a = 1, and b 2. The time step is 0.005 s. The displacement time history, obtained from your MATLAB code, should look like Fig. 1. Please refer to the following code. You only need to complete the unfinished lines within a for loop of the following code. It is fine to write your own code from

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!