<jupyter_start><jupyter_text>447 Sp21 exam 1 due 5p Fri May 7***Instructions:***- Solutions with just the answer to the question **will not** be accepted as complete solutions -- you must show your work. If you are unsure as to how much work is appropriate to show, please come and ask questions during classtime or office hours.- Each subproblem is worth two points, 1 point for effort and 1 point for solution accuracy.- Submit BOTH the pdf and the .ipynb notebook to canvas. You can download the .ipynb notebook by going to ```File```$\rightarrow$ ```Download``` $\rightarrow$```Download .ipynb```.***You are welcome (and encouraged) to:***- use analytical and numerical computational tools -- specify the tool(s) in sourcecode and/or text;- reuse example sourcecode and other materials provided in this course;- consult textbooks, websites, and other publicly-available materials -- include full citation(s) with the URL and/or [DOI](https://en.wikipedia.org/wiki/Digital_object_identifier).***You are not permitted to discuss the exam problems or share any part of your solutions with anyone other than the Professor or TA for this course.***- By submitting your exam solution on Canvas, you are affirming your understanding of and adherence to these restrictions.- We will answer questions during classtimes Monday May 3 and Wednesday May 5.- We will also answer questions sent to our Canvas inbox or Discord DM until 5p Fri May 7.***The exam deadline is 5p Fri May 7 on Canvas.***- Final submissions received before this deadline will receive +1 bonus points.- Everyone automatically receives a deadline extension to 11:59p Sun May 9. ***No further deadline extensions will be granted -- please plan accordingly.***  problem (1.)Sometimes, the measured output $y_{meas}$ is not the same as the output of the feedback system $y_{actual}$ due to sensor dynamics. We can model the sensor dynamics using a transfer function $H$, which is demonstrated in the following block diagram: ![block diagram](https://drive.google.com/uc?id=1dXLVNmik117Wt_g6armzFiFlLPaSvPE3) subproblem (1a.)Determine the transfer function $G_{y_{actual}r}$ from $r$ to $y_{actual}$. subproblem (1b.)Let the process $P(s) = \frac{K}{(Js+b)(Ls+R)+K^2}$ (i.e., a DC motor with moment of inertia $J$, motor viscous friction constant $b$, electric resistance $R$, electric inductance $L$, and motor torque and back emf constants $K$), the controller $C(s) = k_P+k_Ds$ (i.e., a proportional-derivative controller), and the sensor dynamics $H(s) = 1$ (i.e. a perfect sensor). Assume the initial states of the process are equal to 0 -- if a step input is applied to $G_{y_{actual}r}$ that you found in (1a.), what is the steady-state output? (If you couldn't find $G_{y_{actual}r}$ in (1a.), assume $G_{y_{actual}r}=\frac{PC}{1+PC}$.) subproblem (1c.)Let $J=1, b=0.1, K=0.01, R= 1, L=0.5$ and hold $k_D=1$ constant. Plot the root locus of the closed-loop characteristic polynomial as $k_P$ varies. subproblem (1d.)Determine the range of $k_P$ that results in a stable closed-loop system *with the real part of the roots less than $-0.5$*. You may do this analytically (e.g. pen-and-paper) or numerically (e.g. using the root locus from (1c.)). If you could not get a solution for subproblem 1a, use $G_{y_{actual}r} = \frac{PC}{1+PC}$.  problem (2.)Consider the following process model:$$ P(s) = \frac{b(s)}{a(s)} = \frac{b_1 s^2 + b_2 s + b_3}{a_0 s^3 + a_1 s^2 + a_2 s + a_3} $$where $b_1,b_2,b_3$ and $a_0,a_1,a_2,a_3$ are nonzero parameters. subproblem (2a.)Suppose $a_0 = -1$, $a_2 = -3$, $a_3 = -2$; what range of values for $a_1$ ensure $P$ is stable? You *cannot* use computational tools to obtain the range of values -- you must do any calculations by hand and show your work.   problem (3.)Consider a simplified dynamics of vehicle steering, where the orientation $\theta$ of the vehicle is controlled by the steering angle $\delta$. The states of the system are $y,\theta$, with $y$ being the position of the center of mass of the car and $\theta$ as the orientation of the vehicle. We define the nonlinear system $(\text{NL}$): $$ \dot{y}=v_0\sin(\alpha(\delta)+\theta), \text{   } \dot{\theta}=\frac{v_0 \sin \alpha(\delta)}{a},\text{   where } \alpha(\delta)=\arctan(\frac{a\tan \delta}{b})$$Let $a$ be the distance between the center of mass of the car and the rear wheel, and $b$ be the wheelbase.   subproblem (3a.)Let $v_0=30 \text{ mph}, a=1.5\text{ m}, b=3\text{ m}, \delta=0$. Create a phase portrait of $(\text{NL})$ on the square $x_1,x_2\in(-1.5,+1.5)$ where $x_1, x_2$ are the states of the system:  use ``plt.quiver`` or ``plt.streamplot`` as in the examples presented in lecture / provided on homework solutions.  subproblem (3b.)Consider the phase portrait below. Visually inspect and identify all equilibrium point(s); are the equilibrium point(s) stable or unstable and why?*Alt text: A graph labeled $x_1$ on the horizontal axis and $x_2$ on the vertical axis spanning $-1.5 < x_1 < 1.5, -1.5 < x_2 < 1.5$. Above the $x_2$ axis, horizontal arrows point towards the right increasing in length as $x_2$ increases in value. Below the $x_2$ axis, horizontal arrows point towards the left increasing in length as $x_2$ decreases in value.*![phase portrait](https://drive.google.com/uc?id=1X_z0uWBIpQh50o_WHYTzulS7XIsKUkGp)  problem (4.)Consider the nonlinear system $$\dot{q_1} = q_1 -q_2 - q_1(q_1^2+q_2^2)+u$$$$\dot{q_2} = q_1 + q_2 - q_2(q_1^2+q_2^2)$$ subproblem (4a.)Linearize the nonlinear system about its equilibrium point $(x_e,u_e)=(0,0)$, that is find matrices $A, B$ such that $\dot{x} = Ax+Bu$ for $x,u$ near $x_e,u_e$ subproblem (4b.)Let $u=-k_Pq_2$. Does there exist a $k_P$ such that the closed-loop system is stable, and if so, give one such $k_P$. If not, explain why.   problem (5.)Consider modeling the velocity of an underwater vehicle as $$ \dot{q}_1 = aq_2^3-bq_1|q_1| $$$$ \dot{q}_2 = cu - dq_2^3 $$ where $q_1,q_2$ are the states of the system, with $q_1$ being the horizontal velocity of the hull and $q_2$ being the velocity of the propellor that drives the hull. Assume $a,b,c,d > 0$ The term $aq_2^3$ relates propellor speed to the boat acceleration, while $-bq_1|q_1|$ is damping on the boat velocity. In the second equation, $cu$ is how the motor torques affect the propellor speed, and $-dq_2^3$ is damping on the propellor speed. subproblem (5a.)Find an equilibrium point $x_e,u_e$ such that $q_1=1$ (ie the underwater vehicle is moving with a constant speed of 1).<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11960844294891404, 'fraction_numerical': 0.025542979504435608, 'mean_word_length': 4.622527944969906, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 6, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '557774', 'license': 'CC0-1.0', 'n_tokens_mistral': 2129, 'n_tokens_neox': 2008, 'n_words': 916, 'path': 'exam1.ipynb', 'repo_name': 'my-13/447', 'size': '6538'}