Problem
The figure below shows a plot of the capacitor voltage from the circuit shown in The capacitor voltage increases from 0 volts to B volts. The "rise time" is defined as the time required for the capacitor voltage to change from v1 = 0.05 x B to v2 = 0.95 x B.
Contains a list of values of time t and the corresponding capacitor voltage v(t). A time in μs and the corresponding voltage in volts are printed on the same line. For example, the line 110 7.02261 indicates that the capacitor voltage is 7.02261 volts when the time is 110 μs. The time is increasing in the data file. Write a program that reads the file rc.txt and uses the data to calculate the rise time. Approximate B by the voltage in the last line of the file, and find the data points that are closest to 0.05 × B and 0.95 × B.