Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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

image text in transcribed
(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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions