ECE 2100 UH
Mathematica code(c) for Lab2-Advanced - circuit 2A
Han
Q. Le - University of Houston (copyrighted)
There are two sections, solving exactly the same problem. Section
One uses KVL (fewer equations), Section Two uses KCL (more
equations). To execute the code. Just select the whole section,
hit Shift+Enter.
1. KVL: Mesh Current Method (go to the next section for the Node Voltage Method)
In[263]:=
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
# FindRoot iterations: 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
time for calculation: 0.0270000 sec (excluding graphics display) |
2. KCL : Node Voltage Method (go to the top section for the Mesh Current Method)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# FindRoot iterations: 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
time for calculation: 0.0200000 sec (excluding graphics display) |