Chapter 6: Problem 3
Write a function to_complex that accepts two input arguments containing the magnitude mag and angle theta of the complex number in degrees, and returns the complex number c.
Chapter 6: Problem 3
Write a function to_complex that accepts two input arguments containing the magnitude mag and angle theta of the complex number in degrees, and returns the complex number c.
All the tools & learning materials you need for study success - in one app.
Get started for freeWrite a program that accepts a string from a user with the input function, chops that string into a series of tokens, sorts the tokens into ascending order, and prints them out.
In a sinusoidal steady-state AC circuit, the voltage across a passive element is given by Ohm's law: where \(\mathbf{V}\) is the voltage across the element, \(\mathbf{I}\) is the current through the element, and \(Z\) is the impedance of the clement. Note that all three of these values are complex, and that these complex numbers are usually specified in the form of a magnitude at a specific phase angle expressed in degrees. For example, the voltage might be \(\mathbf{V}=120 \angle 30^{\circ} \mathrm{V}\). Write a program that reads the voltage across an element and the impedance of the element, and calculates the resulting current flow. The input values should be given as magnitudes and angles expressed in degrees, and the resulting answer should be in the same form. Use the function to_complex from Exercise \(6.3\) to convert the numbers to rectangular for the actual computation of the current, and the function to polar from Exercise \(6.2\) to convert the answer into polar form for display (see Figure \(6.13\) ),
Plot the function \(y=e^{-4} \sin x\) for \(x\) between 0 and 2 in steps of \(0.1\). Create the following plot types: \((a)\) stem plot; \((b)\) stair plot; \((c)\) bar plot; (d) compass plot. Be sure to include titles and axis labels on all plots.
Write a function that will accept a complex number \(c\) and plot that point oa a Cartesian coordinate system with a circular marker. The plot should include both the \(x\) and \(y\) axes, plus a vector drawn from the origin to the location of \(\mathrm{c}\).
Create a mesh plot, surface plot, and contour plot of the function \(z=\) \(e^{x+y}\) for the interval \(-1 \leq x \leq 1\) and \(-2 \pi \leq y \leq 2 \pi\). In each case, plot the real part of \(z\) versus \(x\) and \(y\).
What do you think about this solution?
We value your feedback to improve our textbook solutions.