Engee documentation

setterminals

Sets the terminals for the circuit object of the electrical circuit.

Library

EngeeRF

Syntax

Function call

  • setterminals(cktobj, cktnodes) — defines nodes in cktobj how to terminal with an argument cktnodes. Terminal names are assigned by default.

Arguments

Input arguments

# cktobj — schema object

+ scalar descriptor object

Details

The circuit object for which the terminals are defined, specified as a scalar descriptor object.

# cktnodes — schema nodes

+ vector of integers

Details

The circuit nodes used by the function to determine the terminals are specified as a vector of integers.

# termnames — terminal names

+ character vector

Details

The names of the terminals defined for the circuit object, specified as a character vector.

Examples

Creating a circuit and defining its nodes as terminals

Details

Let’s create a circuit and add a resistor and a capacitor to it. Define the terminals.

using EngeeRF

hckt1 = circuit("new_circuit1")
add(hckt1,[1 2],resistor(50))
add(hckt1,[2 3],capacitor(1e-9))
setterminals(hckt1,[1 3])
println(hckt1)
circuit(ElementNames = ("R", "C"), Terminals = ("t1", "t2"), Name = "new_circuit1", Elements = Vector{EngeeRF.DomainRF.DomainObjectRF}, Nodes = [1, 2, 3], TerminalNodes = [1, 3])

Creating a circuit with specified terminal names

Details

Create a circuit and add three resistors to it. Let’s define terminals with names a, b and c.

using EngeeRF

hckt2 = circuit("example_circuit2")
add(hckt2,[1 2],resistor(50))
add(hckt2,[1 3],resistor(50))
add(hckt2,[1 4],resistor(50))

setterminals(hckt2,[2 3 4],("a", "b", "c"))
println(hckt2)
circuit(ElementNames = ("R", "R", "R"), Terminals = ("a", "b", "c"), Name = "example_circuit2", Elements = Vector{EngeeRF.DomainRF.DomainObjectRF}, Nodes = [1, 2, 3, 4], TerminalNodes = [2, 3, 4])