A4 · Problem set 10
Problem set 10: numerical methods
These labs use lessons 36 to 43: complex numbers in code, solving equations, numerical derivatives and integrals, and stepping systems through time. Each is a small piece of a circuit simulator, which is what these methods are for.
Check
A source Vs = 5 V feeds node 1 through R1 = 1000 Ω. R2 = 4700 Ω joins node 1 to node 2, and R3 = 1000 Ω and a 1 kΩ resistor go from node 2 to ground, in parallel. Node 1 also has 10 kΩ to ground. Write the nodal equations and set v to the two node voltages with np.linalg.solve.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A diode obeys with A and = 0.02585 V, in series with R = 220 Ω across Vs = 5 V. Solve for the diode voltage with bisection on to within V. Set Vd and I.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A filter's characteristic polynomial is . Set p to its roots from np.roots, stable to whether all have negative real parts, and slowest to the root's real part closest to zero.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A capacitor C = 1 µF charges toward V = 5 V through a resistor, with = 3 ms. Sample and (exact formulas) at 2001 points over , and set E to the energy delivered, , by the trapezoid rule. Compare with as E_ideal.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Charge from 0 for one time constant (tau = 1) in n = 10 steps with Euler and with RK4. Set e_euler, e_rk4 to their errors against .
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Simulate a series RLC (R = 10 Ω, L = 10 mH, 1 µF) responding to a 1 V step, with RK4 at 1 µs for 20,000 steps. Set ts to the settling time in seconds: the time after which stays within 2% of 1 V.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Using NumPy complex arithmetic, add three phasors: A = 3 at 0°, B = 4 at 120°, and 2 at −90°. Set S to the sum (a complex number), mag to its size and deg 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.
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.