Pages created and updated by Terry Sturtevant Date Posted: June 5, 2017

Maple Kirchhoff's Law Tutorial

Maple is a commercial program. It is a computer algebra system (CAS) like Maxima or Mathematica.
There are various tutorials out there on how to use Maple; this one is designed to focus on its use for circuit analysis; i.e. lots of use of Kirchhoff's Laws, and including complex numbers for AC analysis with capacitors and inductors.

Sample DC Circuit

Here is a simple circuit:

sample circuit

It gives us the following three Kirchhoff's Law equations ( See the complete analysis here. ) :
-I1 R1 + I3 R3 = -V1

-I2 R2 -I3 R3 = -V2

-I1 + I2 -I3 = 0

A computer algebra system can be very useful for analyzing circuits like this.
  1. Opening Maple

  2. Solving Equations

  3. Saving a Session

  4. Quitting Maple

  5. Loading a Previous Session

  6. Redefining Variables

  7. Getting Resistor Voltages

  8. Phasors and AC Circuits (external document)

  9. Links


  1. Opening Maple:
    • Open Maple from the menu or the desktop icon.

  2. Solving Equations:
    • To solve a set of Kirchhoff's Law equations, use the solve command, solving for I1, I2, and I3:

      At the prompt, type in the the commands as shown:
      sample equation 
            input

      The solve command gives the solution vector.


    • The solution is a vector of currents. We can pick off a single current by using an index with the previous result:

      single 
            element

    • You can substitute in specific component values:

      value substitution

      If numbers are not integers, results will also be non-integer
      Note that as soon as we use scientific notation, values become non-integer.

    • We can get the voltage across a resistor by multiplying the current times the resistance, and assigning it to a new variable:

      sample equation input

      Important tip: To combine two elements of two different arrays of the same size, just put a tilde after whatever operation you choose (such as +, -, etc.).

  3. Saving a Session:
    • This allows you to come back to it later with all of the variables the same.

      To save a session:

      save session

  4. Quitting Maxima:
    • Quitting maxima:
      Choose Exit from the menu.

  5. Loading a Previous Session:
    • It's nice to be able to pick up where you left off, so you can keep developing an analysis over time.

      To load a previous session:

      load session

      Everything should be as you left it.

    • Previous statements can be re-executed and/or edited.


    • Statements can be re-evaluated with different numbers.

  6. Redefining Variables:
    • Variables can be changed.


  7. Getting Resistor Voltages:
    • We can pick off individual current equations as well as just the results for each current:
      elementwise multiplication

  8. Phasors and AC Circuits (external document)

  9. Links:

Creative Commons License
Information on this site which is produced by Terry Sturtevant is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG 2.0
(Level AA)

Wilfrid Laurier University