Difference between revisions of "Symbolic/Examples/Circuits"
m (DukeEgr93 moved page Maple/Examples/Circuits to Symbolic/Examples/Circuits: adding Mathematica) |
(→Code) |
||
Line 41: | Line 41: | ||
Note that all elements except for <math>i_a</math> are labeled passively. | Note that all elements except for <math>i_a</math> are labeled passively. | ||
=== Code === | === Code === | ||
− | The | + | ==== Mathematica ==== |
+ | <html> | ||
+ | <iframe src="https://www.wolframcloud.com/obj/a1176aec-2866-4696-9ce6-95fc25945af0?_embed=iframe" width="600" height="800"></iframe> | ||
+ | </html> | ||
+ | |||
+ | |||
+ | ==== Maple ==== | ||
+ | The Maple worksheet for this example is available for download: <html><a href='http://dukeegr93.com/Files/Circuit1Demo.mw' download='Circuit1Demo.mw'>Circuit1Demo.mw</a></html>. You can also look at a [[:File:Circuit1Demo.pdf|PDF]] of the code. The code assumes that: | ||
<center><math> | <center><math> | ||
\begin{align} | \begin{align} | ||
Line 49: | Line 56: | ||
</math></center> | </math></center> | ||
− | There are also versions of the file that show how you can use Maple's built in ability to use units, which are accessed via the Units menu on the left side of the screen. The code for this example is available for download: <html><a href='http://dukeegr93.com/Files/Circuit1DemoUnits.mw' download='Circuit1DemoUnits.mw'>Circuit1DemoUnits.mw</a></html>. You can also look at a [[:File:Circuit1DemoUnits.pdf|PDF]] of the code. | + | There are also versions of the file that show how you can use Maple's built-in ability to use units, which are accessed via the Units menu on the left side of the screen. The code for this example is available for download: <html><a href='http://dukeegr93.com/Files/Circuit1DemoUnits.mw' download='Circuit1DemoUnits.mw'>Circuit1DemoUnits.mw</a></html>. You can also look at a [[:File:Circuit1DemoUnits.pdf|PDF]] of the code. Note that using units works seamlessly for some applications but becomes very cumbersome in others (especially once differential equations or transforms are involved). |
[[Category:EGR 224]] | [[Category:EGR 224]] | ||
[[Category:ECE 110]] | [[Category:ECE 110]] | ||
+ | [[Category:Controls]] |
Revision as of 02:44, 13 June 2021
Contents
Brute Force 1
The following example shows the "brute force" method of setting up and solving for all the element currents and voltages for a simple resistive circuit and then using those solutions to solve for auxiliary information (in this case, some powers). The circuit involved is:
Equations
Element Equations
Mainly, these are Ohm's Law equations for the resistors, so:
KCL Equations
The number of independent KCL equations s one less than the number of nodes, so in this case, 2. Note: all three nodal KCL equations are written below, but node \(n_c\)'s is not used in the Maple worksheet.
KVL Equations
The number of independent KVL equations is equal to the number of meshes for a 2-D circuit, or to the number of elements, minus the number of nodes, plus one for circuits in general. In this case, that is 2 independent KVL (two meshes, or 3 elements - 3 nodes + 1 = 2). For the brute force method, just use the mesh equations:
Auxiliary Equations
For this example, the auxiliary equations will be used to determine the power delivered by each source and the power absorbed by each resistor:
Note that all elements except for \(i_a\) are labeled passively.
Code
Mathematica
Maple
The Maple worksheet for this example is available for download: Circuit1Demo.mw. You can also look at a PDF of the code. The code assumes that:
There are also versions of the file that show how you can use Maple's built-in ability to use units, which are accessed via the Units menu on the left side of the screen. The code for this example is available for download: Circuit1DemoUnits.mw. You can also look at a PDF of the code. Note that using units works seamlessly for some applications but becomes very cumbersome in others (especially once differential equations or transforms are involved).