Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Specific Loop Rule
- % Determines the potential at point A, and the current at i1 and i3.
- % Please check the note at the bottom before using this code
- % Inputs and Variables
- E1 = input('What is E1?\n');
- E2 = input('What is E2?\n');
- R1 = input('What is the resistance in R1?\n');
- R3 = input('What is the resistance in R3?\n');
- % Outputs and Equations
- Va = E1;
- i1 = (E1-E2)/R1;
- i3 = E2/R3;
- fprintf(['The potential at Point A, the current at i1, and the current at i3 is\n'...
- '%.3i V, %.3i A, %.3i A'], Va, i1, i3);
- %{
- This is a very specific scenario that may or not be useful
- This only works if there is a circuit with two electromotive forces(E1 and E2) on
- opposite sides. Point A is in the corner with current i1 coming towards it
- from E1. Point B is somewhere on the same line as point A but with a
- resistor (R1) between them. Current i2 is coming from E2 and runs into point
- B. At point B there is a resistor (R3) that runs parallel to the sides
- that E1 and E2 are on. Current i3 runs from R3 to the opposite end
- where the voltage is 0 at that point.
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement