Maple is a symbolic computation program which allows you
to solve problems
ranging from algebra to differential equations. Although you must overcome an
initial
learning curve to use it , Maple reduces the tedium of fairly involved
mathematical
problems. We will use Maple to solve for a system of equations . From high school
algebra we were required to solve two equations for two unknowns . By this time
in your
career you most likely are fairly proficient doing this mathematical process.
Solving for
a three variable system of equations is doable; however, the task becomes a bit
tedious.
Unfortunately, many of the interesting problems that exist in our world involve
much
more than two or three variables. For this assignment I will have you solve two
problems
which involve solving for a system of equations. The first is only a three
variable
problem which you can do by hand. The second is an eight variable problem which
will
only be done by hand by the most resilient of you.
Beginning Maple.
1) Start Maple by entering windows and clicking on the
Science and Math group.
2) Choose the program "Maple for windows" and wait for the
program to begin.
3) Maple does not automatically install all of its math
modules from the start so we
need to tell Maple we will be using the linear algebra module. This is started
by
typing in the command "with(linalg);" and pressing <Enter>. Only type what is
within quotes, but not the quotes themselves. We have called a function in Maple
called with() having the parameter linalg. The semicolon at the end of the
statement tells Maple that this ends a specific command. When you press
<Enter> Maple processes the command. Some text will show up on the screen as
a result of entering this command. Do not worry what it says at this point.
4) There are a number of ways of solving for a system of
equations in Maple;
however, we will take the easiest route. First we will assign a name to our
system
of equations. A name can be assigned by typing a statement such as "q :=
2*x^2;". With this statement we are assigning the function 2x² to the name q.
Maple knows it is an assignment statement by the characters ":=". When entering
an algebraic function, you must explicitly type in each function. Maple will not
assume that 2x means two times x . You must use +,−,*,/, and ^ for addition,
subtraction , multiplication, division, and exponentiation respectively. If you
want
to use other mathematical functions you must use the syntax that Maple uses to
call these functions. An example would be "q:= 2*sin(x);" where we want to use
the sine function. Notice that once you enter the assignment statement, Maple
echoes the statement you made in a more appealing notation.
5) Using Kirchhoff's rules, write down the system of
equations necessary for finding
the currents in each branch of the circuit from Part I. Assuming current I1 goes
through resistor R1 from left to right, current I2 goes through resistor R2 form
right to left, and current I3 goes through resistor R3 from top to bottom the
equations from Kirchhoff's rules are
I1 + I2 = I3
6 - 4000*I1 - 3000*I1 - 6000*I3 = 0
9 - 1000*I2 - 1000*I2 - 6000*I3 = 0
To enter these equations into Maple use the commands
node1:=I1 + I2 = I3;
loop1:=6 - 4000*I1 - 3000*I1 - 6000*I3 = 0;
loop2:=9 - 1000*I2 - 1000*I2 - 6000*I3 = 0;
Sys:={node1, loop1, loop2};
The first three lines assign the equations from
Kirchhoff's rules to three different
names. The names were chosen to make it easier to remember where those
equations came from. The braces in the last line tells Maple that we are working
with a group where each member is separated from the next by a coma. The
system of equations are assigned the name "Sys". Notice that each statement is
terminated with a semicolon . Don't forget to press enter after each line.
6) Solving for the system of equations is easy at this
point. Type the command
"solve(Sys,{I1, I2, I3} );" and press enter. Maple will then print out the
results
where I1, I2, and I3 are assigned values. Notice that Maple gives you the
results
in the form of a fraction. This is possible because of the inherent symbolic
computation methodology of Maple. This gives us an exact result as opposed to
an approximation which comes from rounding off to a decimal value.
7) To get the decimal form use the command "evalf( % );".
Yes, keep that quote
mark as the argument of the function evalf(). The quote mark tells Maple to use
the results of the last expression evaluated. If you wanted to do the extra
typing,
you could have entered the command "evalf( solve(Sys,{I1, I2, I3} );".
8) Notice our results for current are on the small side.
That is result of all our
resistors being in the kΩ range. We could change our equations to
I1 + I2 = I3
6 - 4*I1 - 3*I1 - 6*I3 = 0
9 - 1*I2 - 1*I2 - 6*I3 = 0
and enter the Maple commands
node1:=I1 + I2 = I3;
loop1:=6 - 4*I1 - 3*I1 - 6*I3 = 0;
loop2:=9 - 1*I2 - 1*I2 - 6*I3 = 0;
Sys:={node1, loop1, loop2};
Now don't retype this command from scratch. Just go to the
commands that you
typed previously in Maple and edit them. Once you have changed each line to the
form written above, make sure the cursor is located somewhere on that command
line and press enter. Maple will reevaluate that statement for the new values.
Maple only evaluates the line you selected. Therefore, you need to select each
statement and press enter. The command line involving the solve statement also
needs to be selected with the cursor and the <Enter> key press. To reevaluate
the
evalf() command place the cursor there and press enter. It is that simple.
Notice
that the results are now 1000 times larger than the first time we did this
problem.
That is because we have left out the factor of 1000 in the resistance value.
Therefore, the true currents are a factor of 1000 smaller than the reported
values
which means the units for current are in milliamps rather than amps.
9) Record these values in the table in Part I and
calculate the power dropped across
each resistor. You should also do Part I manually (by hand) to make sure you can
do the procedure of solving simultaneous equations correctly. This will be an
important skill since you will not be able to use Maple for the exam.
10) The power dissipated by the whole circuit has to come
from the power supplies.
Therefore, the sum of all the power lost over the resistors should equal the sum
of
the power supplied by each power supply. Verify this by calculating the total
power lost by the resistors.
11) Finally solve the problem in Part II. Do not do it by
hand unless you enjoy brain
puzzles and have plenty of free time. Set up the equations using Kirchhoff's
rules
and record them on the homework sheet. You should have equations for four
loops and four nodes. Enter the system of equations into Maple and get the
results. Once you have obtained the 8 currents in the circuit, calculate the
power
lost across each resistor and the total power consumed by the circuit.
12) Many more frills could be added to this project such
as automatically calculating
the power for each resistor. The initial set up would have to be changed
significantly and , therefore, is beyond the scope of what I wanted to accomplish
with this project.
13) You may want to save your work. Maple lets you save
all the commands you
have entered. This is useful since you can solve similar problems by just
editing
each line and pressing <Enter>.