A4 Python for engineers · Practice
Solving equations numerically
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
Use np.roots to find all three roots of , and set r to them sorted from smallest to largest real part.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Solve this system with np.linalg.solve and set sol to the array of :
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A capacitor charges as with Vs = 9 V and tau = 10 ms. Write newton(f, df, x0), which repeats until a step is smaller than and returns . Use it from x0 = tau to set t to the time in ms when reaches Vt = 2 V, and iters to how many steps it took.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Solve , with np.linalg.solve; set x and y.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
A capacitor charges as with = 1 ms. Use bisection (write it, or reuse yours) to set t_hit to the time, in ms, when it reaches 0.7 × 8 V.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Use np.roots to find the roots of ; set r to the root with the larger real part.
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