Engee documentation

capacitor

Creates a capacitor object.

Library

EngeeRF

Syntax

Function call

  • cobj = capacitor(cvalue) — creates a capacitor object cobj with capacity cvalue and by default name.

Arguments

Input arguments

# cvalue — capacitor capacity, F

+ real scalar

Details

The capacitance of the capacitor in F, given as a real scalar.

# cname is the name of the capacitor

+ "C" (by default) | character vector

Details

The name of the capacitor, specified as a vector of characters.

Output arguments

# cobj — capacitor object

+ scalar descriptor object

Details

Capacitor object. The capacitor object contains the following properties:

  • Capacitance — the capacitance of the capacitor in F in the form of a real scalar, for example 2.0e-6.

  • Name — the name of the capacitor in the form of a character vector, for example "C2uf".

  • Terminals — capacitor terminals in the form of a vector of cells, for example ("p", "n").

  • ParentPath — the full path to the circuit to which the capacitor object belongs, in the form of a character vector. This path appears only after adding a capacitor to the circuit. For example "example".

  • ParentNodes — nodes of the parent circuit to which the capacitor terminals are connected, in the form of a vector of integers. This property appears only after adding a capacitor to the circuit. For example [1, 2].

Examples

Creating a capacitor

Details

Let’s create a capacitor and derive its properties.

using EngeeRF
hC1 = capacitor(2e-6)
println(hC1)
capacitor(Terminals = ("p", "n"), Name = "C", Capacitance = 2.0e-6)

Adding a capacitor to the circuit

Details

Add a capacitor to the circuit and derive its properties.

using EngeeRF

hC2 = capacitor(3e-6,"C2uf")
hckt2 = circuit("example")
add(hckt2,[1 2],hC2)
setports(hckt2, [1 0],[2 0])
println(hC2)
capacitor(ParentPath = "example", Terminals = ("p", "n"), Name = "C2uf", ParentPath = "example", ParentNodes = [1, 2], Capacitance = 3.0e-6)