Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A capacitor discharges through a resistor. The voltage follows , where is the time constant. The voltages at 0, 2, 4, 6, 8 and 10 ms are 9.0, 6.1, 4.1, 2.7, 1.8 and 1.2 V. Fit the law with curve_fit, with the parameters and (write the model with directly, and not ). Find with its uncertainty, and the time when the voltage falls to 1 V.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. The model is v0 * np.exp(-t / tau). A starting guess: and ms (the voltage falls to about a third in that time). Then brentq finds the time for 1 V.
Check. The values are chosen for V and ms. The fit gives V and ms. The voltage reaches 1 V when , so ms.
Answer: ms with an uncertainty of about 0.04 ms, and the voltage is 1 V after 11.0 ms.
Log in to join the discussion.
Loading…