ECE 1574 Homework Set #7
Tanuj Godara 905279307
LAB EXERCISE
In good C++ style, write a program which by a Monte Carlo technique estimates the reliability of
the electrical circuit represented schematically below.
2 ohms
3 ohms
























4 ohms
6 ohms



100 volts
10  20 ohms




___
___


In the circuit, there are a 100volt DC source, a 2ohm resistor in parallel with a 4ohm resistor,
and then a 3ohm resistor in parallel with a 6ohm resistor. The circuit is terminated in a load
whose value varies randomly between 10 and 20 ohms.
REQUIREMENTS
1.
Using a flat logarithmic distribution values for the load [that is, a distribution in
which any value in the domain from ln(10 ohms) to ln(20 ohms) is equally likely],
let your program solve the circuit 100,000 times, counting the number of times
the voltage across the load falls below 77.5 volts.
(You may use one or more C++
vectors
or arrays in your code if you wish, but this is not required.)
2.
Implement operations by function calls wherever reasonable to do so.
For
instance, implement the parallel combination of 2 and 4 ohms by a function call.
3.
Let your program calculate the average across the 100,000 trials of (a) the total
power delivered by the source and (b) the power disspated by each resistor,
including the load.
4.
Let your program output three numbers on separate lines: first, the number of
times the voltage across the load falls below 77.5 volts; second, the average
power delivered by the source over the 100,000 trials; and, third, the average
power dissipated by each resistors over the 100,000 trials.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentSeed the computer’s randomnumber generator with the integer 569.
QUESTIONS
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 JIMKUYPERS
 namespace std, Sample output, test input sets

Click to edit the document details