Starting from:

$35

ENEL101 -Problem set 7 -Symbolic Math Solved


 

Important Notes: 

•       This assignment is about using Matlab symbolic math.  The questions are based on content from chapter 11 of the textbook “Matlab, An introduction with applications”.

•       Complete this assignment by filling in the template file, assign7.m, with your Matlab function files.  

•       The function files will be tested by the auto-tester using randomly generated data.   

•       Do NOT put any plots in your answer.  

•       Unlike the other assignments, a passing grade on this assignment is 75%.

 

 

 

Make sure your final submission runs without syntax error. As usual, template files that do not run without syntax error will be rejected by the auto-marker, and you will have to visit Chris in person to demo your code and get the marks.     

 

 

 

Q1.  Using Matlab symbolic math and the solve() function, find the leftmost point (with x on the horizontal axis) where these two ellipses intersect:

                                                           (𝑥 − 1 + 𝑟)(          𝑦(

                                                                      (                         +        3( = 1

6

                                                             𝑥 + 2 (            𝑦 − 5 (

                                                                 (          +      4(           = 1

2

where 𝑟 = 0.1.  Please make your answer a 1x2 vector with the x and y components of the answer.  Hint 1) Due to the presence of variable 𝑟,     first create symbolic expressions for the ellipses and then use them in solve(), rather than putting it in quotes as an argument to solve().  Hint 2)  Use solve(ellipse1,ellipse2,’MaxDegree’,4) to make MATLAB give you an analytical solution Hint 3) use eval() to turn your symbolic answers into floating-point answers

 



 

 

 

ENEL101                                                                                                                                                                                        Assignment                     6                              Page          1               

               

Q2.  Write a function that finds the equation of the tangent line to the upper part of the ellipse (x on horizontal axis, y on vertical axis)  

                                                             𝑥 + 2 (            𝑦 − 5 (

                                                                 (          +      4(           = 1

2

 

at 𝑥4 = −0.1. The answer will be a symbolic math expression of the form

𝑚𝑥 + 𝑏    

where 𝑚 and 𝑏 have numerical values and 𝑥 is a symbolic variable.   Hint: first solve for 𝑦              using solve(), select the 𝑦 that is the top part of the ellipse, then use diff() to take the derivative with respect to 𝑥, then get the slope 𝑚 by substituting in 𝑥4            using subs(), and then calculate the yintercept 𝑏. As the very last step you can use vpa() to turn all numerical values in the symbolic answer (i.e. 𝑚 and 𝑏) into floating point numbers in order to compare your answer to the solution set.  

 

Q3. Evaluate the following indefinite integral

 

 8 𝐼 =                                 𝑑𝑥 

for R=1. Hint: use the function subs() to substitute a numerical value for R. 

 

               

Q4.  The current 𝑖 in a series RLC circuit can be described the differential equation

                                                                𝑑(𝑖               𝑑𝑖       1

 𝐿                    𝑑             𝑡( + 𝑅      𝑑𝑡 + 𝐶 𝑖 = 0 

 

  Using dsolve(), find the solution 𝑖 𝑡                                                                                        given initial conditions 𝑖 0          = 0, ?@ (0) = 8, and parameters 𝐿 = ?A

3𝐻, 𝑅 = 10Ω, 𝐶 = 80𝜇𝐹.  Use variable ‘current’ in the code instead of ‘i’ to avoid conflicts with ‘i’ as a numerical counter.   

 

               



 

 

 

 

ENEL101                                                                                                                                                                                        Assignment                     6                              Page          2               

               

More products