Solving linear systems

One of the most powerful features of the Interpreter is the linear equation solver. With it, there is no need to reduce the equations manually to achieve a solution. The syntax of the equation solver is:

sys name1,...,namen

equation1

.

.

equationn

end;

where equationi is the ith equation, and namei is the ith unknown variable. If there is no solution, or if there are multiple solutions, the Interpreter will present an error message.

Our linear system example will be the solution of a system of nodal equations.

Example

Let’s consider the following circuit. Determine the nodal voltage at Iprbook00090001.gif1.

e4_1.gif

Solution

We need only enter the correct equations: the Interpreter will then solve them automatically.

The nodal equations are:

Iprbook00000018.gif

Note that we assume that the underlying schematic as shown, with component values, has already been created. We will reference variables from the schematic.

Entering these as source code in the Interpreter:

Sys Fi1,Fi2

Fi1/R1+(Fi1-U)/R2+(Fi1-Fi2)/R2 = 0

Fi2/R1+(Fi2-U)/R1+(Fi2-Fi1)/R2 = 0

End

Fi1=[1.8421]

In this example, the system of equations of variables Fi1, Fi2 is solved assuming that U, R1, R2 are already defined. In TINA, these parameters are automatically referenced by the labels of the appropriate components. To help in documentation, we used TINA’s text editor to put the Iprbook00090001.gif1,Iprbook00090001.gif2.node variable labels on the schematic as text items.

Verification

We use the Analysis/DC Analysis/Calculate nodal voltages to check the solution obtained by the Interpreter. After choosing Calculate nodal voltages, the cursor changes into a pencil shape. Click with the cursor on the Iprbook00090001.gif1 node to verify its voltage.

Using Calculate nodal voltages, we get 1.84V, which agrees with the value computed by the Interpreter.

e4_2.gif