Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Capacitance From a Voltage vs. Time Graph
- % Calculates capacitance by using a voltage. vs time graph.
- % Notes and clarifications are at the bottom of the code
- % Inputs and Variables
- V0 = input('What is the voltage of the battery?\n');
- R = input('What is the resistance in ohms?\n');
- disp('These next inputs require a (V,t) coordinate pair from the curve')
- t = input('What is the value of t at the intersection?\n');
- V = input('What is the value of V at the intersection?\n');
- % Outputs and Equations
- C = t/(R*log(V0/(V0-V)))
- fprintf('The capacitance is %.4e F', C);
- %{
- V and t are found by using the graph and seeing where the the curve passes
- through an intersection point. V is the y-coordinate and t is the
- x-coordinate
- The output is rounded to 4 places after the decimal point. To change or remove
- this feature, edit the .# in the fprintf line
- %}
Add Comment
Please, Sign In to add comment