A4 Python for engineers · Practice
Complex numbers and units in code
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
Write zc(C, f) that returns a capacitor's complex impedance, .
C = 100 nF (in farads) and f = 50 Hz are already defined.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
An RC low-pass filter has . Compute mag, the size of at 10000 Hz, and phase_deg, its angle in degrees.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Add the phasors and in code. Set amp to the sum's amplitude and ang to its angle in degrees.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A series RLC has R = 10 Ω, L = 1 mH and C = 100 nF. Using a NumPy array of 200,001 frequencies from 1 kHz to 100 kHz, compute the complex impedance . Set f_min to the frequency where is smallest and Z_min to that smallest . Then set f0 to for comparison.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Set Zmag to the size of the impedance of 52 Ω in series with 1.5 mH at 10000 Hz.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Set Zp to the complex impedance of 520 Ω in parallel with 15 nF at 1000 Hz.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
With amplitude phasors and , set P to the average power, .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in A4