A444 of 56
0 XP
  1. Hook
  2. Problems

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 G𝐯=𝐢 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 I=Is(eVd/VT−1) with Is=10−14 A and VT = 0.02585 V, in series with R = 220 Ω across Vs = 5 V. Solve Vs=IR+Vd for the diode voltage with bisection on [0,Vs] to within 10−12 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 s3+2s2+2s+2. 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 v and i=Cdv/dt (exact formulas) at 2001 points over 10τ, and set E to the energy delivered, ∫vidt, by the trapezoid rule. Compare with 12CV2 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 dv/dt=(1−v)/τ 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 1−e−1.

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.