Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please only answer C-F 4. (35 pts) Thanks to the power of computing, many engineering problems using differential equations are solved numerically using a difference
Please only answer C-F
4. (35 pts) Thanks to the power of computing, many engineering problems using differential equations are solved numerically using a difference cquation. This is the core idea of the finite-clement method used extensively in electromagnetic for example. Consider a continuous-time signal z(t). Let us sample with sampling period T to obtain z[n] = z(nT'). Let us approximate the derivative of z(1) using the finite delay difference (with central divided differences) as ) dz dl z(t + A) - (t = lim 24 z(t +T) - 2(t-T) 27 where T is small but is non-zero. Sampling at nT :'(nT') z[n+ 1] --In-1) 2T With an equivalent calculation, the second derivative can be approximated as 2" (nt) 2 =[n+1] 22[n] + 2[n 1] T2 (a) g the finite difference approximations of derivives, rrwrite the diff. al equation in liffereeg ior iti ay D)) arii cu ons ati ght want to u 10cferencial | Gioi (0) = (y[0]-s[-])/T. (c) Using MATLAB, create a function to compute the recursive solution to this equation Yrecursive(t) for a given number of points. (as 0 YO rox function y = my_recursive_solution (N,T, yo, y1) %function y = my_recursive_solution (N,T, yo, y1) % % Function to implement a specific difference equation from HW 5. % %N: number of samples to output y[o], ..., y [N-1] % T : sample period % yo: initial condition y[0] % yi: initial condition y[-1] (d) Using your created function, create a plot of y(t) and of Yrecursive (t) for t (0, 10), for each of the values of T = 1,0.1,0.01, 0.001. Make sure you have adjusted the line widths and font sizes to make the result easy to read. Do not forget axis labels, title, and a legend. (c) Comment on the fit of the solution. (f) What do you think could be done to make the solution more accurate? 4. (35 pts) Thanks to the power of computing, many engineering problems using differential equations are solved numerically using a difference cquation. This is the core idea of the finite-clement method used extensively in electromagnetic for example. Consider a continuous-time signal z(t). Let us sample with sampling period T to obtain z[n] = z(nT'). Let us approximate the derivative of z(1) using the finite delay difference (with central divided differences) as ) dz dl z(t + A) - (t = lim 24 z(t +T) - 2(t-T) 27 where T is small but is non-zero. Sampling at nT :'(nT') z[n+ 1] --In-1) 2T With an equivalent calculation, the second derivative can be approximated as 2" (nt) 2 =[n+1] 22[n] + 2[n 1] T2 (a) g the finite difference approximations of derivives, rrwrite the diff. al equation in liffereeg ior iti ay D)) arii cu ons ati ght want to u 10cferencial | Gioi (0) = (y[0]-s[-])/T. (c) Using MATLAB, create a function to compute the recursive solution to this equation Yrecursive(t) for a given number of points. (as 0 YO rox function y = my_recursive_solution (N,T, yo, y1) %function y = my_recursive_solution (N,T, yo, y1) % % Function to implement a specific difference equation from HW 5. % %N: number of samples to output y[o], ..., y [N-1] % T : sample period % yo: initial condition y[0] % yi: initial condition y[-1] (d) Using your created function, create a plot of y(t) and of Yrecursive (t) for t (0, 10), for each of the values of T = 1,0.1,0.01, 0.001. Make sure you have adjusted the line widths and font sizes to make the result easy to read. Do not forget axis labels, title, and a legend. (c) Comment on the fit of the solution. (f) What do you think could be done to make the solution more accurateStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started