Skip to content
Analog.NonlinearResistor.md

Analog.NonlinearResistor ​

This component extends from OnePort

Usage ​

TranslatedComponents.Analog.NonlinearResistor(Ga, Gb, Ve)

Parameters: ​

NameDescriptionUnitsDefault value
GaS
GbS
VeV

Connectors ​

  • p - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

  • n - This connector represents an electrical pin with voltage and current as the potential and flow variables, respectively. (Pin)

Variables ​

NameDescriptionUnits
vV
iA

Behavior ​

julia
using TranslatedComponents #hide
using ModelingToolkit #hide
@variables Ga #hide
@variables Gb #hide
@variables Ve #hide
@named sys = TranslatedComponents.Analog.NonlinearResistor(Ga=Ga, Gb=Gb, Ve=Ve) #hide
full_equations(sys) #hide
<< @example-block not executed in draft mode >>

Source ​

dyad
component NonlinearResistor
  extends OnePort
  parameter Ga::Dyad.Conductance
  parameter Gb::Dyad.Conductance
  parameter Ve::Dyad.Voltage
relations
  i = (v < -Ve) ? (Gb * (v + Ve) - Ga * Ve) : ((v > Ve) ? (Gb * (v - Ve) + Ga * Ve) : (Ga * v))
end
Flattened Source
dyad
component NonlinearResistor
  p = Pin()
  n = Pin()
  variable v::Dyad.Voltage
  variable i::Dyad.Current
  parameter Ga::Dyad.Conductance
  parameter Gb::Dyad.Conductance
  parameter Ve::Dyad.Voltage
relations
  v = p.v - n.v
  0 = p.i + n.i
  i = p.i
  i = (v < -Ve) ? (Gb * (v + Ve) - Ga * Ve) : ((v > Ve) ? (Gb * (v - Ve) + Ga * Ve) : (Ga * v))
metadata {}
end


Test Cases ​

No test cases defined.

  • Examples

  • Experiments

  • Analyses