can anyone help me by giving matlab code regarding these questions?

  Kiến thức lập trình

picture of the question is here

I want Matlab codes regarding these questions, and I want an explanation.. If you provide me with a reference regarding this question, it will be more helpful. Here is the question: 

***Natural response of LCR circuits. We will investigate the series LCR circuit described in the notes. Suppose that L = 1H C = 1F , V_{0} = 1V and the damping ratio ( is unknown.
(a) Write script in an m-file that (i) calculates the value of R in terms of ζ, and (ii) sets up and solves the characteristic equation to find two values of s. Test the script for some ( values by substituting in the final expression. (Hints: zeta is already defined in Matlab, so don’t use this name; use digits and vpa for improved display.)
(b) Add script with symbolic maths to generate the complete solution for the capacitor voltage in terms of two unknown constants, k₁ and k₂, and time t. Use symbolic maths to apply the initial conditions, solve for k₁ and k2, and substitute back into the complete solution. Test the script for some and t values by substituting in the final expression. Explain what happens when zeta = 1 (Hint: final results for capacitor voltage should have no imaginary part, but there may be a small round-off error. This can be removed with real().)
(c) Turn the script into a function taking two-dimensional arrays of t and as input. Determine the dimensions of the t array, and assume the array has the same dimensions. Used nested for loops to calculate an output array of capacitor voltage for each pair of t and values with the same dimensions.
(d) Use meshgrid and mesh to plot the voltage over t = 0s to 15s and zeta = 0.01 to 1.5, making sure zeta = 1 does not appear in the mesh. By rotating the mesh plot, investigate
(i) overshoot-by what % the signal passes its final value. Notice that overshoot appears when zeta > 1 What is the overshoot as approaches zero?
(ii) risetime when there is no overshoot, how quickly the response rises from 10% to 90% of its final value. Notice that the critically damped solution has the fastest rise time without overshoot. In practice, a small amount of overshoot may be traded for a faster rise time.


LEAVE A COMMENT