Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Potential Difference Among 3 Capacitors
- % Determining the potential difference from point A to B when there are two
- % two capacitors in parallel and another in series.
- % Notes and clarifications are at the bottom of code
- C1 = input('The capacitance in C1\n');
- C2 = input('The capacitance in C2\n');
- C3 = input('The capacitance in C3\n');
- a = input('Are you given the potential difference across C1 or one of the capacitors in parallel?\n');
- switch a
- case 1
- V1 = input('The potential difference across C1\n');
- V2 = C1*V1/(C2+C3);
- V = V1 + V2;
- case 2
- V2 = input('The potential difference across C2 or C3\n');
- V1 = (C2+C3)*V2/C1;
- V = V1 + V2;
- end
- fprintf('The potential difference is %e V', V);
- %{
- This code has a different layout then some of the other codes because there
- are different ways to solve the equation depending on what is given
- This code works under the assumption that C2 and C3 are in parallel
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement