Difference between revisions of "Maple/Example/CAD Fig 03 14"
(→Define Equations) |
(→Define Equations) |
||
Line 20: | Line 20: | ||
\end{align*} | \end{align*} | ||
</math></center> | </math></center> | ||
+ | You can add those to your Maple worksheet with: | ||
+ | <syntaxhighlight lang=text> | ||
+ | KVLl1 := -v1 + R2*I1 + R3*(I1 - I2) + R6*(I1 - I3) + v2 = 0; | ||
+ | KVLl2 := R3*(I2 - I1) + R4*I2 + R5*(I2 - I3) = 0; | ||
+ | KVLl3 := -v2 + R6*(I3 - I1) + R5*(I3 - I2) + R7*I3 = 0; | ||
+ | </syntaxhighlight> | ||
=== Solve Equations === | === Solve Equations === |
Revision as of 18:41, 13 January 2024
This page goes over how to get the equations from and solve the circuit in Figure 3-14 of "Circuit Analysis and Design" by Ulaby, Maharbiz, and Furse.
Contents
Convert to Symbols
For the Maple worksheet, we are going to use symbols for each of the circuit elements. The 6 V source will be $$v_1$$ and the 4 V source will be $$v_2$$. For the resistors, label each with a subscript that matches the value in ohms (e.g. the 6 $$\Omega$$ resistor will be called $$R_6$$.
Initialization
Go ahead and put
restart
as the first executable in your worksheet.
Define Equations
To solve this circuit using Mesh Current Method, note that there are three meshes and no current sources so you have three independent KVL equations. While there are six loops to choose from, there is no reason to not just choose the three meshes. If you start at the lower-left hand corner of each mesh and count the voltage drops clockwise, you get:
You can add those to your Maple worksheet with:
KVLl1 := -v1 + R2*I1 + R3*(I1 - I2) + R6*(I1 - I3) + v2 = 0;
KVLl2 := R3*(I2 - I1) + R4*I2 + R5*(I2 - I3) = 0;
KVLl3 := -v2 + R6*(I3 - I1) + R5*(I3 - I2) + R7*I3 = 0;
Solve Equations
The easiest way to solve an equation (or a system) of equations is to use the solve
command. The most formal, and flexible, way to use this command is to give it a set of equations (surrounded by curly brackets) and a list of variables (surrounded by square brackets). The result will be an expression, set of expressions, list of expressions, or list of list of expressions depending on the nature and number of the equations and the solutions. For example, if you add the code:
soln1 := solve({eqn1}, [x])
then Maple will produce a variable called soln1
that has a list with a list with an expression; specifically, $$soln1 := [[x = \frac{d}{a}]]$$
Make Substitutions
Now that you have symbolic answers, you can make numerical substitutions for those symbols using the subs
command. The subs command expects a series of equalities to define the substitutions followed by a single item into which to make those substitutions. For example, to see what x is when d is 10, you can write:
subs(d = 10, soln1)
and you will get the new list of lists $$[[x = \frac{10}{a}]]$$. If you want to see multiple substitutions, you can put them all at the start of the soln command:
subs(a=3, d = 10, soln1)
will give $$[[x = \frac{10}{3}]]$$