GeorgesOatesLarsen / Physics-GRE-Testgen

command line (python) LaTeX physics GRE test generator
0 stars 0 forks source link

ETS2017 Problem 4 #7

Open GeorgesOatesLarsen opened 4 years ago

GeorgesOatesLarsen commented 4 years ago

Our first circuits fundamentals problem : - )

Inspiration:

For the circuit shown in the figure above, what is the current i through the 2 ohm resistor? (A) 2A (B) 4A (C) 5A (D) 10A (E) 20A

(figure shows 20Vvoltage source, in series with 1ohm resistor, branching from there to two resistors in parallel, 1ohm and 2ohm respectively (with the 2 ohm resistor indicated as the resistor of interest), with both resistors immediately merging to a single branch onto the negative terminal of the voltage source).

GeorgesOatesLarsen commented 4 years ago

This is a pretty tricky one, honestly.

To me, it would seem wise to completely generalize the problem to all possible circuits of three resistors and a single voltage source. That is going to require some fairly generalized circuit handling.

In general: Randomly pick one of the possible circuits of 3 resistors, and ask it to generate nice values for its resistors and voltage. (define nice as integer values of resistances that would allow for all currents in the system and the voltage source voltage to be integral in nature.

Pick a random piece of information not to give: A resistance, a voltage, or a current. Use sympy and the associated system of equations to identify a set of four non-redundant variables that could be provided to allow the test-taker to solve for the variable in question. Provide these variables. False answers can be based on the prime factorizations of all provided information.

GeorgesOatesLarsen commented 4 years ago

Update: This is implemented! Some minor bugs, such as an occasional crash, and some minor visual defects. Neither are worth fixing ATM. Will close this once pushed

Thanks to Joe Shields for coming up with a nice way to generate integer solutions for these circuits