diff --git a/Blocks/Continuous.mo b/Blocks/Continuous.mo index b7f0290c4e..8205bbe3fe 100644 --- a/Blocks/Continuous.mo +++ b/Blocks/Continuous.mo @@ -1,29 +1,22 @@ -package Continuous "Continuous control blocks with internal states" +package Continuous + "Continuous control blocks with internal states" + extends Modelica.Icons.Library; - package Interfaces = Modelica.Blocks.Interfaces; - package SIunits = Modelica.SIunits; - - annotation ( - Coordsys( - extent=[0, 0; 272, 438], - grid=[1, 1], - component=[20, 20]), - Window( - x=0.02, - y=0.04, - width=0.27, - height=0.63, + annotation (Window( + x=0.05, + y=0.09, + width=0.35, + height=0.74, library=1, - autolayout=1), - Documentation(info=" - + autolayout=1), + Documentation(info="

This package contains basic continuous input/output blocks.

Main Author: -
Martin Otter
+
Martin Otter
Deutsches Zentrum fuer Luft und Raumfahrt e.V. (DLR)
Oberpfaffenhofen
Postfach 1116
@@ -35,7 +28,7 @@ This package contains basic continuous input/output blocks.

Release Notes:

")); - end Examples; diff --git a/Electrical/Analog/Ideal.mo b/Electrical/Analog/Ideal.mo index 59827ec0cd..41462c7d09 100644 --- a/Electrical/Analog/Ideal.mo +++ b/Electrical/Analog/Ideal.mo @@ -1,33 +1,34 @@ package Ideal + extends Modelica.Icons.Library; - package SIunits = Modelica.SIunits ; - annotation ( - Coordsys( - extent=[0, 0; 400, 500], - grid=[1, 1], - component=[20, 20]), - Window( - x=0.03, - y=0.04, - width=0.50, - height=0.36, - library=1, - autolayout=1), - Documentation(info=" - + annotation (Window( + x=0.03, + y=0.04, + width=0.50, + height=0.36, + library=1, + autolayout=1),Documentation(info="

-This package contains ideal components: +This package contains electrical components with idealized behaviour: +

@@ -35,9 +36,9 @@ This package contains ideal components:
Main Authors:
-Christoph Clauß +Christoph Clauß <clauss@eas.iis.fhg.de>
- André Schneider + André Schneider <schneider@eas.iis.fhg.de>
Fraunhofer Institute for Integrated Circuits
Design Automation Department
@@ -53,10 +54,10 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright © 1998-2002, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions -and the accompanying disclaimer in the documentation of package +and the accompanying disclaimer in the documentation of package Modelica in file \"Modelica/package.mo\".

@@ -64,18 +65,17 @@ Modelica in file \"Modelica/package.mo\".
")); model IdealThyristor "Ideal thyristor" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 + extends Interfaces.OnePort; + parameter SI.Resistance Roff(final min=0) = 1.E-5 "Closed thyristor resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + parameter SI.Conductance Gon(final min=0) = 1.E-5 "Opened thyristor conductance"; protected Real s "Auxiliary variable"; Boolean off(start=true); Boolean fire(start=true); annotation ( - Documentation(info=" - + Documentation(info="

Ideal thyristor ... < description will be added >

@@ -121,19 +121,19 @@ Ideal thyristor ... < description will be added > v = s*(if off then 1 else Roff); i = s*(if off then Gon else 1); end IdealThyristor; + model IdealGTOThyristor "Ideal GTO thyristor" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 + extends Interfaces.OnePort; + parameter SI.Resistance Roff(final min=0) = 1.E-5 "Closed thyristor resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + parameter SI.Conductance Gon(final min=0) = 1.E-5 "Opened thyristor conductance"; protected Real s "Auxiliary variable"; Boolean off(start=true) "Position of switch"; Boolean fire; annotation ( - Documentation(info=" - + Documentation(info="

Ideal GTO thyristor ...

@@ -179,11 +179,12 @@ Ideal GTO thyristor ... v = s*(if off then 1 else Roff); i = s*(if off then Gon else 1); end IdealGTOThyristor; + model IdealSwitch "Ideal electrical switch" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 + extends Interfaces.OnePort; + parameter SI.Resistance Roff(final min=0) = 1.E-5 "Closed switch resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + parameter SI.Conductance Gon(final min=0) = 1.E-5 "Opened switch conductance"; protected Real s "Auxiliary variable"; @@ -193,20 +194,19 @@ Ideal GTO thyristor ... false})) "true/false opened/closed switch" annotation (extent=[-10 , 50; 10, 70], rotation=-90); annotation ( - Documentation(info=" - + Documentation(info="

Ideal electrical switch. In order to prevent singularities during switching, the opened switch has a high resistance -and the closed switch has a low resistance. +and the closed switch has a low resistance.

-If the actual circuit has an appropriate structure, the +If the actual circuit has an appropriate structure, the limiting case is also allowed, i.e., the resistance of the closed switch could be exactly zero and the conductance of the open switch could be also exactly zero (i.e. the resistance is -infinity). Note, there are circuits, where a description -with zero/infinity resistances is not possible. +infinite). Note, there are circuits, where a description +with zero/infinity resistances is not possible.

"), @@ -238,19 +238,190 @@ with zero/infinity resistances is not possible. v = s*(if off then 1 else Roff); i = s*(if off then Gon else 1); end IdealSwitch; - model ControlledIdealSwitch - parameter SIunits.Voltage level "Switch level"; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 + + model IdealCommutingSwitch "Ideal commuting switch" + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + ; + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance"; + annotation ( + Documentation(info=" +

+The commuting switch has a positive pin p and two negative pins n1 and n2. +The switching behaviour is controlled +by the control signal. If the control signal is true, the pin p is connected +with the negative pin n2. Otherwise, the pin p is connected to the negative pin n1. +

+

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Ellipse(extent=[-44, 4; -36, -4]), + Text(extent=[-80, 0; -60, 22], string="p"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -70; 100, -100], string="%name")), + Diagram( + Ellipse(extent=[-44, 4; -36, -4]), + Text(extent=[-80, 0; -60, 22], string="p"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0])), + Window( + x=0.21, + y=0.05, + width=0.6, + height=0.6)); + public + Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n2 annotation (extent=[90, -10; 110, 10]); + Interfaces.NegativePin n1 annotation (extent=[90, 40; 110, 60]); + Modelica.Blocks.Interfaces.BooleanInPort control(final n=1) + "true => p--n2 connected, false => p--n1 connected" annotation (extent=[- + 10, 70; 10, 90], rotation=-90); + protected + Real s1; + Real s2 "Auxiliary variables"; + Boolean off; + equation + off = control.signal[1]; + 0 = p.i + n2.i + n1.i; + + p.v - n1.v = s1*(if (off) then 1 else Ron); + n1.i = -s1*(if (off) then Goff else 1); + p.v - n2.v = s2*(if (off) then Ron else 1); + n2.i = -s2*(if (off) then 1 else Goff); + end IdealCommutingSwitch; + + model IdealIntermediateSwitch "Ideal intermediate switch" + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + ; + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance"; + annotation ( + Documentation(info=" +

+The intermediate switch has four switching contact pins p1, p2, n1, and n2. +The switching behaviour is controlled by the control signal. If the control +signal is true, the pin p1 is connected to pin n2, and the pin p2 is +connected to the pin n2. Otherwise, the pin p1 is connected to n1, and +p2 is connected to n2. +

+ +\"IdealIntermediateSwitch1\" + +

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +

+ +\"IdealIntermediateSwitch2\" + +

+The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Ellipse(extent=[-4, 30; 4, 22]), + Text(extent=[-80, 50; -60, 72], string="p1"), + Text(extent=[-80, 0; -60, 22], string="p2"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-90, 50; -44, 50]), + Line(points=[-44, 0; 40, 50]), + Line(points=[-44, 50; 40, 0]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -70; 100, -100], string="%name")), + Diagram( + Ellipse(extent=[-4, 30; 4, 22]), + Text(extent=[-80, 50; -60, 72], string="p1"), + Text(extent=[-80, 0; -60, 22], string="p2"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-90, 50; -44, 50]), + Line(points=[-44, 0; 40, 50]), + Line(points=[-44, 50; 40, 0]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0])), + Window( + x=0.21, + y=0.05, + width=0.6, + height=0.6)); + public + Interfaces.PositivePin p1 annotation (extent=[-110, 40; -90, 60]); + Interfaces.PositivePin p2 annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n1 annotation (extent=[90, 40; 110, 60]); + Interfaces.NegativePin n2 annotation (extent=[90, -10; 110, 10]); + Modelica.Blocks.Interfaces.BooleanInPort control(final n=1) "true => p1--n2, p2--n1 connected, + otherwise p1--n1, p2--n2 connected" annotation (extent=[-10, 70; 10, + 90], rotation=-90); + protected + Real s1; + Real s2; + Real s3; + Real s4 "Auxiliary variables"; + Boolean off; + equation + off = control.signal[1]; + p1.v - n1.v = s1*(if (off) then 1 else Ron); + p2.v - n2.v = s2*(if (off) then 1 else Ron); + p1.v - n2.v = s3*(if (off) then Ron else 1); + p2.v - n1.v = s4*(if (off) then Ron else 1); + + p1.i = if (off) then s1*Goff + s3 else s1 + s3*Goff; + p2.i = if (off) then s2*Goff + s4 else s2 + s4*Goff; + n1.i = if (off) then -s1*Goff - s4 else -s1 - s4*Goff; + n2.i = if (off) then -s2*Goff - s3 else -s2 - s3*Goff; + end IdealIntermediateSwitch; + + model ControlledIdealSwitch "Controlled ideal switch" + parameter SI.Voltage level=0.5 "Switch level"; + parameter SI.Resistance Roff(final min=0) = 1.E-5 "Closed switch resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + parameter SI.Conductance Gon(final min=0) = 1.E-5 "Opened switch conductance"; protected Real s "Auxiliary variable"; annotation ( - Documentation(info=" - + Documentation(info="

-The ideal switch is a three-pole. If the third pin voltage exceeds the given +The ideal switch is a three-pole. If the third pin voltage exceeds the given parameter Voltage, the pins p and n are open (no current flowing, any voltage possible). Otherwise, p and n are short cut.

@@ -279,33 +450,41 @@ possible). Otherwise, p and n are short cut. Line(points=[40, 0; 90, 0]), Line(points=[0, 90; 0, 25]))); public - Modelica.Electrical.Analog.Interfaces.Pin p "Positive pin" annotation ( - extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.Pin n "Negative pin" annotation ( - extent=[90, -10; 110, 10]); - Modelica.Electrical.Analog.Interfaces.Pin control + Interfaces.Pin p "Positive pin" annotation (extent=[-110, -10; -90, 10]); + Interfaces.Pin n "Negative pin" annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin control "Control pin: control.v > level open, otherwise closed" annotation ( extent=[-10, 90; 10, 110], rotation=90); equation control.i = 0; 0 = p.i + n.i; - p.v - n.v = s * (if (control.v < level) then Roff else 1); - n.i = s * (if (control.v < level) then 1 else Gon); + p.v - n.v = s*(if (control.v < level) then Roff else 1); + n.i = s*(if (control.v < level) then 1 else Gon); end ControlledIdealSwitch; - model ControlledIdealCommutingSwitch "Ideal commuting switch" - parameter SIunits.Voltage level "Switch level"; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 - "Closed switch resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + + model ControlledIdealCommutingSwitch "Controlled ideal commuting switch" + parameter SI.Voltage level=0.5 "Switch level"; + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + ; + parameter SI.Conductance Goff(final min=0) = 1.E-5 "Opened switch conductance"; annotation ( - Documentation(info=" - + Documentation(info=" +

+The commuting switch has a positive pin p and two negative pins n1 and n2. +The switching behaviour is controlled +by the control pin. If its voltage exceeds the value of the parameter level, +the pin p is connected with the negative pin n2. Otherwise, the pin p is +connected the negative pin n1. +

-The commuting switch is a four pole. The switching behaviour is controlled -by the fourth pin. If its voltage exceeds the parameter Voltage value, -the first pin p is chort cut to the second pin ng. Otherwise, the pin p -is short cut to the third pin n1. +In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible.

"), @@ -315,6 +494,9 @@ is short cut to the third pin n1. component=[20, 20]), Icon( Ellipse(extent=[-44, 4; -36, -4]), + Text(extent=[-80, 0; -60, 22], string="p"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), Line(points=[-90, 0; -44, 0]), Line(points=[-37, 2; 40, 50]), Line(points=[40, 50; 90, 50]), @@ -323,6 +505,9 @@ is short cut to the third pin n1. Text(extent=[-100, -70; 100, -100], string="%name")), Diagram( Ellipse(extent=[-44, 4; -36, -4]), + Text(extent=[-80, 0; -60, 22], string="p"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), Line(points=[-90, 0; -44, 0]), Line(points=[-37, 2; 40, 50]), Line(points=[40, 50; 90, 50]), @@ -334,39 +519,135 @@ is short cut to the third pin n1. width=0.6, height=0.6)); public - Modelica.Electrical.Analog.Interfaces.Pin p "Positive pin" annotation ( - extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.Pin n2 "Negative pin 2" annotation ( - extent=[90, -10; 110, 10]); - Modelica.Electrical.Analog.Interfaces.Pin n1 "Negative pin 1" annotation ( - extent=[90, 40; 110, 60]); - Modelica.Electrical.Analog.Interfaces.Pin control - "Control pin: control.v > level p--n2, otherwise p--n1" annotation ( - extent=[-10, 90; 10, 110], rotation=90); - protected - Real s1, s2 "Auxiliary variables"; + Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n2 annotation (extent=[90, -10; 110, 10]); + Interfaces.NegativePin n1 annotation (extent=[90, 40; 110, 60]); + Interfaces.Pin control + "Control pin: if control.v > level p--n2 connected, otherwise p--n1 connected" + annotation (extent=[-10, 90; 10, 110], rotation=90); + protected + Real s1; + Real s2 "Auxiliary variables"; equation control.i = 0; 0 = p.i + n2.i + n1.i; - - p.v - n1.v = s1 * (if (control.v > level) then 1 else Roff); - n1.i = s1 * (if (control.v > level) then Gon else 1); - p.v - n2.v = s2 * (if (control.v > level) then Roff else 1); - n2.i = s2 * (if (control.v > level) then 1 else Gon); + + p.v - n1.v = s1*(if (control.v > level) then 1 else Ron); + n1.i = -s1*(if (control.v > level) then Goff else 1); + p.v - n2.v = s2*(if (control.v > level) then Ron else 1); + n2.i = -s2*(if (control.v > level) then 1 else Goff); end ControlledIdealCommutingSwitch; - model IdealOpAmp "Ideal opamp (norator-nullator pair)" - SIunits.Voltage v1 "Voltage drop over the left port"; - SIunits.Voltage v2 "Voltage drop over the right port"; - SIunits.Current i1 - "Current flowing from pos. to neg. pin of the left port"; - SIunits.Current i2 - "Current flowing from pos. to neg. pin of the right port"; + + model ControlledIdealIntermediateSwitch + "Controlled ideal intermediate switch" + parameter SI.Voltage level=0.5 "Switch level"; + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + ; + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance"; annotation ( - Documentation(info=" - + Documentation(info=" +

+The intermediate switch has four switching contact pins p1, p2, n1, and n2. +The switching behaviour is controlled +by the control pin. If its voltage exceeds the value of the +parameter level, the pin p1 is connected to pin n2, and the pin p2 is +connected to the pin n2. Otherwise, the pin p1 is connected to n1, and +p2 is connected to n2. +

+ +\"ControlledIdealIntermediateSwitch1\" + +

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +

+ +\"ControlledIdealIntermediateSwitch2\" + +

+The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Ellipse(extent=[-4, 30; 4, 22]), + Text(extent=[-80, 50; -60, 72], string="p1"), + Text(extent=[-80, 0; -60, 22], string="p2"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-90, 50; -44, 50]), + Line(points=[-44, 0; 40, 50]), + Line(points=[-44, 50; 40, 0]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -70; 100, -100], string="%name")), + Diagram( + Ellipse(extent=[-4, 30; 4, 22]), + Text(extent=[-80, 50; -60, 72], string="p1"), + Text(extent=[-80, 0; -60, 22], string="p2"), + Text(extent=[60, 50; 80, 72], string="n1"), + Text(extent=[60, 0; 80, 22], string="n2"), + Line(points=[-90, 0; -44, 0]), + Line(points=[-90, 50; -44, 50]), + Line(points=[-44, 0; 40, 50]), + Line(points=[-44, 50; 40, 0]), + Line(points=[40, 50; 90, 50]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 0; 90, 0])), + Window( + x=0.21, + y=0.05, + width=0.6, + height=0.6)); + + public + Interfaces.PositivePin p1 annotation (extent=[-110, 40; -90, 60]); + Interfaces.PositivePin p2 annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n1 annotation (extent=[90, 40; 110, 60]); + Interfaces.NegativePin n2 annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin control "Control pin: if control.v > level p1--n2, p2--n1 connected, + otherwise p1--n1, p2--n2 connected" annotation (extent=[-10, 90; 10, + 110], rotation=90); + protected + Real s1; + Real s2; + Real s3; + Real s4 "Auxiliary variables"; + equation + control.i = 0; + + p1.v - n1.v = s1*(if (control.v > level) then 1 else Ron); + p2.v - n2.v = s2*(if (control.v > level) then 1 else Ron); + p1.v - n2.v = s3*(if (control.v > level) then Ron else 1); + p2.v - n1.v = s4*(if (control.v > level) then Ron else 1); + + p1.i = if (control.v > level) then s1*Goff + s3 else s1 + s3*Goff; + p2.i = if (control.v > level) then s2*Goff + s4 else s2 + s4*Goff; + n1.i = if (control.v > level) then -s1*Goff - s4 else -s1 - s4*Goff; + n2.i = if (control.v > level) then -s2*Goff - s3 else -s2 - s3*Goff; + end ControlledIdealIntermediateSwitch; + + model IdealOpAmp "Ideal operational amplifier (norator-nullator pair)" + SI.Voltage v1 "Voltage drop over the left port"; + SI.Voltage v2 "Voltage drop over the right port"; + SI.Current i1 "Current flowing from pos. to neg. pin of the left port"; + SI.Current i2 "Current flowing from pos. to neg. pin of the right port"; + annotation ( + Documentation(info="

The ideal OpAmp is a two-port. The left port is fixed to v1=0 and i1=0 -(nullator). At the right port both any voltage v2 and any current i2 +(nullator). At the right port both any voltage v2 and any current i2 are possible (norator).

@@ -377,8 +658,7 @@ are possible (norator). component=[20, 20]), Icon( Text(extent=[-100, 80; 100, 100], string="%name"), - Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)) - , + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), Line(points=[-90, 50; -60, 50]), Line(points=[-90, -50; -60, -50]), Line(points=[60, 0; 90, 0]), @@ -387,8 +667,7 @@ are possible (norator). Line(points=[-39, -20; -39, -41]), Line(points=[-50, -31; -28, -31])), Diagram( - Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)) - , + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), Line(points=[-90, 50; -60, 50]), Line(points=[-90, -50; -60, -50]), Line(points=[60, 0; 90, 0]), @@ -437,16 +716,14 @@ are possible (norator). y=0.19, width=0.71, height=0.59)); - Modelica.Electrical.Analog.Interfaces.PositivePin p1 - "Positive pin of the left port" annotation (extent=[-110, -60; -90, -40]) - ; - Modelica.Electrical.Analog.Interfaces.NegativePin n1 - "Negative pin of the left port" annotation (extent=[-110, 40; -90, 60]); - Modelica.Electrical.Analog.Interfaces.PositivePin p2 - "Positive pin of the right port" annotation (extent=[90, -10; 110, 10]); - Modelica.Electrical.Analog.Interfaces.NegativePin n2 - "Negative pin of the right port" annotation (extent=[-10, -90; 10, -110] - , rotation=-90); + Interfaces.PositivePin p1 "Positive pin of the left port" annotation ( + extent=[-110, -60; -90, -40]); + Interfaces.NegativePin n1 "Negative pin of the left port" annotation ( + extent=[-110, 40; -90, 60]); + Interfaces.PositivePin p2 "Positive pin of the right port" annotation ( + extent=[90, -10; 110, 10]); + Interfaces.NegativePin n2 "Negative pin of the right port" annotation ( + extent=[-10, -90; 10, -110], rotation=-90); equation v1 = p1.v - n1.v; v2 = p2.v - n2.v; @@ -457,33 +734,200 @@ are possible (norator). v1 = 0; i1 = 0; end IdealOpAmp; + + model IdealOpAmp3Pin + "Ideal operational amplifier (norator-nullator pair), but 3 pins" + annotation ( + Documentation(info=" +

+The ideal OpAmp with three pins is of exactly the same behaviour as the ideal +OpAmp with four pins. Only the negative output pin is left out. +Both the input voltage and current are fixed to zero (nullator). +At the output pin both any voltage v2 and any current i2 +are possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Text(extent=[-100, 80; 100, 100], string="%name"), + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), + Line(points=[-90, 50; -60, 50]), + Line(points=[-90, -50; -60, -50]), + Line(points=[60, 0; 90, 0]), + Line(points=[-48, 32; -28, 32]), + Line(points=[-39, -20; -39, -41]), + Line(points=[-50, -31; -28, -31])), + Diagram( + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), + Line(points=[-90, 50; -60, 50]), + Line(points=[-90, -50; -60, -50]), + Line(points=[60, 0; 90, 0]), + Line(points=[-55, 50; -45, 50]), + Line(points=[-50, -45; -50, -55]), + Line(points=[-55, -50; -45, -50]), + Text( + extent=[-111, -39; -90, -19], + string="p1.i=0", + style(color=9, fillColor=9)), + Polygon(points=[120, 3; 110, 0; 120, -3; 120, 3], style( + color=9, + gradient=2, + fillColor=9, + fillPattern=1)), + Line(points=[111, 0; 136, 0], style( + color=9, + gradient=2, + fillColor=9)), + Text( + extent=[118, 2; 135, 17], + string="i2", + style( + color=9, + gradient=2, + fillColor=9)), + Text( + extent=[-111, 60; -90, 80], + string="n1.i=0", + style(color=9, fillColor=9))), + Window( + x=0.28, + y=0.19, + width=0.71, + height=0.59)); + Interfaces.PositivePin in_p "Positive pin of the input port" annotation ( + extent=[-110, -60; -90, -40]); + Interfaces.NegativePin in_n "Negative pin of the input port" annotation ( + extent=[-110, 40; -90, 60]); + Interfaces.PositivePin out "Output pin" annotation (extent=[90, -10; 110, + 10]); + equation + in_p.v = in_n.v; + in_p.i = 0; + in_n.i = 0; + end IdealOpAmp3Pin; + + model IdealOpAmpLimited "Ideal operational amplifier with limitation" + annotation ( + Documentation(info=" +

+The ideal OpAmp with limitation behaves like an ideal OpAmp without limitation, +if the output voltage is within the limits (VMin < out.v < VMax). In this case +the input voltage vin=in_p.v - in_n.v is zero. +If the input voltage is vin < 0, the output voltage is out.v = VMin. +If the input voltage is vin > 0, the output voltage is out.v = VMax. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Text(extent=[-110, 80; 100, 90], string="%name"), + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), + Line(points=[-45, -10; -10, -10; -10, 10; 20, 10]), + Line(points=[0, 35; 0, 80]), + Line(points=[0, -35; 0, -80]), + Line(points=[-90, 50; -60, 50]), + Line(points=[-90, -50; -60, -50]), + Line(points=[60, 0; 90, 0]), + Line(points=[-48, 32; -28, 32]), + Line(points=[-39, -20; -39, -41]), + Line(points=[-50, -31; -28, -31])), + Diagram( + Polygon(points=[60, 0; -60, 70; -60, -70; 60, 0], style(fillColor=7)), + Line(points=[-45, -10; -10, -10; -10, 10; 20, 10]), + Line(points=[0, 35; 0, 80]), + Line(points=[0, -35; 0, -80]), + Line(points=[-90, 50; -60, 50]), + Line(points=[-90, -50; -60, -50]), + Line(points=[60, 0; 90, 0]), + Line(points=[-55, 50; -45, 50]), + Line(points=[-50, -45; -50, -55]), + Line(points=[-55, -50; -45, -50]), + Text( + extent=[-111, -39; -90, -19], + string="p1.i=0", + style(color=9, fillColor=9)), + Polygon(points=[120, 3; 110, 0; 120, -3; 120, 3], style( + color=9, + gradient=2, + fillColor=9, + fillPattern=1)), + Line(points=[111, 0; 136, 0], style( + color=9, + gradient=2, + fillColor=9)), + Text( + extent=[118, 2; 135, 17], + string="i2", + style( + color=9, + gradient=2, + fillColor=9)), + Text( + extent=[-111, 60; -90, 80], + string="n1.i=0", + style(color=9, fillColor=9))), + Window( + x=0.28, + y=0.19, + width=0.71, + height=0.59)); + Interfaces.PositivePin in_p "Positive pin of the input port" annotation ( + extent=[-110, -60; -90, -40]); + Interfaces.NegativePin in_n "Negative pin of the input port" annotation ( + extent=[-110, 40; -90, 60]); + Interfaces.PositivePin out "Output pin" annotation (extent=[90, -10; 110, + 10]); + Interfaces.PositivePin VMax "Positive output voltage limitation" + annotation (extent=[-10, 60; 10, 80]); + Interfaces.NegativePin VMin "Negative output voltage limitation" + annotation (extent=[-10, -80; 10, -60]); + SI.Voltage vin "input voltage"; + protected + Real s "Auxiliary variable"; + equation + in_p.i = 0; + in_n.i = 0; + VMax.i = 0; + VMin.i = 0; + vin = in_p.v - in_n.v; + in_p.v - in_n.v = if (s < -1) then s + 1 else if (s > 1) then s - 1 else 0; + out.v = if (s < -1) then VMin.v else if (s > 1) then VMax.v else (VMax.v - + VMin.v)*s/2 + (VMax.v + VMin.v)/2; + end IdealOpAmpLimited; + model IdealDiode "Ideal electrical diode" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - parameter SIunits.Resistance Roff(final min=0) = 1.E-5 - "Closed diode resistance"; - parameter SIunits.Conductance Gon(final min=0) = 1.E-5 + extends Interfaces.OnePort; + parameter SI.Resistance Roff(final min=0) = 1.E-5 "Closed diode resistance" + ; + parameter SI.Conductance Gon(final min=0) = 1.E-5 "Opened diode conductance"; Boolean off(start=true) "Switching state of diode"; protected Real s "Auxiliary variable"; annotation ( - Documentation(info=" - + Documentation(info="

Ideal electrical diode. This is an ideal switch which is open, when it is reversed biased (voltage drop < 0) and which is closed, when it is conducting (current > 0). In order to prevent singularities during switching, the opened -diode has a high resistance and the closed diode has a low -resistance. +diode has a high resistance and the closed diode has a low +resistance.

-If the actual circuit has an appropriate structure, the +If the actual circuit has an appropriate structure, the limiting case is also allowed, i.e., the resistance of the closed diode could be exactly zero and the conductance of the open diode could be also exactly zero (i.e. the resistance is infinity). Note, there are circuits, where a description -with zero/infinity resistances is not possible. +with zero/infinity resistances is not possible.

"), @@ -519,16 +963,16 @@ with zero/infinity resistances is not possible. v = s*(if off then 1 else Roff); i = s*(if off then Gon else 1); end IdealDiode; + model IdealTransformer "Ideal electrical transformer" - extends Modelica.Electrical.Analog.Interfaces.TwoPort; + extends Interfaces.TwoPort; parameter Real n=1 "Turns ratio"; annotation ( Coordsys( extent=[-100, -100; 100, 100], grid=[2, 2], component=[20, 20]), - Documentation(info=" - + Documentation(info="

The ideal transformer is an ideal two-port resistive circuit element which is characterized by the following two equations: @@ -584,12 +1028,12 @@ where n is a real number called the turns ratio. v1 = n*v2; i2 = -n*i1; end IdealTransformer; + model IdealGyrator "Ideal gyrator" - extends Modelica.Electrical.Analog.Interfaces.TwoPort; + extends Interfaces.TwoPort; annotation ( - Documentation(info=" - -

+ Documentation(info=" +

A gyrator is an ideal two-port element defined by the following equations:

@@ -637,16 +1081,16 @@ where the constant G is called the gyration conductance.
         Ellipse(extent=[10, -30; 70, 30]), 
         Rectangle(extent=[80, -40; 40, 40], style(color=7, fillColor=7)), 
         Line(points=[90, 50; 40, 50; 40, -50; 90, -50])));
-    parameter SIunits.Conductance G=1 "Gyration conductance";
+    parameter SI.Conductance G=1 "Gyration conductance";
   equation 
     i1 = G*v2;
     i2 = -G*v1;
   end IdealGyrator;
+  
   model Idle "Idle branch" 
-    extends Modelica.Electrical.Analog.Interfaces.OnePort;
+    extends Interfaces.OnePort;
     annotation (
-      Documentation(info="
-
+      Documentation(info="
 

The model Idle is a simple idle running branch.

@@ -657,7 +1101,7 @@ The model Idle is a simple idle running branch. grid=[1, 1], component=[20, 20]), Icon( - Rectangle(extent=[-60, 60; 60, -60]), + Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), Line(points=[-90, 0; -41, 0]), Line(points=[91, 0; 40, 0]), Text(extent=[-100, 100; 100, 70], string="%name")), @@ -675,11 +1119,11 @@ The model Idle is a simple idle running branch. i = 0; end Idle; + model Short "Short cut branch" - extends Modelica.Electrical.Analog.Interfaces.OnePort; + extends Interfaces.OnePort; annotation ( - Documentation(info=" - + Documentation(info="

The model Short is a simple short cut branch.

@@ -690,7 +1134,7 @@ The model Short is a simple short cut branch. grid=[1, 1], component=[20, 20]), Icon( - Rectangle(extent=[-60, 60; 60, -60]), + Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), Line(points=[91, 0; -90, 0]), Text(extent=[-100, 100; 100, 70], string="%name")), Diagram( @@ -705,4 +1149,267 @@ The model Short is a simple short cut branch. equation v = 0; end Short; + + model IdealOpener "Ideal electrical opener" + extends Interfaces.OnePort; + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + annotation (extent=[-56.6667, 10; -10, 56.6667]); + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance" annotation (extent=[10, 10; 56.6667, 56.6667] + ); + Modelica.Blocks.Interfaces.BooleanInPort control(final n=1) + "true => switch open, false => p--n connected" annotation (extent=[-10, + 50; 10, 70], rotation=-90); + protected + Real s "Auxiliary variable"; + Boolean off; + + annotation ( + Documentation(info=" +

+The ideal opener has a positive pin p and a negative pin n. +The switching behaviour is controlled by the control signal. +If the control signal is true, pin p is not connected +with negative pin n. Otherwise, pin p is connected +with negative pin n. +

+

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Window( + x=0.45, + y=0.01, + width=0.44, + height=0.65), + Icon( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -70; 100, -100], string="%name"), + Line(points=[0, 51; 0, 26]), + Line(points=[40, 20; 40, 0])), + Diagram( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -40; 100, -79], string="%name"), + Line(points=[0, 51; 0, 26]), + Line(points=[40, 20; 40, 0]))); + equation + off = control.signal[1]; + v = s*(if off then 1 else Ron); + i = s*(if off then Goff else 1); + end IdealOpener; + + model IdealCloser "Ideal electrical closer" + extends Interfaces.OnePort; + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + annotation (extent=[-56.6667, 10; -10, 56.6667]); + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance" annotation (extent=[10, 10; 56.6667, 56.6667] + ); + Modelica.Blocks.Interfaces.BooleanInPort control(final n=1) + "true => switch open, false => p--n connected" annotation (extent=[-10, + 50; 10, 70], rotation=-90); + protected + Real s "Auxiliary variable"; + Boolean on; + + annotation ( + Documentation(info=" +

+The ideal opener has a positive pin p and a negative pin n. +The switching behaviour is controlled by the control signal. +If the control signal is true, pin p is not connected +with negative pin n. Otherwise, pin p is connected +with negative pin n. +

+

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Window( + x=0.24, + y=0.01, + width=0.65, + height=0.77), + Icon( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -70; 100, -100], string="%name"), + Line(points=[0, 51; 0, 26])), + Diagram( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Text(extent=[-100, -40; 100, -79], string="%name"), + Line(points=[0, 51; 0, 26]))); + equation + on = control.signal[1]; + v = s*(if not on then 1 else Ron); + i = s*(if not on then Goff else 1); + end IdealCloser; + + model ControlledIdealOpener "Controlled ideal electrical opener" + parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667 + , 10; -10, 56.6667]); + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + annotation (extent=[10, 10; 56.6667, 56.6667]); + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance" annotation (extent=[-56.6667, -56.6667; -10, + -10]); + protected + Real s "Auxiliary variable"; + annotation ( + Documentation(info=" + +

+The ideal switch has a positive pin p and a negative pin n. +The switching behaviour is controlled by the control pin. +If its voltage exceeds the voltage of the parameter level, +pin p is not connected with negative pin n. +Otherwise, pin p is connected with negative pin n. +

+

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Window( + x=0.45, + y=0.01, + width=0.44, + height=0.65), + Icon( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Line(points=[0, 90; 0, 25]), + Text(extent=[-100, -70; 100, -100], string="%name"), + Line(points=[40, 20; 40, 0])), + Diagram( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Line(points=[0, 90; 0, 25]), + Line(points=[40, 20; 40, 0]))); + public + Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin control + "Control pin: control.v > level switch open, otherwise p--n connected" + annotation (extent=[-10, 90; 10, 110], rotation=90); + equation + control.i = 0; + 0 = p.i + n.i; + p.v - n.v = s*(if (control.v > level) then 1 else Ron); + p.i = s*(if (control.v > level) then Goff else 1); + end ControlledIdealOpener; + + model ControlledIdealCloser "Controlled ideal electrical closer" + parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667 + , 10; -10, 56.6667]); + parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" + annotation (extent=[10, 10; 56.6667, 56.6667]); + parameter SI.Conductance Goff(final min=0) = 1.E-5 + "Opened switch conductance" annotation (extent=[-56.6667, -56.6667; -10, + -10]); + protected + Real s "Auxiliary variable"; + annotation ( + Documentation(info=" + +

+The ideal switch has a positive pin p and a negative pin n. +The switching behaviour is controlled by the control pin. +If its voltage exceeds the voltage of the parameter level, +pin p is not connected with negative pin n. +Otherwise, pin p is connected with negative pin n. +

+

+In order to prevent singularities during switching, the opened +switch has a (very low) conductance Goff +and the closed switch has a (very low) resistance Ron. +The limiting case is also allowed, i.e., the resistance Ron of the +closed switch could be exactly zero and the conductance Goff of the +open switch could be also exactly zero. Note, there are circuits, +where a description with zero Ron or zero Goff is not possible. +

+ +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Window( + x=0.45, + y=0.01, + width=0.44, + height=0.65), + Icon( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Line(points=[0, 90; 0, 25]), + Text(extent=[-100, -70; 100, -100], string="%name")), + Diagram( + Ellipse(extent=[-44, 4; -36, -4]), + Line(points=[-90, 0; -44, 0]), + Line(points=[-37, 2; 40, 50]), + Line(points=[40, 0; 90, 0]), + Line(points=[0, 90; 0, 25]))); + public + Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); + Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin control + "Control pin: control.v > level switch open, otherwise p--n connected" + annotation (extent=[-10, 90; 10, 110], rotation=90); + equation + control.i = 0; + 0 = p.i + n.i; + p.v - n.v = s*(if (control.v > level) then Ron else 1); + p.i = s*(if (control.v > level) then 1 else Goff); + end ControlledIdealCloser; + end Ideal; diff --git a/Electrical/Analog/Interfaces.mo b/Electrical/Analog/Interfaces.mo index d311cfda73..41bdda4087 100644 --- a/Electrical/Analog/Interfaces.mo +++ b/Electrical/Analog/Interfaces.mo @@ -1,21 +1,13 @@ -package Interfaces - extends Modelica.Icons.Library; - package SIunits = Modelica.SIunits; +package Interfaces - annotation ( - Coordsys( - extent=[0, 0; 210, 333], - grid=[1, 1], - component=[20, 20]), - Window( + extends Modelica.Icons.Library; + annotation (Window( x=0.03, y=0.04, width=0.21, height=0.49, library=1, - autolayout=1), - Documentation(info=" - + autolayout=1),Documentation(info="

This package contains connectors and interfaces (partial models) for analog electrical components. @@ -25,9 +17,9 @@ analog electrical components.

Main Authors:
-Christoph Clauß +Christoph Clauß <clauss@eas.iis.fhg.de>
- André Schneider + André Schneider <schneider@eas.iis.fhg.de>
Fraunhofer Institute for Integrated Circuits
Design Automation Department
@@ -43,155 +35,123 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright © 1998-2002, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions -and the accompanying disclaimer in the documentation of package +and the accompanying disclaimer in the documentation of package Modelica in file \"Modelica/package.mo\".

")); - connector Pin "Pin of an electrical component" - SIunits.Voltage v "Potential at the pin"; - flow SIunits.Current i "Current flowing into the pin"; + + connector Pin "Pin of an electrical component" + SI.Voltage v "Potential at the pin"; + flow SI.Current i "Current flowing into the pin"; annotation ( - Coordsys( - extent=[-100, -100; 100, 100], - grid=[2, 2], - component=[20, 20]), - Documentation(info=" -"), - Icon(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor=3 - ))), - Diagram(Rectangle(extent=[-100, 100; 100, -100], style(color=3, - fillColor=3)), Text( - extent=[-100, -120; 100, -220], - string="%name", - style(color=3))), - Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3, - fillColor=3))), - Window( - x=0.21, - y=0.11, - width=0.6, - height=0.63)); + Icon(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor=3) + )), + Diagram(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor + =3)), Text( + extent=[-100, -120; 100, -220], + string="%name", + style(color=3))), + Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3, + fillColor=3)))); end Pin; - connector PositivePin "Positive pin of an electric component" - SIunits.Voltage v "Potential at the pin"; - flow SIunits.Current i "Current flowing into the pin"; + + connector PositivePin "Positive pin of an electric component" + SI.Voltage v "Potential at the pin"; + flow SI.Current i "Current flowing into the pin"; annotation ( - Coordsys( - extent=[-100, -100; 100, 100], - grid=[2, 2], - component=[20, 20]), - Documentation(info="Connectors PositivePin and NegativePin are nearly identical. + Documentation(info="

Connectors PositivePin +and NegativePin are nearly identical. The only difference is that the icons are different in order to identify more easily the pins of a component. Usually, connector PositivePin is used for the positive and connector NegativePin for the negative pin of an electrical -component. - -"), - Icon(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor=3 - ))), - Diagram(Rectangle(extent=[-100, 100; 100, -100], style(color=3, - fillColor=3)), Text( - extent=[-100, -120; 100, -220], - string="%name", - style(color=3))), - Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3, - fillColor=3))), - Window( - x=0.21, - y=0.08, - width=0.6, - height=0.6)); +component.

"), + Icon(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor=3) + )), + Diagram(Rectangle(extent=[-100, 100; 100, -100], style(color=3, fillColor + =3)), Text( + extent=[-100, -120; 100, -220], + string="%name", + style(color=3))), + Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3, + fillColor=3)))); end PositivePin; - connector NegativePin "Negative pin of an electric component" - SIunits.Voltage v "Potential at the pin"; - flow SIunits.Current i "Current flowing into the pin"; + + connector NegativePin "Negative pin of an electric component" + SI.Voltage v "Potential at the pin"; + flow SI.Current i "Current flowing into the pin"; annotation ( - Coordsys( - extent=[-100, -100; 100, 100], - grid=[2, 2], - component=[20, 20]), - Documentation(info="Connectors PositivePin and NegativePin are nearly identical. + Documentation(info="

Connectors PositivePin +and NegativePin are nearly identical. The only difference is that the icons are different in order to identify more easily the pins of a component. Usually, connector PositivePin is used for the positive and connector NegativePin for the negative pin of an electrical -component. - - -"), +component.

"), Icon(Rectangle(extent=[-100, 100; 100, -100], style( - color=3, - gradient=0, - fillColor=7, - fillPattern=1))), + color=3, + gradient=0, + fillColor=7, + fillPattern=1))), Diagram(Rectangle(extent=[-100, 100; 100, -100], style( - color=3, - fillColor=7, + color=3, + fillColor=7, fillPattern=1)), Text(extent=[-100, -120; 100, -220], string= - "%name")), - Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3))), - Window( - x=0.33, - y=0.01, - width=0.56, - height=0.67)); + "%name")), + Terminal(Rectangle(extent=[-100, 100; 100, -100], style(color=3)))); end NegativePin; - partial model TwoPin "Component with one electrical port" - SIunits.Voltage v - "Voltage drop between the two pins (= p.v - n.v)"; - Modelica.Electrical.Analog.Interfaces.PositivePin p "Positive pin" - annotation (extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.NegativePin n "Negative pin" - annotation (extent=[90, -10; 110, 10]); + partial model TwoPin "Component with one electrical port" + SI.Voltage v "Voltage drop between the two pins (= p.v - n.v)"; + PositivePin p "Positive pin" annotation (extent=[-110, -10; -90, 10]); + NegativePin n "Negative pin" annotation (extent=[90, -10; 110, 10]); annotation ( Diagram( Polygon(points=[-120, 3; -110, 0; -120, -3; -120, 3], style( - color=9, - fillColor=9, - fillPattern=1)), - Line(points=[-136, 0; -111, 0], style(color=9, fillColor=9)), + color=9, + fillColor=9, + fillPattern=1)), + Line(points=[-136, 0; -111, 0], style(color=9, fillColor=9)), Text( - extent=[-134, 5; -117, 20], - string="p.i", - style(color=9, fillColor=9)), - Line(points=[110, 0; 135, 0], style(color=9, fillColor=9)), + extent=[-134, 5; -117, 20], + string="p.i", + style(color=9, fillColor=9)), + Line(points=[110, 0; 135, 0], style(color=9, fillColor=9)), Polygon(points=[120, 3; 110, 0; 120, -3; 120, 3], style( - color=9, - fillColor=9, - fillPattern=1)), + color=9, + fillColor=9, + fillPattern=1)), Text( - extent=[117, 3; 134, 18], - string="n.i", - style(color=9, fillColor=9))), + extent=[117, 3; 134, 18], + string="n.i", + style(color=9, fillColor=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.11, - y=0.14, - width=0.55, + x=0.11, + y=0.14, + width=0.55, height=0.64)); - equation + equation v = p.v - n.v; end TwoPin; - partial model OnePort - "Component with two electrical pins p and n and current i from p to n" - SIunits.Voltage v - "Voltage drop between the two pins (= p.v - n.v)"; - SIunits.Current i "Current flowing from pin p to pin n"; + + partial model OnePort + "Component with two electrical pins p and n and current i from p to n" + SI.Voltage v "Voltage drop between the two pins (= p.v - n.v)"; + SI.Current i "Current flowing from pin p to pin n"; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[2, 2], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[2, 2], + component=[20, 20]), Documentation(info="

Superclass of elements which have two electrical pins: @@ -201,115 +161,111 @@ into pin p is identical to the current flowing out of pin n. This current is provided explicitly as current i.

-"), +"), Diagram( - Line(points=[-110, 20; -85, 20], style(color=9, fillColor=9)), + Line(points=[-110, 20; -85, 20], style(color=9, fillColor=9)), Polygon(points=[-95, 23; -85, 20; -95, 17; -95, 23], style( - color=9, - fillColor=9, - fillPattern=1)), - Line(points=[90, 20; 115, 20], style(color=9, fillColor=9)), - Line(points=[-125, 0; -115, 0], style(color=9)), - Line(points=[-120, -5; -120, 5], style(color=9)), + color=9, + fillColor=9, + fillPattern=1)), + Line(points=[90, 20; 115, 20], style(color=9, fillColor=9)), + Line(points=[-125, 0; -115, 0], style(color=9)), + Line(points=[-120, -5; -120, 5], style(color=9)), Text( - extent=[-110, 25; -90, 45], - string="i", - style(color=9)), + extent=[-110, 25; -90, 45], + string="i", + style(color=9)), Polygon(points=[105, 23; 115, 20; 105, 17; 105, 23], style( - color=9, - fillColor=9, - fillPattern=1)), - Line(points=[115, 0; 125, 0], style(color=9)), + color=9, + fillColor=9, + fillPattern=1)), + Line(points=[115, 0; 125, 0], style(color=9)), Text( - extent=[90, 45; 110, 25], - string="i", - style(color=9))), + extent=[90, 45; 110, 25], + string="i", + style(color=9))), Window( - x=0.33, - y=0.04, - width=0.63, + x=0.33, + y=0.04, + width=0.63, height=0.67)); - Modelica.Electrical.Analog.Interfaces.PositivePin p annotation (extent=[ - -110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (extent=[ - 110, -10; 90, 10]); - equation + PositivePin p annotation (extent=[-110, -10; -90, 10]); + NegativePin n annotation (extent=[110, -10; 90, 10]); + equation v = p.v - n.v; 0 = p.i + n.i; i = p.i; end OnePort; - partial model TwoPort - "Component with two electrical ports, including current" - SIunits.Voltage v1 "Voltage drop over the left port"; - SIunits.Voltage v2 "Voltage drop over the right port"; - SIunits.Current i1 - "Current flowing from pos. to neg. pin of the left port"; - SIunits.Current i2 - "Current flowing from pos. to neg. pin of the right port"; - Modelica.Electrical.Analog.Interfaces.PositivePin p1 - "Positive pin of the left port" annotation (extent=[-110, 40; -90, 60]); - Modelica.Electrical.Analog.Interfaces.NegativePin n1 - "Negative pin of the left port" annotation (extent=[-110, -60; -90, -40]) - ; - Modelica.Electrical.Analog.Interfaces.PositivePin p2 - "Positive pin of the right port" annotation (extent=[90, 40; 110, 60]); - Modelica.Electrical.Analog.Interfaces.NegativePin n2 - "Negative pin of the right port" annotation (extent=[90, -60; 110, -40]); + + partial model TwoPort + "Component with two electrical ports, including current" + SI.Voltage v1 "Voltage drop over the left port"; + SI.Voltage v2 "Voltage drop over the right port"; + SI.Current i1 "Current flowing from pos. to neg. pin of the left port"; + SI.Current i2 "Current flowing from pos. to neg. pin of the right port"; + PositivePin p1 "Positive pin of the left port" annotation (extent=[-110, 40 + ; -90, 60]); + NegativePin n1 "Negative pin of the left port" annotation (extent=[-110, - + 60; -90, -40]); + PositivePin p2 "Positive pin of the right port" annotation (extent=[90, 40 + ; 110, 60]); + NegativePin n2 "Negative pin of the right port" annotation (extent=[90, -60 + ; 110, -40]); annotation ( Diagram( Polygon(points=[-120, 53; -110, 50; -120, 47; -120, 53], style( - color=9, - fillColor=9, - fillPattern=1)), - Line(points=[-136, 50; -111, 50], style(color=9, fillColor=9)), + color=9, + fillColor=9, + fillPattern=1)), + Line(points=[-136, 50; -111, 50], style(color=9, fillColor=9)), Polygon(points=[127, -47; 137, -50; 127, -53; 127, -47], style( - color=9, - fillColor=9, - fillPattern=1)), - Line(points=[111, -50; 136, -50], style(color=9, fillColor=9)), + color=9, + fillColor=9, + fillPattern=1)), + Line(points=[111, -50; 136, -50], style(color=9, fillColor=9)), Text( - extent=[112, -44; 128, -29], - string="i2", - style(color=9, fillColor=9)), + extent=[112, -44; 128, -29], + string="i2", + style(color=9, fillColor=9)), Text( - extent=[118, 52; 135, 67], - string="i2", + extent=[118, 52; 135, 67], + string="i2", style( - color=9, - gradient=2, - fillColor=9)), + color=9, + gradient=2, + fillColor=9)), Polygon(points=[120, 53; 110, 50; 120, 47; 120, 53], style( - color=9, - gradient=2, - fillColor=9, - fillPattern=1)), + color=9, + gradient=2, + fillColor=9, + fillPattern=1)), Line(points=[111, 50; 136, 50], style( - color=9, - gradient=2, - fillColor=9)), - Line(points=[-136, -49; -111, -49], style(color=9, fillColor=9)), + color=9, + gradient=2, + fillColor=9)), + Line(points=[-136, -49; -111, -49], style(color=9, fillColor=9)), Polygon(points=[-126, -46; -136, -49; -126, -52; -126, -46], style( - color=9, - fillColor=9, - fillPattern=1)), + color=9, + fillColor=9, + fillPattern=1)), Text( - extent=[-127, -46; -110, -31], - string="i1", - style(color=9, fillColor=9)), + extent=[-127, -46; -110, -31], + string="i1", + style(color=9, fillColor=9)), Text( - extent=[-136, 53; -119, 68], - string="i1", - style(color=9, fillColor=9))), + extent=[-136, 53; -119, 68], + string="i1", + style(color=9, fillColor=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.16, - y=0.12, - width=0.6, + x=0.16, + y=0.12, + width=0.6, height=0.6)); - equation + equation v1 = p1.v - n1.v; v2 = p2.v - n2.v; 0 = p1.i + n1.i; @@ -318,113 +274,108 @@ This current is provided explicitly as current i. i2 = p2.i; end TwoPort; - partial model AbsoluteSensor - "Base class to measure the absolute value of a pin variable" + partial model AbsoluteSensor + "Base class to measure the absolute value of a pin variable" extends Modelica.Icons.RotationalSensor; - - Modelica.Electrical.Analog.Interfaces.PositivePin p "pin to be measured" - annotation (extent=[-110, -10; -90, 10]); - Modelica.Blocks.Interfaces.OutPort outPort(final n=1) annotation (extent=[ - 100, -10; 120, 10]); + + PositivePin p "pin to be measured" annotation (extent=[-110, -10; -90, 10]) + ; + Modelica.Blocks.Interfaces.OutPort outPort(final n=1) annotation (extent=[100, -10; 120, 10]); annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.31, - y=0.04, - width=0.6, - height=0.6), + x=0.31, + y=0.04, + width=0.6, + height=0.6), Icon( - Line(points=[-70, 0; -90, 0], style(color=0)), - Line(points=[70, 0; 100, 0]), - Text(extent=[-110, 80; 110, 120], string="%name")), - Diagram(Line(points=[-70, 0; -90, 0], style(color=0)), Line(points=[70, - 0; 100, 0]))); + Line(points=[-70, 0; -90, 0], style(color=0)), + Line(points=[70, 0; 100, 0]), + Text(extent=[-110, 80; 110, 120], string="%name")), + Diagram(Line(points=[-70, 0; -90, 0], style(color=0)), Line(points=[70, 0 + ; 100, 0]))); end AbsoluteSensor; - model RelativeSensor - "Base class to measure a relative variable between two pins" + + partial model RelativeSensor + "Base class to measure a relative variable between two pins" extends Modelica.Icons.RotationalSensor; - - Modelica.Electrical.Analog.Interfaces.PositivePin p "positive pin" - annotation (extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.NegativePin n "negative pin" - annotation (extent=[90, -10; 110, 10]); - Modelica.Blocks.Interfaces.OutPort outPort(final n=1) annotation (extent=[ - -10, -90; 10, -110], rotation=90); + + PositivePin p "positive pin" annotation (extent=[-110, -10; -90, 10]); + NegativePin n "negative pin" annotation (extent=[90, -10; 110, 10]); + Modelica.Blocks.Interfaces.OutPort outPort(final n=1) annotation (extent=[-10, -90; 10, -110], + rotation=90); + annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), - Window( - x=0.21, - y=0.04, - width=0.6, - height=0.6), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Line(points=[-70, 0; -90, 0], style(color=0)), - Line(points=[70, 0; 90, 0], style(color=0)), - Line(points=[0, -90; 0, -70]), - Text(extent=[-110, 80; 110, 120], string="%name")), + Line(points=[-70, 0; -90, 0], style(color=0)), + Line(points=[70, 0; 90, 0], style(color=0)), + Line(points=[0, -90; 0, -70]), + Text(extent=[-110, 80; 110, 120], string="%name")), Diagram( - Line(points=[-70, 0; -90, 0], style(color=0)), - Line(points=[0, -90; 0, -70]), + Line(points=[-70, 0; -90, 0], style(color=0)), + Line(points=[0, -90; 0, -70]), Line(points=[70, 0; 90, 0], style(color=0)))); + end RelativeSensor; - partial model VoltageSource "Interface for voltage sources" + + partial model VoltageSource "Interface for voltage sources" extends OnePort; - parameter SIunits.Voltage offset=0 "Voltage offset"; - parameter SIunits.Time startTime=0 "Time offset"; + parameter SI.Voltage offset=0 "Voltage offset"; + parameter SI.Time startTime=0 "Time offset"; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), - Line(points=[-90, 0; -50, 0]), - Line(points=[50, 0; 90, 0]), - Text(extent=[-100, -120; 100, -80], string="%name=%V"), - Line(points=[-50, 0; 50, 0])), + Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), + Line(points=[-90, 0; -50, 0]), + Line(points=[50, 0; 90, 0]), + Text(extent=[-100, -120; 100, -80], string="%name=%V"), + Line(points=[-50, 0; 50, 0])), Window( - x=0.31, - y=0.09, - width=0.6, + x=0.31, + y=0.09, + width=0.6, height=0.6)); - replaceable Modelica.Blocks.Interfaces.SignalSource signalSource(final - offset={offset}, final startTime={startTime}) annotation (extent=[70, - 70; 90, 90]); - equation + replaceable Modelica.Blocks.Interfaces.SignalSource signalSource(final offset={offset}, final + startTime={startTime}) annotation (extent=[70, 70; 90, 90]); + equation v = signalSource.outPort.signal[1]; end VoltageSource; - partial model CurrentSource "Interface for current sources" + + partial model CurrentSource "Interface for current sources" extends OnePort; - - parameter SIunits.Current offset=0 "Current offset"; - parameter SIunits.Time startTime=0 "Time offset"; + + parameter SI.Current offset=0 "Current offset"; + parameter SI.Time startTime=0 "Time offset"; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), - Line(points=[-90, 0; -50, 0]), - Line(points=[50, 0; 90, 0]), - Line(points=[0, -50; 0, 50]), - Text(extent=[-100, -120; 100, -80], string="%name=%I")), + Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), + Line(points=[-90, 0; -50, 0]), + Line(points=[50, 0; 90, 0]), + Line(points=[0, -50; 0, 50]), + Text(extent=[-100, -120; 100, -80], string="%name=%I")), Window( - x=0.33, - y=0.24, - width=0.6, + x=0.33, + y=0.24, + width=0.6, height=0.6)); - replaceable Modelica.Blocks.Interfaces.SignalSource signalSource(final - offset={offset}, final startTime={startTime}) annotation (extent=[69, - 70; 90, 90]); - equation + replaceable Modelica.Blocks.Interfaces.SignalSource signalSource(final offset={offset}, final + startTime={startTime}) annotation (extent=[69, 70; 90, 90]); + equation i = signalSource.outPort.signal[1]; end CurrentSource; end Interfaces; diff --git a/Electrical/Analog/Lines.mo b/Electrical/Analog/Lines.mo index fb9a72f5e5..5a3825dd40 100644 --- a/Electrical/Analog/Lines.mo +++ b/Electrical/Analog/Lines.mo @@ -1,31 +1,29 @@ -package Lines +package Lines + extends Modelica.Icons.Library; - package SIunits = Modelica.SIunits; annotation ( - Coordsys( - extent=[0, 0; 400, 500], - grid=[1, 1], - component=[20, 20]), Window( x=0.03, y=0.04, width=0.50, height=0.24, library=1, - autolayout=1), - Documentation(info=" - + autolayout=1), + Documentation(info="

-This package contains lossy and lossless tranmission lines. +This package contains lossy and lossless segmented transmission lines, +and LC distributed line models.

Main Authors:
-Christoph Clauß +Christoph Clauß <clauss@eas.iis.fhg.de>
+ Joachim Haase; + <haase@eas.iis.fhg.de>
André Schneider <schneider@eas.iis.fhg.de>
Fraunhofer Institute for Integrated Circuits
@@ -42,56 +40,53 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright © 1998-2002, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions -and the accompanying disclaimer in the documentation of package +and the accompanying disclaimer in the documentation of package Modelica in file \"Modelica/package.mo\".

")); - - model OLine "Lossy Transmission Line" + model OLine "Lossy Transmission Line" //extends Interfaces.ThreePol; - Modelica.Electrical.Analog.Interfaces.Pin p1 annotation (extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.Pin p2 annotation (extent=[90, -10; 110, 10]); - Modelica.Electrical.Analog.Interfaces.Pin p3 annotation (extent=[-10, -110; 10, -90]); - SIunits.Voltage v13; - SIunits.Voltage v23; - SIunits.Current i1; - SIunits.Current i2; + Interfaces.Pin p1 annotation (extent=[-110, -10; -90, 10]); + Interfaces.Pin p2 annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin p3 annotation (extent=[-10, -110; 10, -90]); + SI.Voltage v13; + SI.Voltage v23; + SI.Current i1; + SI.Current i2; parameter Real r( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="Ohm/m") = 1 "Resistance per meter"; parameter Real l( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="H/m") = 1 "Inductance per meter"; parameter Real g( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="Siemens/m") = 1 "Conductance per meter"; parameter Real c( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="F/m") = 1 "Capacitance per meter"; - parameter SIunits.Length length(final min=Modelica.Constants.SMALL) - = 1 "Length of line"; + parameter SI.Length length(final min=Modelica.Constants.small) = 1 "Length of line"; parameter Integer N(final min=1) = 1 "Number of lumped segments"; - protected - Modelica.Electrical.Analog.Basic.Resistor R[N + 1](R=r*length/(N+1)); - Modelica.Electrical.Analog.Basic.Inductor L[N + 1](L=l*length/(N+1)); - Modelica.Electrical.Analog.Basic.Capacitor C[N](C=c*length/(N+1)); - Modelica.Electrical.Analog.Basic.Conductor G[N](G=g*length/(N+1)); + protected + Basic.Resistor R[N + 1](R=fill(r*length/(N + 1), N + 1)); + Basic.Inductor L[N + 1](L=fill(l*length/(N + 1), N + 1)); + Basic.Capacitor C[N](C=fill(c*length/(N), N)); + Basic.Conductor G[N](G=fill(g*length/(N), N)); annotation ( - Documentation(info=" - + Documentation(info="

-Lossy Transmission Line +Lossy Transmission Line. The lossy transmission line OLine consists of segments of lumped resistances and inductances in series and conductances and capacitances that are - connected with the reference pin g. The precision + connected with the reference pin p3. The precision of the model depends on the number N of lumped segments.

@@ -99,7 +94,7 @@ Lossy Transmission Line
References:
- Johnson, B.; Quarles, T.; Newton, A. R.; Pederson, D. O.; + Johnson, B.; Quarles, T.; Newton, A. R.; Pederson, D. O.; Sangiovanni-Vincentelli, A.: SPICE3 Version 3e User's Manual (April 1, 1991). Department of Electrical Engineering and Computer Sciences, University of California, Berkley @@ -107,39 +102,38 @@ Lossy Transmission Line

-"), +"), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), - Line(points=[0, -60; 0, -90]), - Line(points=[60, 0; 90, 0]), - Line(points=[-60, 0; -90, 0]), - Line(points=[30, 30; -30, 30]), - Line(points=[-30, 40; -30, 20]), - Line(points=[30, 40; 30, 20]), - Text(extent=[-100, 100; 100, 70], string="%name")), + Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), + Line(points=[0, -60; 0, -90]), + Line(points=[60, 0; 90, 0]), + Line(points=[-60, 0; -90, 0]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="%name")), Diagram( - Rectangle(extent=[-60, 60; 60, -60]), - Line(points=[0, -60; 0, -90]), - Line(points=[60, 0; 90, 0]), - Line(points=[-60, 0; -90, 0]), - Line(points=[30, 30; -30, 30]), - Line(points=[-30, 40; -30, 20]), - Line(points=[30, 40; 30, 20])), + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[0, -60; 0, -90]), + Line(points=[60, 0; 90, 0]), + Line(points=[-60, 0; -90, 0]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20])), Window( - x=0.24, - y=0.07, - width=0.6, + x=0.24, + y=0.07, + width=0.6, height=0.6)); - equation + equation v13 = p1.v - p3.v; v23 = p2.v - p3.v; i1 = p1.i; i2 = p2.i; - // other models if gg = 0 ... connect(p1, R[1].p); for i in 1:N loop connect(R[i].n, L[i].p); @@ -152,34 +146,33 @@ Lossy Transmission Line connect(R[N + 1].n, L[N + 1].p); connect(L[N + 1].n, p2); end OLine; - model ULine "Lossy RC Line" + + model ULine "Lossy RC Line" //extends Interfaces.ThreePol; - Modelica.Electrical.Analog.Interfaces.Pin p1 annotation (extent=[-110, -10; -90, 10]); - Modelica.Electrical.Analog.Interfaces.Pin p2 annotation (extent=[90, -10; 110, 10]); - Modelica.Electrical.Analog.Interfaces.Pin p3 annotation (extent=[-10, -110; 10, -90]); - SIunits.Voltage v13; - SIunits.Voltage v23; - SIunits.Current i1; - SIunits.Current i2; + Interfaces.Pin p1 annotation (extent=[-110, -10; -90, 10]); + Interfaces.Pin p2 annotation (extent=[90, -10; 110, 10]); + Interfaces.Pin p3 annotation (extent=[-10, -110; 10, -90]); + SI.Voltage v13; + SI.Voltage v23; + SI.Current i1; + SI.Current i2; parameter Real r( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="Ohm/m") = 1 "Resistance per meter"; parameter Real c( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, unit="F/m") = 1 "Capacitance per meter"; - parameter SIunits.Length length(final min=Modelica.Constants.SMALL) = - 1 "Length of line"; + parameter SI.Length length(final min=Modelica.Constants.small) = 1 "Length of line"; parameter Integer N(final min=1) = 1 "Number of lumped segments"; - protected - Modelica.Electrical.Analog.Basic.Resistor R[N + 1](R=r*length/(N+1)); - Modelica.Electrical.Analog.Basic.Capacitor C[N](C=c*length/(N+1)); + protected + Basic.Resistor R[N + 1](R=fill(r*length/(N + 1), N + 1)); + Basic.Capacitor C[N](C=fill(c*length/(N), N)); annotation ( - Documentation(info=" - + Documentation(info="

-The lossy RC line ULine consists of segments of +The lossy RC line ULine consists of segments of lumped series resistances and capacitances that are -connected with the reference pin g. The precision +connected with the reference pin p3. The precision of the model depends on the number N of lumped segments.

@@ -187,7 +180,7 @@ lumped segments.
References:
- Johnson, B.; Quarles, T.; Newton, A. R.; Pederson, D. O.; + Johnson, B.; Quarles, T.; Newton, A. R.; Pederson, D. O.; Sangiovanni-Vincentelli, A.: SPICE3 Version 3e User's Manual (April 1, 1991). Department of Electrical Engineering and Computer Sciences, University of California, Berkley @@ -195,34 +188,34 @@ lumped segments.

-"), +"), Coordsys( - extent=[-100, -100; 100, 100], - grid=[2, 2], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[2, 2], + component=[20, 20]), Window( - x=0.2, - y=0.21, - width=0.6, - height=0.6), + x=0.2, + y=0.21, + width=0.6, + height=0.6), Icon( - Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), - Line(points=[0, -60; 0, -90]), - Line(points=[60, 0; 90, 0]), - Line(points=[-60, 0; -90, 0]), - Line(points=[30, 30; -30, 30]), - Line(points=[-30, 40; -30, 20]), - Line(points=[30, 40; 30, 20]), - Text(extent=[-100, 100; 100, 70], string="%name")), + Rectangle(extent=[-60, 60; 60, -60], style(fillColor=7)), + Line(points=[0, -60; 0, -90]), + Line(points=[60, 0; 90, 0]), + Line(points=[-60, 0; -90, 0]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="%name")), Diagram( - Rectangle(extent=[-60, 60; 60, -60]), - Line(points=[0, -60; 0, -90]), - Line(points=[60, 0; 90, 0]), - Line(points=[-60, 0; -90, 0]), - Line(points=[30, 30; -30, 30]), - Line(points=[-30, 40; -30, 20]), + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[0, -60; 0, -90]), + Line(points=[60, 0; 90, 0]), + Line(points=[-60, 0; -90, 0]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), Line(points=[30, 40; 30, 20]))); - equation + equation v13 = p1.v - p3.v; v23 = p2.v - p3.v; i1 = p1.i; @@ -239,5 +232,239 @@ lumped segments. end for; connect(R[N + 1].n, p2); end ULine; - + model TLine1 + "Lossless transmission line with characteristic impedance Z0 and transmission delay TD" + + extends Modelica.Electrical.Analog.Interfaces.TwoPort; + + parameter Modelica.SIunits.Resistance Z0=1 "Characteristic impedance"; + parameter Modelica.SIunits.Time TD=1 "Transmission delay"; + + protected + Modelica.SIunits.Voltage er; + Modelica.SIunits.Voltage es; + annotation ( + Documentation(info=" + +Lossless transmission line with characteristic impedance Z0 and transmission delay TD + + The lossless transmission line TLine1 is a two Port. Both port branches + consist of a resistor with characteristic impedance Z0 and a controled voltage + source that takes into consideration the transmission delay TD. + For further details see Branin's article. + The model parameters can be derived from inductance and + capacitance per length (L' resp. C'), i. e. + Z0 = sqrt(L'/C') and TD = sqrt(L'*C')*length_of_line. Resistance R' + and conductance C' per meter are assumed to be zero. + +References: + Branin Jr., F. H.: Transient Analysis of Lossless Transmission Lines. + Proceedings of the IEEE 55(1967), 2012 - 2013 + + Hoefer, E. E. E.; Nielinger, H.: SPICE : Analyseprogramm fuer elektronische + Schaltungen. Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1985. + +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine1"), + Text(extent=[-30, 10; 30, -20], string="TLine1")), + Diagram( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine1"), + Text(extent=[-30, 0; 31, -31], string="TLine1")), + Window( + x=0.45, + y=0.01, + width=0.51, + height=0.83)); + equation + + assert(Z0 > 0, "Z0 has to be positive"); + assert(TD > 0, "TD has to be positive"); + i1 = (v1 - es)/Z0; + i2 = (v2 - er)/Z0; + es = 2*delay(v2, TD) - delay(er, TD); + er = 2*delay(v1, TD) - delay(es, TD); + + end TLine1; + model TLine2 + "Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL" + + extends Modelica.Electrical.Analog.Interfaces.TwoPort; + + parameter Modelica.SIunits.Resistance Z0=1 "Characteristic impedance"; + parameter Modelica.SIunits.Frequency F=1 "Frequency"; + parameter Modelica.SIunits.Length NL=1 "Normalized length"; + + protected + Modelica.SIunits.Voltage er; + Modelica.SIunits.Voltage es; + Modelica.SIunits.Time TD; + annotation ( + Documentation(info=" + +Lossless transmission line with characteristic impedance Z0, frequency F and normalized length NL + + The lossless transmission line TLine2 is a two Port. Both port branches + consist of a resistor with the value of the characteristic impedance Z0 + and a controled voltage source that takes into consideration + the transmission delay. + For further details see Branin's article. + Resistance R' and conductance C' per meter are assumed to be zero. + The characteristic impedance Z0 can be derived from inductance and + capacitance per length (L' resp. C'), i. e. Z0 = sqrt(L'/C'). + The normalized length NL is equal to the length of the line divided + by the wavelength corresponding to the frequency F, i. e. the + transmission delay TD is the quotient of NL and F. + +References: + Branin Jr., F. H.: Transient Analysis of Lossless Transmission Lines. + Proceedings of the IEEE 55(1967), 2012 - 2013 + + Hoefer, E. E. E.; Nielinger, H.: SPICE : Analyseprogramm fuer elektronische + Schaltungen. Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1985. + + +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine2"), + Text(extent=[-30, 10; 30, -20], string="TLine2")), + Diagram( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine2")), + Window( + x=0.01, + y=0.03, + width=0.78, + height=0.89)); + equation + + assert(Z0 > 0, "Z0 has to be positive"); + assert(NL > 0, "NL has to be positive"); + assert(F > 0, "F has to be positive"); + TD = NL/F; + i1 = (v1 - es)/Z0; + i2 = (v2 - er)/Z0; + es = 2*delay(v2, TD) - delay(er, TD); + er = 2*delay(v1, TD) - delay(es, TD); + + end TLine2; + model TLine3 + "Lossless transmission line with characteristic impedance Z0 and frequency F" + + extends Modelica.Electrical.Analog.Interfaces.TwoPort; + + parameter Modelica.SIunits.Resistance Z0=1 "Natural impedance"; + parameter Modelica.SIunits.Frequency F=1 "Frequency"; + + protected + Modelica.SIunits.Voltage er; + Modelica.SIunits.Voltage es; + Modelica.SIunits.Time TD; + annotation ( + Documentation(info=" + +Lossless transmission line with characteristic impedance Z0 and frequency F + + The lossless transmission line TLine3 is a two Port. Both port branches + consist of a resistor with value of the characteristic impedance Z0 + and a controled voltage source that takes into consideration + the transmission delay. + For further details see Branin's article. + Resistance R' and conductance C' per meter are assumed to be zero. + The characteristic impedance Z0 can be derived from inductance and + capacitance per length (L' resp. C'), i. e. Z0 = sqrt(L'/C'). + The length of the line is equal to a quarter of the wavelength + corresponding to the frequency F, i. e. the + transmission delay is the quotient of 4 and F. + In this case, the caracteristic impedance is called natural impedance. + + References: + Branin Jr., F. H.: Transient Analysis of Lossless Transmission Lines. + Proceedings of the IEEE 55(1967), 2012 - 2013 + + Hoefer, E. E. E.; Nielinger, H.: SPICE : Analyseprogramm fuer elektronische + Schaltungen. Springer-Verlag, Berlin, Heidelberg, New York, Tokyo, 1985. + + +"), + Coordsys( + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), + Icon( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine3"), + Text(extent=[-29, -1; 30, -31], string="TLine3")), + Diagram( + Rectangle(extent=[-60, 60; 60, -60]), + Line(points=[60, -50; 90, -50]), + Line(points=[60, 50; 90, 50]), + Line(points=[-60, 50; -90, 50]), + Line(points=[-60, -50; -90, -50]), + Line(points=[30, 30; -30, 30]), + Line(points=[-30, 40; -30, 20]), + Line(points=[30, 40; 30, 20]), + Text(extent=[-100, 100; 100, 70], string="TLine3")), + Window( + x=0, + y=0, + width=0.7, + height=0.92)); + equation + + assert(Z0 > 0, "Z0 has to be positive"); + assert(F > 0, "F has to be positive"); + TD = 1/F/4; + i1 = (v1 - es)/Z0; + i2 = (v2 - er)/Z0; + es = 2*delay(v2, TD) - delay(er, TD); + er = 2*delay(v1, TD) - delay(es, TD); + + end TLine3; end Lines; diff --git a/Electrical/Analog/Semiconductors.mo b/Electrical/Analog/Semiconductors.mo index 1a21bd5add..980442a314 100644 --- a/Electrical/Analog/Semiconductors.mo +++ b/Electrical/Analog/Semiconductors.mo @@ -1,12 +1,8 @@ package Semiconductors extends Modelica.Icons.Library; - package SIunits = Modelica.SIunits; + import Modelica.SIunits; annotation ( - Coordsys( - extent=[0, 0; 400, 500], - grid=[1, 1], - component=[20, 20]), Window( x=0.03, y=0.04, @@ -20,8 +16,8 @@ package Semiconductors This package contains semiconductor devices:
  • diode
  • -
  • bipolar transistors
  • MOS transistors
  • +
  • bipolar transistors

@@ -47,7 +43,7 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright (C) 1998-1999, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package @@ -59,18 +55,18 @@ Modelica in file \"Modelica/package.mo\".
model Diode "Simple diode" extends Modelica.Electrical.Analog.Interfaces.OnePort; - parameter SIunits.Current Ids=1 "Saturation current"; - parameter SIunits.Voltage Vt=1 + parameter SIunits.Current Ids=1.e-6 "Saturation current"; + parameter SIunits.Voltage Vt=0.04 "Voltage equivalent of temperature (kT/qn)"; - parameter Real Maxexp(final min=Modelica.Constants.SMALL) = 1 + parameter Real Maxexp(final min=Modelica.Constants.SMALL) = 15 "Max. exponent for linear continuation"; - parameter SIunits.Resistance R=1 "Parallel ohmic resistance"; + parameter SIunits.Resistance R=1.e8 "Parallel ohmic resistance"; annotation ( Documentation(info="

-The simple diode is a two pole. It consists of the diode itself and an parallel ohmic -resistance R. The diode formula is simple: +The simple diode is a one port. It consists of the diode itself and an parallel ohmic +resistance R. The diode formula is:

 
                 v/vt
@@ -94,6 +90,10 @@ continued to avoid overflow.
         Line(points=[-90, 0; 40, 0]), 
         Line(points=[40, 0; 90, 0]), 
         Line(points=[30, 40; 30, -40], style(color=3)), 
+        Text(
+          extent=[-98, -58; 102, -100], 
+          string="Vt=%Vt", 
+          style(color=0)), 
         Text(extent=[-100, 100; 100, 70], string="%name")), 
       Diagram(
         Polygon(points=[30, 0; -30, 40; -30, -40; 30, 0], style(
@@ -110,11 +110,12 @@ continued to avoid overflow.
         width=0.75, 
         height=0.63));
   equation 
-    //assert (R <> 0, "R must not be zero");
-    i = if (v/Vt > Maxexp) then Ids*(exp(Maxexp)*(1 + v/Vt - Maxexp) - 1) + v/
-      R else Ids*(exp(v/Vt) - 1) + v/R;
+    i = if (v/Vt > Maxexp) then Ids*(exp(Maxexp)*(1 + v/Vt - Maxexp) - 1) + 
+      v/R else Ids*(exp(v/Vt) - 1) + v/R;
   end Diode;
   model PMOS "Simple MOS Transistor" 
+// 6.12.2001 parameter RDS added, Clauss    
+
     annotation (
       Documentation(info="
 
@@ -124,8 +125,8 @@ FET. It differs slightly from the device used in the SPICE simulator.
 For more details please care for H. Spiro.
 

-The model does not consider capacitances. A small fixed drain-source resistance -is included (to avoid numerical difficulties). +The model does not consider capacitances. A high drain-source resistance RDS +is included to avoid numerical difficulties.

References: @@ -136,16 +137,16 @@ is included (to avoid numerical difficulties). Some typical parameter sets are:

-  W       L      Beta      Vt       K2       K5       DW         DL    
-  m       m      A/V^2     V        -        -        m          m    
+  W       L      Beta        Vt       K2       K5       DW         DL    
+  m       m      A/V^2       V        -        -        m          m    
 
-  50.e-6  8.e-6  .0085     -.15     .41      .839    -3.8e-6    -4.0e-6           
-  20.e-6  6.e-6  .0105    -1.0      .41      .839    -2.5e-6    -2.1e-6 
-  30.e-6  5.e-6  .0059     -.3      .98     1.01      0         -3.9e-6   
-  30.e-6  5.e-6  .0152     -.69     .104    1.1       -.8e-6     -.4e-6         
-  30.e-6  5.e-6  .0163     -.69     .104    1.1       -.8e-6     -.4e-6         
-  30.e-6  5.e-6  .0182     -.69     .086    1.06      -.1e-6     -.6e-6         
-  20.e-6  6.e-6  .0074    -1.       .4       .59      0          0           
+  50.e-6  8.e-6  .0085e-3   -.15     .41      .839    -3.8e-6    -4.0e-6           
+  20.e-6  6.e-6  .0105e-3  -1.0      .41      .839    -2.5e-6    -2.1e-6 
+  30.e-6  5.e-6  .0059e-3   -.3      .98     1.01      0         -3.9e-6   
+  30.e-6  5.e-6  .0152e-3   -.69     .104    1.1       -.8e-6     -.4e-6         
+  30.e-6  5.e-6  .0163e-3   -.69     .104    1.1       -.8e-6     -.4e-6         
+  30.e-6  5.e-6  .0182e-3   -.69     .086    1.06      -.1e-6     -.6e-6         
+  20.e-6  6.e-6  .0074e-3  -1.       .4       .59      0          0           
 
"), @@ -187,15 +188,16 @@ Some typical parameter sets are: Interfaces.Pin S "Source" annotation (extent=[90, -40; 110, -60]); Interfaces.Pin B "Bulk" annotation (extent=[90, -10; 110, 10]); - parameter SIunits.Length W=50.0e-6 "Width"; - parameter SIunits.Length L=8.0e-6 "Length"; - parameter SIunits.Transconductance Beta=0.0085 + parameter SIunits.Length W=20.0e-6 "Width"; + parameter SIunits.Length L=6.0e-6 "Length"; + parameter SIunits.Transconductance Beta=0.0105e-3 "Transconductance parameter"; - parameter SIunits.Voltage Vt=-0.15 "Zero bias threshold voltage"; + parameter SIunits.Voltage Vt=-1.0 "Zero bias threshold voltage"; parameter Real K2=0.41 "Bulk threshold parameter"; parameter Real K5=0.839 "Reduction of pinch-off region"; - parameter SIunits.Length dW=-3.8e-6 "Narrowing of channel"; - parameter SIunits.Length dL=-4.0e-6 "Shortening of channel"; + parameter SIunits.Length dW=-2.5e-6 "Narrowing of channel"; + parameter SIunits.Length dL=-2.1e-6 "Shortening of channel"; + parameter SIunits.Resistance RDS=1.e+7 "Drain-Source-Resistance"; protected Real v; Real uds; @@ -204,24 +206,26 @@ Some typical parameter sets are: Real ud; Real us; Real id; + Real gds; equation //assert (L + dL > 0, "Effective length must be positive"); //assert (W + dW > 0, "Effective width must be positive"); + gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; v = Beta*(W + dW)/(L + dL); ud = if (D.v > S.v) then S.v else D.v; us = if (D.v > S.v) then D.v else S.v; uds = ud - us; ubs = if (B.v < us) then 0 else B.v - us; ugst = (G.v - us - Vt + K2*ubs)*K5; - id = if (ugst >= 0) then v*uds*1.e-7 else if (ugst < uds) then -v*uds*( - ugst - uds/2 - 1.e-7) else -v*(ugst*ugst/2 - uds*1.e-7); + id = if (ugst >= 0) then v*uds*gds else if (ugst < uds) then -v*uds*( + ugst - uds/2 - gds) else -v*(ugst*ugst/2 - uds*gds); G.i = 0; D.i = if (D.v > S.v) then -id else id; S.i = if (D.v > S.v) then id else -id; B.i = 0; end PMOS; model NMOS "Simple MOS Transistor" - +// 6.12.2001 parameter RDS added, Clauss annotation ( Documentation(info=" @@ -231,32 +235,32 @@ FET. It differs slightly from the device used in the SPICE simulator. For more details please care for H. Spiro.

-The model does not consider capacitances. A small fixed drain-source resistance -is included (to avoid numerical difficulties). +The model does not consider capacitances. A high drain-source resistance RDS +is included to avoid numerical difficulties.

-  W       L      Beta      Vt       K2       K5       DW         DL    
-  m       m      A/V^2     V        -        -        m          m    
+  W       L      Beta        Vt       K2      K5       DW         DL    
+  m       m      A/V^2       V        -       -        m          m    
 
-  12.e-6  4.e-6  .062     -4.5      .24      .61     -1.2e-6     -.9e-6         depletion
-  60.e-6  3.e-6  .048       .1      .08      .68     -1.2e-6     -.9e-6         enhancement
-  12.e-6  4.e-6  .0625     -.8      .21      .78     -1.2e-6     -.9e-6         zero
-  50.e-6  8.e-6  .0299      .24    1.144     .7311   -5.4e-6    -4.e-6          
-  20.e-6  6.e-6  .041       .8     1.144     .7311   -2.5e-6    -1.5e-6         
-  30.e-6  9.e-6  .025     -4.       .861     .878    -3.4e-6    -1.74e-6        
-  30.e-6  5.e-6  .031       .6     1.5       .72      0         -3.9e-6         
-  50.e-6  6.e-6  .0414    -3.8      .34      .8      -1.6e-6    -2.e-6          depletion
-  50.e-6  5.e-6  .03        .37     .23      .86     -1.6e-6    -2.e-6          enhancement
-  50.e-6  6.e-6  .038      -.9      .23      .707    -1.6e-6    -2.e-6          zero
-  20.e-6  4.e-6  .06776     .5409   .065     .71      -.8e-6     -.2e-6         
-  20.e-6  4.e-6  .06505     .6209   .065     .71      -.8e-6     -.2e-6         
-  20.e-6  4.e-6  .05365     .6909   .03      .8       -.3e-6     -.2e-6        
-  20.e-6  4.e-6  .05365     .4909   .03      .8       -.3e-6     -.2e-6        
-  12.e-6  4.e-6  .023     -4.5      .29      .6       0          0              depletion
-  60.e-6  3.e-6  .022       .1      .11      .65      0          0              enhancement
-  12.e-6  4.e-6  .038      -.8      .33      .6       0          0              zero
-  20.e-6  6.e-6  .022       .8     1         .66      0          0            
+  12.e-6  4.e-6  .062e-3   -4.5      .24     .61     -1.2e-6     -.9e-6      depletion
+  60.e-6  3.e-6  .048e-3     .1      .08     .68     -1.2e-6     -.9e-6      enhancement
+  12.e-6  4.e-6  .0625e-3   -.8      .21     .78     -1.2e-6     -.9e-6      zero
+  50.e-6  8.e-6  .0299e-3    .24    1.144    .7311   -5.4e-6    -4.e-6          
+  20.e-6  6.e-6  .041e-3     .8     1.144    .7311   -2.5e-6    -1.5e-6         
+  30.e-6  9.e-6  .025e-3   -4.       .861    .878    -3.4e-6    -1.74e-6        
+  30.e-6  5.e-6  .031e-3     .6     1.5      .72      0         -3.9e-6         
+  50.e-6  6.e-6  .0414e-3  -3.8      .34     .8      -1.6e-6    -2.e-6       depletion
+  50.e-6  5.e-6  .03e-3      .37     .23     .86     -1.6e-6    -2.e-6       enhancement
+  50.e-6  6.e-6  .038e-3    -.9      .23     .707    -1.6e-6    -2.e-6       zero
+  20.e-6  4.e-6  .06776e-3   .5409   .065    .71      -.8e-6     -.2e-6      
+  20.e-6  4.e-6  .06505e-3   .6209   .065    .71      -.8e-6     -.2e-6         
+  20.e-6  4.e-6  .05365e-3   .6909   .03     .8       -.3e-6     -.2e-6        
+  20.e-6  4.e-6  .05365e-3   .4909   .03     .8       -.3e-6     -.2e-6        
+  12.e-6  4.e-6  .023e-3   -4.5      .29     .6       0          0           depletion
+  60.e-6  3.e-6  .022e-3     .1      .11     .65      0          0           enhancement
+  12.e-6  4.e-6  .038e-3    -.8      .33     .6       0          0           zero
+  20.e-6  6.e-6  .022e-3     .8     1        .66      0          0            
 

@@ -297,15 +301,15 @@ Muenchen Wien 1990. Interfaces.Pin G "Gate" annotation (extent=[-90, -40; -110, -60]); Interfaces.Pin S "Source" annotation (extent=[90, -40; 110, -60]); Interfaces.Pin B "Bulk" annotation (extent=[90, -10; 110, 10]); - parameter SIunits.Length W "Width"; - parameter SIunits.Length L "Length"; - parameter SIunits.Transconductance Beta=2.e-5 - "Transconductance parameter"; - parameter SIunits.Voltage Vt=0 "Zero bias threshold voltage"; - parameter Real K2=0 "Bulk threshold parameter"; - parameter Real K5=1 "Reduction of pinch-off region"; - parameter SIunits.Length dW=0 "narrowing of channel"; - parameter SIunits.Length dL=0 "shortening of channel"; + parameter SIunits.Length W=20.e-6 "Width"; + parameter SIunits.Length L=6.e-6 "Length"; + parameter SIunits.Transconductance Beta=0.041e-3 "Transconductance parameter"; + parameter SIunits.Voltage Vt=0.8 "Zero bias threshold voltage"; + parameter Real K2=1.144 "Bulk threshold parameter"; + parameter Real K5=0.7311 "Reduction of pinch-off region"; + parameter SIunits.Length dW=-2.5e-6 "narrowing of channel"; + parameter SIunits.Length dL=-1.5e-6 "shortening of channel"; + parameter SIunits.Resistance RDS=1.e+7 "Drain-Source-Resistance"; protected Real v; Real uds; @@ -314,17 +318,19 @@ Muenchen Wien 1990. Real ud; Real us; Real id; + Real gds; equation //assert (L + dL > 0, "Effective length must be positive"); //assert (W + dW > 0, "Effective width must be positive"); + gds = if (RDS < 1.e-20 and RDS > -1.e-20) then 1.e20 else 1/RDS; v = Beta*(W + dW)/(L + dL); ud = if (D.v < S.v) then S.v else D.v; us = if (D.v < S.v) then D.v else S.v; uds = ud - us; ubs = if (B.v > us) then 0 else B.v - us; ugst = (G.v - us - Vt + K2*ubs)*K5; - id = if (ugst <= 0) then v*uds*1.e-7 else if (ugst > uds) then v*uds*(ugst - - uds/2 + 1.e-7) else v*(ugst*ugst/2 + uds*1.e-7); + id = if (ugst <= 0) then v*uds*gds else if (ugst > uds) then v*uds*(ugst + - uds/2 + gds) else v*(ugst*ugst/2 + uds*gds); G.i = 0; D.i = if (D.v < S.v) then -id else id; S.i = if (D.v < S.v) then id else -id; @@ -334,23 +340,19 @@ Muenchen Wien 1990. model NPN "Simple BJT according to Ebers-Moll" parameter Real Bf=50 "Forward beta"; parameter Real Br=0.1 "Reverse beta"; - parameter SIunits.Current Is=1.e-16 - "Transport saturation current"; - parameter SIunits.InversePotential Vak=0.02 + parameter SIunits.Current Is=1.e-16 "Transport saturation current"; + parameter SIunits.InversePotential Vak=0.02 "Early voltage (inverse), 1/Volt"; parameter SIunits.Time Tauf=0.12e-9 "Ideal forward transit time"; parameter SIunits.Time Taur=5e-9 "Ideal reverse transit time"; - parameter SIunits.Capacitance Ccs=1e-12 - "Collector-substrat(ground) cap."; - parameter SIunits.Capacitance Cje=0.4e-12 + parameter SIunits.Capacitance Ccs=1e-12 "Collector-substrat(ground) cap."; + parameter SIunits.Capacitance Cje=0.4e-12 "Base-emitter zero bias depletion cap."; parameter SIunits.Capacitance Cjc=0.5e-12 "Base-coll. zero bias depletion cap."; - parameter SIunits.Voltage Phie=0.8 - "Base-emitter diffusion voltage"; + parameter SIunits.Voltage Phie=0.8 "Base-emitter diffusion voltage"; parameter Real Me=0.4 "Base-emitter gradation exponent"; - parameter SIunits.Voltage Phic=0.8 - "Base-collector diffusion voltage"; + parameter SIunits.Voltage Phic=0.8 "Base-collector diffusion voltage"; parameter Real Mc=0.333 "Base-collector gradation exponent"; parameter SIunits.Conductance Gbc=1e-15 "Base-collector conductance"; parameter SIunits.Conductance Gbe=1e-15 "Base-emitter conductance"; @@ -369,6 +371,13 @@ Muenchen Wien 1990. Real ExMax; Real Capcje; Real Capcjc; + function pow "Just a helper function for x^y" + input Real x; + input Real y; + output Real z; + algorithm + z:=x^y; + end pow; annotation ( Documentation(info=" @@ -393,12 +402,6 @@ Van Nostrand Reinhold, New York 1983 on page 317 ff.

-

-
Note: -
This model is not validated yet. It cannot be used with Dymola 4.0b because of -stability problems within the solver. -
-

"), Coordsys( @@ -442,17 +445,17 @@ stability problems within the solver. vbc = B.v - C.v; vbe = B.v - E.v; qbk = 1 - vbc*Vak; - - ibc = if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc* - Gbc else if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc - *Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc; - ibe = if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe* - Gbe else if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe - *Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe; - Capcjc = if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - - vbc/Phic, -Mc); - Capcje = if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - - vbe/Phie, -Me); + + ibc = if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc + else if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc* + Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc; + ibe = if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe + else if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe* + Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe; + Capcjc = if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc + /Phic, -Mc); + Capcje = if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe + /Phie, -Me); cbc = if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + Capcjc else if (vbc/Vt > EMax) then Taur*Is/Vt*ExMax*(vbc/Vt - EMax + 1) + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc; @@ -467,23 +470,19 @@ stability problems within the solver. model PNP "Simple BJT according to Ebers-Moll" parameter Real Bf=50 "Forward beta"; parameter Real Br=0.1 "Reverse beta"; - parameter SIunits.Current Is=1.e-16 - "Transport saturation current"; - parameter SIunits.InversePotential Vak=0.02 + parameter SIunits.Current Is=1.e-16 "Transport saturation current"; + parameter SIunits.InversePotential Vak=0.02 "Early voltage (inverse), 1/Volt"; parameter SIunits.Time Tauf=0.12e-9 "Ideal forward transit time"; parameter SIunits.Time Taur=5e-9 "Ideal reverse transit time"; - parameter SIunits.Capacitance Ccs=1e-12 - "Collector-substrat(ground) cap."; - parameter SIunits.Capacitance Cje=0.4e-12 + parameter SIunits.Capacitance Ccs=1e-12 "Collector-substrat(ground) cap."; + parameter SIunits.Capacitance Cje=0.4e-12 "Base-emitter zero bias depletion cap."; parameter SIunits.Capacitance Cjc=0.5e-12 "Base-coll. zero bias depletion cap."; - parameter SIunits.Voltage Phie=0.8 - "Base-emitter diffusion voltage"; + parameter SIunits.Voltage Phie=0.8 "Base-emitter diffusion voltage"; parameter Real Me=0.4 "Base-emitter gradation exponent"; - parameter SIunits.Voltage Phic=0.8 - "Base-collector diffusion voltage"; + parameter SIunits.Voltage Phic=0.8 "Base-collector diffusion voltage"; parameter Real Mc=0.333 "Base-collector gradation exponent"; parameter SIunits.Conductance Gbc=1e-15 "Base-collector conductance"; parameter SIunits.Conductance Gbe=1e-15 "Base-emitter conductance"; @@ -502,6 +501,13 @@ stability problems within the solver. Real ExMax; Real Capcje; Real Capcjc; + function pow "Just a helper function for x^y" + input Real x; + input Real y; + output Real z; + algorithm + z:=x^y; + end pow; annotation ( Documentation(info=" @@ -525,12 +531,6 @@ Van Nostrand Reinhold, New York 1983 on page 317 ff.

-

-
Note: -
This model is not validated yet. It cannot be used with Dymola 4.0b because of -stability problems within the solver. -
-

"), Coordsys( @@ -569,27 +569,28 @@ stability problems within the solver. vbc = C.v - B.v; vbe = E.v - B.v; qbk = 1 - vbc*Vak; - - ibc = if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc* - Gbc else if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc - *Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc; - ibe = if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe* - Gbe else if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe - *Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe; + ibc = if (vbc/Vt < EMin) then Is*(ExMin*(vbc/Vt - EMin + 1) - 1) + vbc*Gbc + else if (vbc/Vt > EMax) then Is*(ExMax*(vbc/Vt - EMax + 1) - 1) + vbc* + Gbc else Is*(exp(vbc/Vt) - 1) + vbc*Gbc; + + ibe = if (vbe/Vt < EMin) then Is*(ExMin*(vbe/Vt - EMin + 1) - 1) + vbe*Gbe + else if (vbe/Vt > EMax) then Is*(ExMax*(vbe/Vt - EMax + 1) - 1) + vbe* + Gbe else Is*(exp(vbe/Vt) - 1) + vbe*Gbe; - Capcjc = if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - - vbc/Phic, -Mc); - Capcje = if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - - vbe/Phie, -Me); + Capcjc = if (vbc/Phic > 0) then Cjc*(1 + Mc*vbc/Phic) else Cjc*pow(1 - vbc + /Phic, -Mc); + Capcje = if (vbe/Phie > 0) then Cje*(1 + Me*vbe/Phie) else Cje*pow(1 - vbe + /Phie, -Me); cbc = if (vbc/Vt < EMin) then Taur*Is/Vt*ExMin*(vbc/Vt - EMin + 1) + Capcjc else if (vbc/Vt > EMax) then Taur*Is/Vt*ExMax*(vbc/Vt - EMax + 1) + Capcjc else Taur*Is/Vt*exp(vbc/Vt) + Capcjc; cbe = if (vbe/Vt < EMin) then Tauf*Is/Vt*ExMin*(vbe/Vt - EMin + 1) + Capcje else if (vbe/Vt > EMax) then Tauf*Is/Vt*ExMax*(vbe/Vt - EMax + 1) + Capcje else Tauf*Is/Vt*exp(vbe/Vt) + Capcje; - C.i = -((ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) + Ccs*der(C.v)); + C.i = -((ibe - ibc)*qbk - ibc/Br - cbc*der(vbc) - Ccs*der(C.v)); B.i = -(ibe/Bf + ibc/Br + cbe*der(vbe) + cbc*der(vbc)); - E.i = -B.i - C.i - Ccs*der(C.v); + E.i = -B.i - C.i + Ccs*der(C.v); end PNP; end Semiconductors; + diff --git a/Electrical/Analog/Sensors.mo b/Electrical/Analog/Sensors.mo index 8b3199b9ac..16bbcbff3d 100644 --- a/Electrical/Analog/Sensors.mo +++ b/Electrical/Analog/Sensors.mo @@ -1,12 +1,8 @@ -package Sensors +package Sensors + extends Modelica.Icons.Library; - package SIunits = Modelica.SIunits ; - + annotation ( - Coordsys( - extent=[0, 0; 400, 500], - grid=[1, 1], - component=[20, 20]), Window( x=0.03, y=0.04, @@ -14,8 +10,7 @@ package Sensors height=0.24, library=1, autolayout=1), - Documentation(info=" - + Documentation(info="

This package contains potential, voltage, and current sensors.

@@ -24,9 +19,9 @@ This package contains potential, voltage, and current sensors.
Main Authors:
-Christoph Clauß +Christoph Clauß <clauss@eas.iis.fhg.de>
- André Schneider + André Schneider <schneider@eas.iis.fhg.de>
Fraunhofer Institute for Integrated Circuits
Design Automation Department
@@ -42,86 +37,85 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright © 1998-2002, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions -and the accompanying disclaimer in the documentation of package +and the accompanying disclaimer in the documentation of package Modelica in file \"Modelica/package.mo\".

")); - - model PotentialSensor "Sensor to measure the potential" - extends Modelica.Electrical.Analog.Interfaces.AbsoluteSensor; - SIunits.ElectricPotential phi "Absolute voltage potential"; + + model PotentialSensor "Sensor to measure the potential" + extends Interfaces.AbsoluteSensor; + SI.ElectricPotential phi "Absolute voltage potential"; annotation ( - Diagram, Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon(Text( - extent=[-29, -11; 30, -70], - string="V", - style(color=0))), + extent=[-29, -11; 30, -70], + string="V", + style(color=0))), Window( - x=0.4, - y=0.32, - width=0.6, + x=0.4, + y=0.32, + width=0.6, height=0.6)); - equation + equation p.i = 0; phi = p.v; phi = outPort.signal[1]; end PotentialSensor; - - model VoltageSensor "Sensor to measure the voltage between two pins" - extends Modelica.Electrical.Analog.Interfaces.RelativeSensor; - SIunits.Voltage v "Voltage between pin p and n (= p.v - n.v)"; + + model VoltageSensor "Sensor to measure the voltage between two pins" + extends Interfaces.RelativeSensor; + SI.Voltage v "Voltage between pin p and n (= p.v - n.v)"; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.28, - y=0.29, - width=0.6, - height=0.6), + x=0.28, + y=0.29, + width=0.6, + height=0.6), Icon(Text( - extent=[-29, -11; 30, -70], - string="V", + extent=[-29, -11; 30, -70], + string="V", style(color=0)))); - equation + equation p.i = 0; n.i = 0; v = p.v - n.v; v = outPort.signal[1]; end VoltageSensor; - - model CurrentSensor "Sensor to measure the current in a branch" - extends Modelica.Electrical.Analog.Interfaces.RelativeSensor; - SIunits.Current i "current in the branch from p to n"; + + model CurrentSensor "Sensor to measure the current in a branch" + extends Interfaces.RelativeSensor; + SI.Current i "current in the branch from p to n"; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.23, - y=0.07, - width=0.6, - height=0.6), + x=0.23, + y=0.07, + width=0.6, + height=0.6), Icon(Text( - extent=[-29, -11; 30, -70], - string="A", + extent=[-29, -11; 30, -70], + string="A", style(color=0)))); - equation + equation p.v = n.v; p.i = i; n.i = -i; i = outPort.signal[1]; end CurrentSensor; - + end Sensors; diff --git a/Electrical/Analog/Sources.mo b/Electrical/Analog/Sources.mo index e88583045b..3d509a0d79 100644 --- a/Electrical/Analog/Sources.mo +++ b/Electrical/Analog/Sources.mo @@ -1,19 +1,15 @@ -package Sources +package Sources + extends Modelica.Icons.Library; + annotation ( - Coordsys( - extent=[0, 0; 400, 500], - grid=[1, 1], - component=[20, 20]), Window( x=0.03, y=0.04, width=0.50, height=0.60, library=1, - autolayout=1), - Documentation(info=" - + autolayout=1),Documentation(info="

This package contains time-dependend and controlled voltage and current sources.

@@ -22,9 +18,9 @@ This package contains time-dependend and controlled voltage and current sources.
Main Authors:
-Christoph Clauß +Christoph Clauß <clauss@eas.iis.fhg.de>
- André Schneider + André Schneider <schneider@eas.iis.fhg.de>
Fraunhofer Institute for Integrated Circuits
Design Automation Department
@@ -40,1015 +36,996 @@ $Id$
Copyright:
-Copyright (C) 1998-1999, Modelica Design Group and Fraunhofer-Gesellschaft.
+Copyright © 1998-2002, Modelica Association and Fraunhofer-Gesellschaft.
The Modelica package is free software; it can be redistributed and/or modified under the terms of the Modelica license, see the license conditions -and the accompanying disclaimer in the documentation of package +and the accompanying disclaimer in the documentation of package Modelica in file \"Modelica/package.mo\".

")); - - model SignalVoltage - "Generic voltage source using the input signal as source voltage" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - + + model SignalVoltage + "Generic voltage source using the input signal as source voltage" + extends Interfaces.OnePort; + annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Ellipse(extent=[-50, 50; 50, -50], style(fillColor=7)), - Line(points=[-90, 0; -50, 0]), - Line(points=[50, 0; 90, 0]), - Line(points=[-50, 0; 50, 0]), - Text(extent=[-100, -120; 100, -80], string="%name")), + Ellipse(extent=[-50, 50; 50, -50], style(fillColor=7)), + Line(points=[-90, 0; -50, 0]), + Line(points=[50, 0; 90, 0]), + Line(points=[-50, 0; 50, 0]), + Text(extent=[-100, -120; 100, -80], string="%name")), Window( - x=0.36, - y=0.03, - width=0.62, + x=0.36, + y=0.03, + width=0.62, height=0.76)); - Modelica.Blocks.Interfaces.InPort inPort(final n=1) annotation (extent=[- - 20, 50; 20, 90], rotation=-90); - equation + Modelica.Blocks.Interfaces.InPort inPort(final n=1) annotation (extent=[-20, 50; 20, 90], rotation + =-90); + equation inPort.signal[1] = v; end SignalVoltage; - - model ConstantVoltage "Source for constant voltage" - parameter Modelica.SIunits.Voltage V=1 "Value of constant voltage"; - extends Modelica.Electrical.Analog.Interfaces.OnePort; + + model ConstantVoltage "Source for constant voltage" + parameter SI.Voltage V=1 "Value of constant voltage"; + extends Interfaces.OnePort; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.33, - y=0.18, - width=0.6, - height=0.6), + x=0.33, + y=0.18, + width=0.6, + height=0.6), Icon( - Line(points=[-90, 0; -10, 0]), - Line(points=[-10, 60; -10, -60]), - Line(points=[0, 30; 0, -30]), - Line(points=[0, 0; 90, 0]), - Text(extent=[-100, -120; 100, -80], string="%name=%V")), + Line(points=[-90, 0; -10, 0]), + Line(points=[-10, 60; -10, -60]), + Line(points=[0, 30; 0, -30]), + Line(points=[0, 0; 90, 0]), + Text(extent=[-100, -120; 100, -80], string="%name=%V")), Diagram( - Line(points=[-90, 0; -10, 0]), - Line(points=[-10, 60; -10, -60]), - Line(points=[0, 30; 0, -30]), + Line(points=[-90, 0; -10, 0]), + Line(points=[-10, 60; -10, -60]), + Line(points=[0, 30; 0, -30]), Line(points=[0, 0; 90, 0]))); - equation + equation v = V; end ConstantVoltage; - - model StepVoltage "Step voltage source" - parameter Modelica.SIunits.Voltage V=1 "Height of step"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Step signalSource(height={V})); + + model StepVoltage "Step voltage source" + parameter SI.Voltage V=1 "Height of step"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Step signalSource(height={V} + )); annotation ( - Icon(Line(points=[-70, -70; 0, -70; 0, 70; 69, 70], style(color=8))), + Icon(Line(points=[-70, -70; 0, -70; 0, 70; 69, 70], style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-80, -18; 0, -18; 0, 50; 80, 50], style(color=0, - thickness=2)), - Line(points=[-90, -70; 82, -70], style(color=8)), - Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style(color=8, - fillColor=8)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Text( - extent=[-21, -72; 25, -90], - string="startTime", - style(color=9)), - Line(points=[0, -17; 0, -71], style(color=8, pattern=2)), - Text( - extent=[-68, -36; -22, -54], - string="offset", - style(color=9)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-80, -18; 0, -18; 0, 50; 80, 50], style(color=0, thickness + =2)), + Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style(color=8, + fillColor=8)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Text( + extent=[-21, -72; 25, -90], + string="startTime", + style(color=9)), + Line(points=[0, -17; 0, -71], style(color=8, pattern=2)), + Text( + extent=[-68, -36; -22, -54], + string="offset", + style(color=9)), Line(points=[-13, 50; -13, -17], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[2, 50; -19, 50; 2, 50], style(color=8, pattern=2)), - Polygon(points=[-13, -17; -16, -4; -10, -4; -13, -17; -13, -17], style - ( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[2, 50; -19, 50; 2, 50], style(color=8, pattern=2)), + Polygon(points=[-13, -17; -16, -4; -10, -4; -13, -17; -13, -17], style( + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-13, 50; -16, 37; -9, 37; -13, 50], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-68, 26; -22, 8], - string="V", - style(color=9)), - Polygon(points=[-13, -69; -16, -56; -10, -56; -13, -69; -13, -69], + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-68, 26; -22, 8], + string="V", + style(color=9)), + Polygon(points=[-13, -69; -16, -56; -10, -56; -13, -69; -13, -69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-13, -18; -13, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[-13, -18; -16, -31; -9, -31; -13, -18], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-67, 93; -2, 67], - string="v = p.v - n.v", - style(color=9))), + extent=[-67, 93; -2, 67], + string="v = p.v - n.v", + style(color=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.28, - y=0, - width=0.72, + x=0.28, + y=0, + width=0.72, height=0.73)); end StepVoltage; - - model RampVoltage "Ramp voltage source" - parameter Modelica.SIunits.Voltage V=1 "Height of ramp"; - parameter Modelica.SIunits.Time duration(min=Modelica.Constants.SMALL) = 2 - "Duration of ramp"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Ramp signalSource(final height={V}, final - duration={duration})); + + model RampVoltage "Ramp voltage source" + parameter SI.Voltage V=1 "Height of ramp"; + parameter SI.Time duration(min=Modelica.Constants.small) = 2 "Duration of ramp"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Ramp signalSource(final + height={V}, final duration={duration})); annotation ( Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), Line(points=[-80, -20; -20, -20; 50, 50], style(color=0, thickness=2)) - , - Line(points=[-90, -70; 82, -70], style(color=8)), + , + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-40, -20; -42, -30; -37, -30; -40, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -20; -40, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-80, -33; -41, -49], - string="offset", - style(color=9)), - Text( - extent=[-40, -70; 6, -88], - string="startTime", - style(color=9)), - Text( - extent=[-67, 93; -2, 67], - string="v = p.v - n.v", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-80, -33; -41, -49], + string="offset", + style(color=9)), + Text( + extent=[-40, -70; 6, -88], + string="startTime", + style(color=9)), + Text( + extent=[-67, 93; -2, 67], + string="v = p.v - n.v", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), Line(points=[-19, -20; 50, -20], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Line(points=[50, 50; 101, 50], style(color=0, thickness=2)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Line(points=[50, 50; 101, 50], style(color=0, thickness=2)), Line(points=[50, 50; 50, -20], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[50, -20; 42, -18; 42, -22; 50, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-20, -20; -11, -18; -11, -22; -20, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[50, 50; 48, 40; 53, 40; 50, 50], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[50, -20; 47, -10; 52, -10; 50, -20; 50, -20], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[53, 25; 82, 7], - string="V", - style(color=9)), - Text( - extent=[0, -17; 35, -37], - string="duration", - style(color=9))), - Icon(Line(points=[-80, -60; -50, -60; 50, 60; 80, 60], style(color=8))) - , + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[53, 25; 82, 7], + string="V", + style(color=9)), + Text( + extent=[0, -17; 35, -37], + string="duration", + style(color=9))), + Icon(Line(points=[-80, -60; -50, -60; 50, 60; 80, 60], style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.29, - y=0.11, - width=0.6, + x=0.29, + y=0.11, + width=0.6, height=0.6)); end RampVoltage; - - model SineVoltage "Sine voltage source" - parameter Modelica.SIunits.Voltage V=1 "Amplitude of sine wave"; - parameter Modelica.SIunits.Angle phase=0 "Phase of sine wave"; - parameter Modelica.SIunits.Frequency freqHz=1 "Frequency of sine wave"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Sine signalSource( - amplitude={V}, - freqHz={freqHz}, - phase={phase}, - offset={offset}, - startTime={startTime})); + + model SineVoltage "Sine voltage source" + parameter SI.Voltage V=1 "Amplitude of sine wave"; + parameter SI.Angle phase=0 "Phase of sine wave"; + parameter SI.Frequency freqHz=1 "Frequency of sine wave"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Sine signalSource( + amplitude={V}, + freqHz={freqHz}, + phase={phase})); annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.37, - y=0.06, - width=0.6, - height=0.6), - Icon(Line(points=[-70, 0; -60.2, 29.9; -53.8, 46.5; -48.2, 58.1; -43.3, - 65.2; -38.3, 69.2; -33.4, 69.8; -28.5, 67; -23.6, 61; -18.6, 52; + x=0.37, + y=0.06, + width=0.6, + height=0.6), + Icon(Line(points=[-70, 0; -60.2, 29.9; -53.8, 46.5; -48.2, 58.1; -43.3, + 65.2; -38.3, 69.2; -33.4, 69.8; -28.5, 67; -23.6, 61; -18.6, 52; -13, 38.6; -5.98, 18.6; 8.79, -26.9; 15.1, -44; 20.8, -56.2; 25.7 , -64; 30.6, -68.6; 35.5, -70; 40.5, -67.9; 45.4, -62.5; 50.3, - - 54.1; 55.9, -41.3; 63, -21.7; 70, 0], style(color=8))), + 54.1; 55.9, -41.3; 63, -21.7; 70, 0], style(color=8))), Diagram( - Line(points=[-80, -90; -80, 84], style(color=8)), - Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, - fillColor=8)), - Line(points=[-99, -40; 85, -40], style(color=8)), - Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, - fillColor=8)), - Line(points=[-40, 0; -31.6, 34.2; -26.1, 53.1; -21.3, 66.4; -17.1, - 74.6; -12.9, 79.1; -8.64, 79.8; -4.42, 76.6; -0.201, 69.7; 4.02, - 59.4; 8.84, 44.1; 14.9, 21.2; 27.5, -30.8; 33, -50.2; 37.8, -64.2 - ; 42, -73.1; 46.2, -78.4; 50.5, -80; 54.7, -77.6; 58.9, -71.5; - 63.1, -61.9; 67.9, -47.2; 74, -24.8; 80, 0], style(color=0, - thickness=2)), - Line(points=[-41, -2; -80, -2], style(color=0, thickness=2)), - Text( - extent=[-106, -11; -60, -29], - string="offset", - style(color=9)), - Line(points=[-41, -2; -41, -40], style(color=8, pattern=2)), - Text( - extent=[-60, -43; -14, -61], - string="startTime", - style(color=9)), - Text( - extent=[84, -52; 108, -72], - string="time", - style(color=9)), - Line(points=[-9, 79; 43, 79], style(color=8, pattern=2)), - Line(points=[-42, -1; 50, 0], style(color=8, pattern=2)), + Line(points=[-80, -90; -80, 84], style(color=8)), + Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, + fillColor=8)), + Line(points=[-99, -40; 85, -40], style(color=8)), + Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, + fillColor=8)), + Line(points=[-40, 0; -31.6, 34.2; -26.1, 53.1; -21.3, 66.4; -17.1, 74.6 + ; -12.9, 79.1; -8.64, 79.8; -4.42, 76.6; -0.201, 69.7; 4.02, 59.4 + ; 8.84, 44.1; 14.9, 21.2; 27.5, -30.8; 33, -50.2; 37.8, -64.2; 42 + , -73.1; 46.2, -78.4; 50.5, -80; 54.7, -77.6; 58.9, -71.5; 63.1, + -61.9; 67.9, -47.2; 74, -24.8; 80, 0], style(color=0, thickness=2 + )), + Line(points=[-41, -2; -80, -2], style(color=0, thickness=2)), + Text( + extent=[-106, -11; -60, -29], + string="offset", + style(color=9)), + Line(points=[-41, -2; -41, -40], style(color=8, pattern=2)), + Text( + extent=[-60, -43; -14, -61], + string="startTime", + style(color=9)), + Text( + extent=[84, -52; 108, -72], + string="time", + style(color=9)), + Line(points=[-9, 79; 43, 79], style(color=8, pattern=2)), + Line(points=[-42, -1; 50, 0], style(color=8, pattern=2)), Polygon(points=[33, 80; 30, 67; 37, 67; 33, 80], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[37, 57; 83, 39], - string="V", - style(color=9)), + extent=[37, 57; 83, 39], + string="V", + style(color=9)), Polygon(points=[33, 1; 30, 14; 36, 14; 33, 1; 33, 1], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[33, 79; 33, 0], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Text( - extent=[-69, 109; -4, 83], - string="v = p.v - n.v", + extent=[-69, 109; -4, 83], + string="v = p.v - n.v", style(color=9)))); end SineVoltage; - - model ExpSineVoltage "Exponentially damped sine voltage source" - parameter Modelica.SIunits.Voltage V=1 "Amplitude of sine wave"; - parameter Modelica.SIunits.Frequency freqHz=2 "Frequency of sine wave"; - parameter Modelica.SIunits.Angle phase=0 "Phase of sine wave"; - parameter Modelica.SIunits.Damping damping=1 - "Damping coefficient of sine wave"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.ExpSine signalSource( - amplitude={V}, - freqHz={freqHz}, - phase={phase}, - damping={damping}, - offset={offset}, - startTime={startTime})); + + model ExpSineVoltage "Exponentially damped sine voltage source" + parameter SI.Voltage V=1 "Amplitude of sine wave"; + parameter SI.Frequency freqHz=2 "Frequency of sine wave"; + parameter SI.Angle phase=0 "Phase of sine wave"; + parameter SI.Damping damping=1 "Damping coefficient of sine wave"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.ExpSine signalSource( + amplitude={V}, + freqHz={freqHz}, + phase={phase}, + damping={damping})); annotation ( - Icon(Line(points=[-80, -14; -75.2, 18.3; -72, 36.3; -68.7, 50.5; -65.5, - 60.2; -62.3, 65.3; -59.1, 65.6; -55.9, 61.3; -52.7, 53.1; -48.6, + Icon(Line(points=[-80, -14; -75.2, 18.3; -72, 36.3; -68.7, 50.5; -65.5, + 60.2; -62.3, 65.3; -59.1, 65.6; -55.9, 61.3; -52.7, 53.1; -48.6, 38.2; -43, 11.8; -35, -27.9; -30.2, -47.7; -26.1, -59.9; -22.1, - - 67.2; -18.1, -69.3; -14.1, -66.5; -10.1, -59.3; -5.23, -46.1; - 8.44, -0.3; 13.3, 12.4; 18.1, 20.8; 22.1, 24; 26.9, 23.2; 31.8, + 67.2; -18.1, -69.3; -14.1, -66.5; -10.1, -59.3; -5.23, -46.1; + 8.44, -0.3; 13.3, 12.4; 18.1, 20.8; 22.1, 24; 26.9, 23.2; 31.8, 17.8; 38.2, 5.4; 51.1, -24.5; 57.5, -35.2; 63.1, -39.9; 68.7, - - 39.9; 75.2, -34.5; 80, -27.8], style(color=8))), + 39.9; 75.2, -34.5; 80, -27.8], style(color=8))), Diagram( - Line(points=[-80, -90; -80, 84], style(color=8)), - Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, - fillColor=8)), - Line(points=[-99, -40; 85, -40], style(color=8)), - Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, - fillColor=8)), - Line(points=[-50, 0; -46.1, 28.2; -43.5, 44; -40.9, 56.4; -38.2, 64.9 - ; -35.6, 69.4; -33, 69.6; -30.4, 65.9; -27.8, 58.7; -24.5, 45.7; - -19.9, 22.5; -13.4, -12.2; -9.5, -29.5; -6.23, -40.1; -2.96, - - 46.5; 0.302, -48.4; 3.57, -45.9; 6.83, -39.6; 10.8, -28.1; 21.9, - 12; 25.8, 23.1; 29.7, 30.5; 33, 33.3; 36.9, 32.5; 40.8, 27.8; 46 - , 16.9; 56.5, -9.2; 61.7, -18.6; 66.3, -22.7; 70.9, -22.6; 76.1, - -18; 80, -12.1], style(color=0, thickness=2)), - Text( - extent=[-78, 1; -55, -19], - string="offset", - style(color=9)), - Text( - extent=[-72, -36; -26, -54], - string="startTime", - style(color=9)), - Text( - extent=[84, -52; 108, -72], - string="time", - style(color=9)), - Line(points=[-50, 0; 18, 0], style(color=8, pattern=2)), - Line(points=[-50, 0; -81, 0], style(color=0, thickness=2)), - Line(points=[-50, 77; -50, 0], style(color=8, pattern=2)), - Line(points=[18, -1; 18, 76], style(color=8, pattern=2)), - Line(points=[18, 73; -50, 73], style(color=8)), - Text( - extent=[-42, 88; 9, 74], - string="1/freqHz", - style(color=9)), + Line(points=[-80, -90; -80, 84], style(color=8)), + Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, + fillColor=8)), + Line(points=[-99, -40; 85, -40], style(color=8)), + Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, + fillColor=8)), + Line(points=[-50, 0; -46.1, 28.2; -43.5, 44; -40.9, 56.4; -38.2, 64.9; + -35.6, 69.4; -33, 69.6; -30.4, 65.9; -27.8, 58.7; -24.5, 45.7; - + 19.9, 22.5; -13.4, -12.2; -9.5, -29.5; -6.23, -40.1; -2.96, -46.5 + ; 0.302, -48.4; 3.57, -45.9; 6.83, -39.6; 10.8, -28.1; 21.9, 12; + 25.8, 23.1; 29.7, 30.5; 33, 33.3; 36.9, 32.5; 40.8, 27.8; 46, + 16.9; 56.5, -9.2; 61.7, -18.6; 66.3, -22.7; 70.9, -22.6; 76.1, - + 18; 80, -12.1], style(color=0, thickness=2)), + Text( + extent=[-78, 1; -55, -19], + string="offset", + style(color=9)), + Text( + extent=[-72, -36; -26, -54], + string="startTime", + style(color=9)), + Text( + extent=[84, -52; 108, -72], + string="time", + style(color=9)), + Line(points=[-50, 0; 18, 0], style(color=8, pattern=2)), + Line(points=[-50, 0; -81, 0], style(color=0, thickness=2)), + Line(points=[-50, 77; -50, 0], style(color=8, pattern=2)), + Line(points=[18, -1; 18, 76], style(color=8, pattern=2)), + Line(points=[18, 73; -50, 73], style(color=8)), + Text( + extent=[-42, 88; 9, 74], + string="1/freqHz", + style(color=9)), Polygon(points=[-49, 73; -40, 75; -40, 71; -49, 73], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[18, 73; 10, 75; 10, 71; 18, 73], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-50, -61; -19, -61], style(color=8)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-50, -61; -19, -61], style(color=8)), Polygon(points=[-18, -61; -26, -59; -26, -63; -18, -61], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-51, -63; -27, -75], - string="t", - style(color=9)), - Text( - extent=[-82, -67; 108, -96], - string="V*exp(-damping*t)*sin(2*pi*freqHz*t+phase)", - style(color=9)), - Line(points=[-50, 0; -50, -40], style(color=8, pattern=2)), - Line(points=[-50, -54; -50, -72], style(color=8, pattern=2)), - Line(points=[18, -76; -1, -48], style(color=8, pattern=2)), - Text( - extent=[-77, 105; -38, 92], - string="v = p.v - n.v", - style(color=9))), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-51, -63; -27, -75], + string="t", + style(color=9)), + Text( + extent=[-82, -67; 108, -96], + string="V*exp(-damping*t)*sin(2*pi*freqHz*t+phase)", + style(color=9)), + Line(points=[-50, 0; -50, -40], style(color=8, pattern=2)), + Line(points=[-50, -54; -50, -72], style(color=8, pattern=2)), + Line(points=[18, -76; -1, -48], style(color=8, pattern=2)), + Text( + extent=[-77, 105; -38, 92], + string="v = p.v - n.v", + style(color=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.33, - y=0.06, - width=0.6, + x=0.33, + y=0.06, + width=0.6, height=0.75)); end ExpSineVoltage; - - model ExponentialsVoltage " Rising and falling exponential voltage source" + + model ExponentialsVoltage " Rising and falling exponential voltage source" parameter Real vMax=1 "Upper bound for rising edge"; - parameter Modelica.SIunits.Time riseTime(min=0) = 0.5 "Rise time"; - parameter Modelica.SIunits.Time riseTimeConst(min=Modelica.Constants.SMALL - ) = 0.1 "Rise time constant"; - parameter Modelica.SIunits.Time fallTimeConst(min=Modelica.Constants.SMALL - ) = riseTimeConst "Fall time constant"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Exponentials signalSource( - outMax={vMax}, - riseTime={riseTime}, - riseTimeConst={riseTimeConst}, + parameter SI.Time riseTime(min=0) = 0.5 "Rise time"; + parameter SI.Time riseTimeConst(min=Modelica.Constants.small) = 0.1 + "Rise time constant"; + parameter SI.Time fallTimeConst(min=Modelica.Constants.small) = riseTimeConst + "Fall time constant"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Exponentials signalSource( + outMax={vMax}, + riseTime={riseTime}, + riseTimeConst={riseTimeConst}, fallTimeConst={fallTimeConst})); annotation ( Icon(Line(points=[-76, -59; -73.2, -44.3; -70.3, -31.1; -66.8, -16.6; - 63.3, -4; -59.7, 6.92; -55.5, 18.18; -51.3, 27.7; -46.3, 37; - 40.6, 45.5; -34.3, 53.1; -27.2, 59.6; -18.7, 65.3; -8.1, 70.2; -6 - , 71; -3.88, 58.5; -1.05, 43.7; 1.78, 30.8; 4.606, 19.45; 8.14, + , 71; -3.88, 58.5; -1.05, 43.7; 1.78, 30.8; 4.606, 19.45; 8.14, 7.3; 11.68, -3; 15.9, -13.2; 20.2, -21.6; 25.1, -29.5; 30.8, - 36.4; 37.1, -42.3; 44.9, -47.5; 54.8, -51.8; 64, -54.4], style( - color=8))), + color=8))), Diagram( - Line(points=[-100, -70; 84, -70], style(color=8)), - Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, - fillColor=8)), - Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, - 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, - 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; + Line(points=[-100, -70; 84, -70], style(color=8)), + Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, + fillColor=8)), + Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, + 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, + 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; 32.12, 87.5; 34.95, 72.7; 37.78, 59.8; 40.606, 48.45; 44.14, 36.3 ; 47.68, 26; 51.9, 15.8; 56.2, 7.4; 61.1, -0.5; 66.8, -7.4; 73.1 - , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, - thickness=2)), - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Text( - extent=[-70, 91; -29, 71], - string="outPort", - style(color=9)), - Text( - extent=[-78, -43; -46, -56], - string="offset", - style(color=9)), - Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], + , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, + thickness=2)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Text( + extent=[-70, 91; -29, 71], + string="outPort", + style(color=9)), + Text( + extent=[-78, -43; -46, -56], + string="offset", + style(color=9)), + Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -29; -40, -60], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[-40, -30; -42, -40; -37, -40; -40, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), - Text( - extent=[-59, -71; -13, -89], - string="startTime", - style(color=9)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), + Text( + extent=[-59, -71; -13, -89], + string="startTime", + style(color=9)), Polygon(points=[-41, -30; -32, -28; -32, -32; -41, -30], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -30; 29, -30], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[29, -30; 21, -28; 21, -32; 29, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-26, -12; 19, -28], - string="riseTime", - style(color=9)), - Text( - extent=[78, -76; 102, -96], - string="time", - style(color=9)), - Line(points=[-100, -70; 84, -70], style(color=8)), - Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, - fillColor=8)), - Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, - 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, - 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-26, -12; 19, -28], + string="riseTime", + style(color=9)), + Text( + extent=[78, -76; 102, -96], + string="time", + style(color=9)), + Line(points=[-100, -70; 84, -70], style(color=8)), + Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, + fillColor=8)), + Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, + 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, + 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; 32.12, 87.5; 34.95, 72.7; 37.78, 59.8; 40.606, 48.45; 44.14, 36.3 ; 47.68, 26; 51.9, 15.8; 56.2, 7.4; 61.1, -0.5; 66.8, -7.4; 73.1 - , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, - thickness=2)), - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Text( - extent=[-70, 91; -29, 71], - string="outPort", - style(color=9)), - Text( - extent=[-78, -43; -46, -56], - string="offset", - style(color=9)), - Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], + , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, + thickness=2)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Text( + extent=[-70, 91; -29, 71], + string="outPort", + style(color=9)), + Text( + extent=[-78, -43; -46, -56], + string="offset", + style(color=9)), + Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -29; -40, -60], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[-40, -30; -42, -40; -37, -40; -40, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), - Text( - extent=[-59, -71; -13, -89], - string="startTime", - style(color=9)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), + Text( + extent=[-59, -71; -13, -89], + string="startTime", + style(color=9)), Polygon(points=[-41, -30; -32, -28; -32, -32; -41, -30], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -30; 29, -30], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[29, -30; 21, -28; 21, -32; 29, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-26, -12; 19, -28], - string="riseTime", - style(color=9)), - Text( - extent=[78, -76; 102, -96], - string="time", - style(color=9)), - Line(points=[30, 100; 30, -34], style(color=8, pattern=2))), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-26, -12; 19, -28], + string="riseTime", + style(color=9)), + Text( + extent=[78, -76; 102, -96], + string="time", + style(color=9)), + Line(points=[30, 100; 30, -34], style(color=8, pattern=2))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.11, - y=0.12, - width=0.78, + x=0.11, + y=0.12, + width=0.78, height=0.83)); end ExponentialsVoltage; - - model PulseVoltage "Pulse voltage source" - parameter Modelica.SIunits.Voltage V=1 "Amplitude of pulse"; + + model PulseVoltage "Pulse voltage source" + parameter SI.Voltage V=1 "Amplitude of pulse"; parameter Real width( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, final max=100) = 50 "Width of pulse in % of period"; - parameter Modelica.SIunits.Time period(final min=Modelica.Constants.SMALL) - = 1 "Time for one period"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Pulse signalSource( - amplitude={V}, - width={width}, + parameter SI.Time period(final min=Modelica.Constants.small) = 1 + "Time for one period"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Pulse signalSource( + amplitude={V}, + width={width}, period={period})); annotation ( - Icon(Line(points=[-70, -70; -40, -70; -40, 70; 0, 70; 0, -70; 40, -70; - 41, 70; 80, 70], style(color=8))), + Icon(Line(points=[-70, -70; -40, -70; -40, 70; 0, 70; 0, -70; 40, -70; 41 + , 70; 80, 70], style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, 1; -37, -12; -30, -12; -34, 1], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-34, -1; -34, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-33, -70; -36, -57; -30, -57; -33, -70; -33, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-33, -70; -36, -57; -30, -57; -33, -70; -33, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-78, -24; -35, -36], - string="offset", - style(color=9)), - Text( - extent=[-31, -69; 15, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-10, 0; -10, -70], style(color=8, pattern=2)), - Line(points=[-80, 0; -20, 0; -21, 50; 21, 50; 20, -1; 41, 0; 40, 50; - 80, 51], style(color=0, thickness=2)), - Line(points=[-19, 88; -19, 49], style(color=8, pattern=2)), - Line(points=[21, 74; 21, 50], style(color=9, pattern=2)), - Line(points=[41, 88; 41, 50], style(color=8, pattern=2)), - Line(points=[-19, 83; 42, 83], style(color=8)), - Line(points=[-19, 69; 21, 69], style(color=8)), - Text( - extent=[-9, 97; 37, 85], - string="period", - style(color=9)), - Text( - extent=[-18, 81; 21, 69], - string="width", - style(color=9)), - Line(points=[-52, 50; -19, 50], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-78, -24; -35, -36], + string="offset", + style(color=9)), + Text( + extent=[-31, -69; 15, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-10, 0; -10, -70], style(color=8, pattern=2)), + Line(points=[-80, 0; -20, 0; -21, 50; 21, 50; 20, -1; 41, 0; 40, 50; 80 + , 51], style(color=0, thickness=2)), + Line(points=[-19, 88; -19, 49], style(color=8, pattern=2)), + Line(points=[21, 74; 21, 50], style(color=9, pattern=2)), + Line(points=[41, 88; 41, 50], style(color=8, pattern=2)), + Line(points=[-19, 83; 42, 83], style(color=8)), + Line(points=[-19, 69; 21, 69], style(color=8)), + Text( + extent=[-9, 97; 37, 85], + string="period", + style(color=9)), + Text( + extent=[-18, 81; 21, 69], + string="width", + style(color=9)), + Line(points=[-52, 50; -19, 50], style(color=8, pattern=2)), Line(points=[-34, 50; -34, 1], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-78, 34; -37, 20], - string="V", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-78, 34; -37, 20], + string="V", + style(color=9)), Polygon(points=[-34, 49; -37, 36; -30, 36; -34, 49], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, 1; -37, 14; -31, 14; -34, 1; -34, 1], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[80, 51; 80, 0; 90, -1], style(color=0, thickness=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[80, 51; 80, 0; 90, -1], style(color=0, thickness=2)), Polygon(points=[-19, 69; -10, 71; -10, 67; -19, 69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[21, 69; 13, 71; 13, 67; 21, 69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-19, 83; -10, 85; -10, 81; -19, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[41, 83; 33, 85; 33, 81; 41, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-78, 103; -24, 89], - string="v = p.v - n.v", - style(color=9))), + extent=[-78, 103; -24, 89], + string="v = p.v - n.v", + style(color=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.4, - y=0.23, - width=0.6, + x=0.4, + y=0.23, + width=0.6, height=0.6)); end PulseVoltage; - - model SawToothVoltage "Saw tooth voltage source" - parameter Modelica.SIunits.Voltage V=1 "Amplitude of saw tooth"; - parameter Modelica.SIunits.Time period=1 "Time for one period"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.SawTooth signalSource(amplitude={V}, period={ - period})); + + model SawToothVoltage "Saw tooth voltage source" + parameter SI.Voltage V=1 "Amplitude of saw tooth"; + parameter SI.Time period=1 "Time for one period"; + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.SawTooth signalSource( + amplitude={V}, period={period})); annotation ( - Icon(Line(points=[-70, -71; -50, -71; 10, 70; 10, -71; 70, 70; 70, -71] - , style(color=8))), + Icon(Line(points=[-70, -71; -50, -71; 10, 70; 10, -71; 70, 70; 70, -71], + style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, -19; -37, -32; -30, -32; -34, -19], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-34, -20; -34, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-34, -70; -37, -57; -31, -57; -34, -70; -34, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-34, -70; -37, -57; -31, -57; -34, -70; -34, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-78, -24; -35, -36], - string="offset", - style(color=9)), - Text( - extent=[-31, -69; 15, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-10, -20; -10, -70], style(color=8, pattern=2)), - Line(points=[-10, 88; -10, -20], style(color=8, pattern=2)), - Line(points=[30, 88; 30, 59], style(color=8, pattern=2)), - Line(points=[-10, 83; 30, 83], style(color=8)), - Text( - extent=[-12, 97; 34, 85], - string="period", - style(color=9)), - Line(points=[-44, 60; 30, 60], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-78, -24; -35, -36], + string="offset", + style(color=9)), + Text( + extent=[-31, -69; 15, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-10, -20; -10, -70], style(color=8, pattern=2)), + Line(points=[-10, 88; -10, -20], style(color=8, pattern=2)), + Line(points=[30, 88; 30, 59], style(color=8, pattern=2)), + Line(points=[-10, 83; 30, 83], style(color=8)), + Text( + extent=[-12, 97; 34, 85], + string="period", + style(color=9)), + Line(points=[-44, 60; 30, 60], style(color=8, pattern=2)), Line(points=[-34, 47; -34, -7], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-78, 34; -37, 20], - string="V", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-78, 34; -37, 20], + string="V", + style(color=9)), Polygon(points=[-34, 60; -37, 47; -30, 47; -34, 60], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-34, -20; -37, -7; -31, -7; -34, -20; -34, -20], style - ( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-34, -20; -37, -7; -31, -7; -34, -20; -34, -20], style( + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-10, 83; -1, 85; -1, 81; -10, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[30, 83; 22, 85; 22, 81; 30, 83], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-80, -20; -10, -20; 30, 60; 30, -20; 72, 60; 72, -20], - style(color=0, thickness=2)), - Text( - extent=[-77, 100; -27, 88], - string="v = p.v - n.v", - style(color=9))), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-80, -20; -10, -20; 30, 60; 30, -20; 72, 60; 72, -20], + style(color=0, thickness=2)), + Text( + extent=[-77, 100; -27, 88], + string="v = p.v - n.v", + style(color=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.37, - y=0.04, - width=0.6, + x=0.37, + y=0.04, + width=0.6, height=0.6)); end SawToothVoltage; - - model TrapezoidVoltage "Trapezoidal voltage source" - parameter Modelica.SIunits.Voltage V=1 "Amplitude of trapezoid"; - parameter SIunits.Time rising(final min=0) = 0 - "Rising duration of trapezoid"; - parameter SIunits.Time width(final min=0) = 0.5 - "Width duration of trapezoid"; - parameter SIunits.Time falling(final min=0) = 0 - "Falling duration of trapezoid"; - parameter SIunits.Time period(final min=Modelica.Constants.small) = 1 - "Time for one period"; - parameter Integer nperiod=-1 + + model TrapezoidVoltage "Trapezoidal voltage source" + parameter SI.Voltage V=1 "Amplitude of trapezoid"; + parameter SI.Time rising(final min=0) = 0 "Rising duration of trapezoid"; + parameter SI.Time width(final min=0) = 0.5 "Width duration of trapezoid"; + parameter SI.Time falling(final min=0) = 0 "Falling duration of trapezoid"; + parameter SI.Time period(final min=Modelica.Constants.small) = 1 + "Time for one period"; + parameter Integer nperiod=-1 "Number of periods (< 0 means infinite number of periods)"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.Trapezoid signalSource( - amplitude={V}, - rising={rising}, - width={width}, - falling={falling}, - period={period}, + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Trapezoid signalSource( + amplitude={V}, + rising={rising}, + width={width}, + falling={falling}, + period={period}, nperiod={nperiod})); annotation ( - Icon(Line(points=[-81, -70; -60, -70; -30, 70; 1, 70; 30, -70; 51, -70; - 80, 70], style(color=8))), + Icon(Line(points=[-81, -70; -60, -70; -30, 70; 1, 70; 30, -70; 51, -70; + 80, 70], style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-45, -30; -47, -41; -43, -41; -45, -30], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-45, -31; -45, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-45, -70; -47, -60; -43, -60; -45, -70; -45, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-45, -70; -47, -60; -43, -60; -45, -70; -45, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-86, -43; -43, -55], - string="offset", - style(color=9)), - Text( - extent=[-47, -69; -1, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-30, 81; -30, -70], style(color=8, pattern=2)), - Line(points=[-10, 59; -10, 40], style(color=8, pattern=2)), - Line(points=[20, 59; 20, 39], style(color=9, pattern=2)), - Line(points=[40, 59; 40, -30], style(color=8, pattern=2)), - Line(points=[-29, 56; 40, 56], style(color=8)), - Text( - extent=[-8, 70; 21, 60], - string="width", - style(color=9)), - Line(points=[-42, 40; -10, 40], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-86, -43; -43, -55], + string="offset", + style(color=9)), + Text( + extent=[-47, -69; -1, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-30, 81; -30, -70], style(color=8, pattern=2)), + Line(points=[-10, 59; -10, 40], style(color=8, pattern=2)), + Line(points=[20, 59; 20, 39], style(color=9, pattern=2)), + Line(points=[40, 59; 40, -30], style(color=8, pattern=2)), + Line(points=[-29, 56; 40, 56], style(color=8)), + Text( + extent=[-8, 70; 21, 60], + string="width", + style(color=9)), + Line(points=[-42, 40; -10, 40], style(color=8, pattern=2)), Line(points=[-39, 40; -39, -19], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-77, 14; -40, 0], - string="V", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-77, 14; -40, 0], + string="V", + style(color=9)), Polygon(points=[-29, 56; -22, 58; -22, 54; -29, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-10, 56; -17, 58; -17, 54; -10, 56], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-80, -30; -30, -30; -9, 46; 21, 46; 40, -30; 60, -30; 80 - , 46; 100, 46], style(color=0, thickness=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-80, -30; -30, -30; -9, 46; 21, 46; 40, -30; 60, -30; 80, + 46; 100, 46], style(color=0, thickness=2)), Polygon(points=[-39, 40; -41, 29; -37, 29; -39, 40], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-39, -29; -41, -19; -37, -19; -39, -29; -39, -29], + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-39, -29; -41, -19; -37, -19; -39, -29; -39, -29], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[60, 81; 60, -30], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[60, 81; 60, -30], style(color=8, pattern=2)), Polygon(points=[39, 56; 32, 58; 32, 54; 39, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[20, 56; 27, 58; 27, 54; 20, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[20, 56; 13, 58; 13, 54; 20, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-12, 56; -5, 58; -5, 54; -12, 56], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-34, 70; -5, 60], - string="rising", - style(color=9)), - Text( - extent=[16, 70; 45, 60], - string="falling", - style(color=9)), - Text( - extent=[-77, 103; -23, 91], - string="v = p.v - n.v", - style(color=9)), - Line(points=[-20, 76; 61, 76], style(color=8)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-34, 70; -5, 60], + string="rising", + style(color=9)), + Text( + extent=[16, 70; 45, 60], + string="falling", + style(color=9)), + Text( + extent=[-77, 103; -23, 91], + string="v = p.v - n.v", + style(color=9)), + Line(points=[-20, 76; 61, 76], style(color=8)), Polygon(points=[-29, 76; -20, 78; -20, 74; -29, 76], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[61, 76; 53, 78; 53, 74; 61, 76], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-2, 86; 25, 77], - string="period", - style(color=9))), + extent=[-2, 86; 25, 77], + string="period", + style(color=9))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.21, - y=0.22, - width=0.6, + x=0.21, + y=0.22, + width=0.6, height=0.63)); end TrapezoidVoltage; - - model TableVoltage "Voltage source by linear interpolation in a table" - parameter Real table[:, :]=[0, 0; 1, 1; 2, 4] + + model TableVoltage "Voltage source by linear interpolation in a table" + parameter Real table[:, :]=[0, 0; 1, 1; 2, 4] "Table matrix (time = first column, voltage = second column)"; - extends Modelica.Electrical.Analog.Interfaces.VoltageSource(redeclare - Modelica.Blocks.Sources.TimeTable signalSource(table=table)); + extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.TimeTable signalSource(table + =table)); annotation ( - Icon(Line(points=[-66, -36; -66, 84; 34, 84; 34, -36; -66, -36; -66, -6 - ; 34, -6; 34, 24; -66, 24; -66, 54; 34, 54; 34, 84; -16, 84; -16 - , -37], style(color=8))), + Icon(Line(points=[-66, -36; -66, 84; 34, 84; 34, -36; -66, -36; -66, -6; + 34, -6; 34, 24; -66, 24; -66, 54; 34, 54; 34, 84; -16, 84; -16, - + 37], style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.25, - y=0.01, - width=0.72, - height=0.86), + x=0.25, + y=0.01, + width=0.72, + height=0.86), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Rectangle(extent=[-20, 90; 30, -30], style( - color=7, - fillColor=8, - fillPattern=1)), - Line(points=[-20, -30; -20, 90; 80, 90; 80, -30; -20, -30; -20, 0; 80 - , 0; 80, 30; -20, 30; -20, 60; 80, 60; 80, 90; 30, 90; 30, -31], - style(color=0)), - Text( - extent=[-77, -42; -38, -58], - string="offset", - style(color=9)), + color=7, + fillColor=8, + fillPattern=1)), + Line(points=[-20, -30; -20, 90; 80, 90; 80, -30; -20, -30; -20, 0; 80, + 0; 80, 30; -20, 30; -20, 60; 80, 60; 80, 90; 30, 90; 30, -31], + style(color=0)), + Text( + extent=[-77, -42; -38, -58], + string="offset", + style(color=9)), Polygon(points=[-31, -30; -33, -40; -28, -40; -31, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-30, -70; -33, -60; -28, -60; -30, -70; -30, -70], + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-30, -70; -33, -60; -28, -60; -30, -70; -30, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-31, -31; -31, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), - Text( - extent=[-38, -70; 8, -88], - string="startTime", - style(color=9)), - Line(points=[-20, -30; -80, -30], style(color=8, pattern=2)), - Text( - extent=[66, -81; 91, -93], - string="time", - style(color=9)), - Text( - extent=[-15, 83; 24, 68], - string="time", - style(color=0)), - Text( - extent=[33, 83; 76, 67], - string="v", - style(color=0)), - Text( - extent=[-81, 98; -31, 85], - string="v = p.v - n.v", - style(color=9))), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), + Text( + extent=[-38, -70; 8, -88], + string="startTime", + style(color=9)), + Line(points=[-20, -30; -80, -30], style(color=8, pattern=2)), + Text( + extent=[66, -81; 91, -93], + string="time", + style(color=9)), + Text( + extent=[-15, 83; 24, 68], + string="time", + style(color=0)), + Text( + extent=[33, 83; 76, 67], + string="v", + style(color=0)), + Text( + extent=[-81, 98; -31, 85], + string="v = p.v - n.v", + style(color=9))), Documentation(info="

This block generates a voltage source by linear interpolation in -a table. The time points and voltage values are stored in a matrix -table[i,j], where the first column table[:,1] contains the -time points and the second column contains the voltage to be interpolated. +a table. The time points and voltage values are stored in a matrix +table[i,j], where the first column table[:,1] contains the +time points and the second column contains the voltage to be interpolated. The table interpolation has the following proporties:

@@ -1056,17 +1033,17 @@ The table interpolation has the following proporties:
  • The time points need to be monotonically increasing.
  • Discontinuities are allowed, by providing the same time point twice in the table.
  • -
  • Values outside of the table range, are computed by +
  • Values outside of the table range, are computed by extrapolation through the last or first two points of the table.
  • If the table has only one row, no interpolation is performed and - the voltage value is just returned independantly of the + the voltage value is just returned independantly of the actual time instant, i.e., this is a constant voltage source.
  • Via parameters startTime and offset the curve defined by the table can be shifted both in time and in the voltage. -
  • The table is implemented in a numerically sound way by +
  • The table is implemented in a numerically sound way by generating time events at interval boundaries, - in order to not integrate over a discontinuous or not differentiable + in order to not integrate over a discontinuous or not differentiable points.
  • @@ -1089,940 +1066,918 @@ If, e.g., time = 1.0, the voltage v = 0.0 (before event), 1.0 (after event) e.g., time = 5.0, the voltage v = 23.0 (i.e. extrapolation).
    - + ")); end TableVoltage; - - model SignalCurrent - "Generic current source using the input signal as source current" - extends Modelica.Electrical.Analog.Interfaces.OnePort; - + + model SignalCurrent + "Generic current source using the input signal as source current" + extends Interfaces.OnePort; + annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Ellipse(extent=[-50, 50; 50, -50], style(fillColor=7)), - Line(points=[-90, 0; -50, 0]), - Line(points=[50, 0; 90, 0]), - Line(points=[0, -50; 0, 50]), - Text(extent=[-100, -120; 100, -80], string="%name")), + Ellipse(extent=[-50, 50; 50, -50], style(fillColor=7)), + Line(points=[-90, 0; -50, 0]), + Line(points=[50, 0; 90, 0]), + Line(points=[0, -50; 0, 50]), + Text(extent=[-100, -120; 100, -80], string="%name")), Window( - x=0.39, - y=0.19, - width=0.6, + x=0.39, + y=0.19, + width=0.6, height=0.6)); - Modelica.Blocks.Interfaces.InPort inPort(final n=1) annotation (extent=[- - 20, 51; 19, 90], rotation=-90); - equation + Modelica.Blocks.Interfaces.InPort inPort(final n=1) annotation (extent=[-20, 51; 19, 90], rotation + =-90); + equation i = inPort.signal[1]; end SignalCurrent; - - model ConstantCurrent "Source for constant current" - parameter Modelica.SIunits.Current I=1 "Value of constant current"; - extends Modelica.Electrical.Analog.Interfaces.OnePort; + + model ConstantCurrent "Source for constant current" + parameter SI.Current I=1 "Value of constant current"; + extends Interfaces.OnePort; annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Icon( - Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), - Line(points=[-90, 0; -50, 0]), - Line(points=[50, 0; 90, 0]), - Line(points=[0, -50; 0, 50]), - Text(extent=[-100, -120; 100, -80], string="%name=%I")), + Ellipse(extent=[-50, 50; 50, -50], style(color=3, fillColor=7)), + Line(points=[-90, 0; -50, 0]), + Line(points=[50, 0; 90, 0]), + Line(points=[0, -50; 0, 50]), + Text(extent=[-100, -120; 100, -80], string="%name=%I")), Window( - x=0.33, - y=0.24, - width=0.6, + x=0.33, + y=0.24, + width=0.6, height=0.6)); - equation + equation i = I; end ConstantCurrent; - - model StepCurrent "Step current source" - parameter Modelica.SIunits.Current I=1 "Height of step"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Step signalSource(height={I})); + + model StepCurrent "Step current source" + parameter SI.Current I=1 "Height of step"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Step signalSource(height={I} + )); annotation ( Icon(Line(points=[-80, -70; -10, -70; -10, 70; 59, 70], style(color=8))) - , + , Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-80, -18; 0, -18; 0, 50; 80, 50], style(color=0, - thickness=2)), - Line(points=[-90, -70; 82, -70], style(color=8)), - Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style(color=8, - fillColor=8)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Text( - extent=[-21, -72; 25, -90], - string="startTime", - style(color=9)), - Line(points=[0, -17; 0, -71], style(color=8, pattern=2)), - Text( - extent=[-68, -36; -22, -54], - string="offset", - style(color=9)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-80, -18; 0, -18; 0, 50; 80, 50], style(color=0, thickness + =2)), + Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style(color=8, + fillColor=8)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Text( + extent=[-21, -72; 25, -90], + string="startTime", + style(color=9)), + Line(points=[0, -17; 0, -71], style(color=8, pattern=2)), + Text( + extent=[-68, -36; -22, -54], + string="offset", + style(color=9)), Line(points=[-13, 50; -13, -17], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[2, 50; -19, 50; 2, 50], style(color=8, pattern=2)), - Polygon(points=[-13, -17; -16, -4; -10, -4; -13, -17; -13, -17], style - ( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[2, 50; -19, 50; 2, 50], style(color=8, pattern=2)), + Polygon(points=[-13, -17; -16, -4; -10, -4; -13, -17; -13, -17], style( + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-13, 50; -16, 37; -9, 37; -13, 50], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-68, 26; -22, 8], - string="I", - style(color=9)), - Polygon(points=[-13, -69; -16, -56; -10, -56; -13, -69; -13, -69], + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-68, 26; -22, 8], + string="I", + style(color=9)), + Polygon(points=[-13, -69; -16, -56; -10, -56; -13, -69; -13, -69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-13, -18; -13, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[-13, -18; -16, -31; -9, -31; -13, -18], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.28, - y=0, - width=0.72, + x=0.28, + y=0, + width=0.72, height=0.73)); end StepCurrent; - - model RampCurrent "Ramp current source" - parameter Modelica.SIunits.Current I=1 "Height of ramp"; - parameter Modelica.SIunits.Time duration(min=Modelica.Constants.SMALL) = 2 - "Duration of ramp"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Ramp signalSource(final height={I}, final - duration={duration})); + + model RampCurrent "Ramp current source" + parameter SI.Current I=1 "Height of ramp"; + parameter SI.Time duration(min=Modelica.Constants.small) = 2 "Duration of ramp"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Ramp signalSource(final + height={I}, final duration={duration})); annotation ( Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), Line(points=[-80, -20; -20, -20; 50, 50], style(color=0, thickness=2)) - , - Line(points=[-90, -70; 82, -70], style(color=8)), + , + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-40, -20; -42, -30; -37, -30; -40, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -20; -40, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-80, -33; -41, -49], - string="offset", - style(color=9)), - Text( - extent=[-40, -70; 6, -88], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-80, -33; -41, -49], + string="offset", + style(color=9)), + Text( + extent=[-40, -70; 6, -88], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), Line(points=[-19, -20; 50, -20], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Line(points=[50, 50; 101, 50], style(color=0, thickness=2)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Line(points=[50, 50; 101, 50], style(color=0, thickness=2)), Line(points=[50, 50; 50, -20], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[50, -20; 42, -18; 42, -22; 50, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-20, -20; -11, -18; -11, -22; -20, -20], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[50, 50; 48, 40; 53, 40; 50, 50], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[50, -20; 47, -10; 52, -10; 50, -20; 50, -20], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[53, 25; 82, 7], - string="I", - style(color=9)), - Text( - extent=[0, -17; 35, -37], - string="duration", - style(color=9)), - Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), - Icon(Line(points=[-80, -60; -50, -60; 50, 60; 80, 60], style(color=8))) - , + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[53, 25; 82, 7], + string="I", + style(color=9)), + Text( + extent=[0, -17; 35, -37], + string="duration", + style(color=9)), + Text( + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), + Icon(Line(points=[-80, -60; -50, -60; 50, 60; 80, 60], style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.29, - y=0.11, - width=0.6, + x=0.29, + y=0.11, + width=0.6, height=0.6)); end RampCurrent; - - model SineCurrent "Sine current source" - parameter Modelica.SIunits.Current I=1 "Amplitude of sine wave"; - parameter Modelica.SIunits.Angle phase=0 "Phase of sine wave"; - parameter Modelica.SIunits.Frequency freqHz=1 "Frequency of sine wave"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Sine signalSource( - amplitude={I}, - freqHz={freqHz}, - phase={phase}, - offset={offset}, - startTime={startTime})); + + model SineCurrent "Sine current source" + parameter SI.Current I=1 "Amplitude of sine wave"; + parameter SI.Angle phase=0 "Phase of sine wave"; + parameter SI.Frequency freqHz=1 "Frequency of sine wave"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Sine signalSource( + amplitude={I}, + freqHz={freqHz}, + phase={phase})); annotation ( Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.37, - y=0.06, - width=0.6, - height=0.6), - Icon(Line(points=[-70, 0; -60.2, 29.9; -53.8, 46.5; -48.2, 58.1; -43.3, - 65.2; -38.3, 69.2; -33.4, 69.8; -28.5, 67; -23.6, 61; -18.6, 52; + x=0.37, + y=0.06, + width=0.6, + height=0.6), + Icon(Line(points=[-70, 0; -60.2, 29.9; -53.8, 46.5; -48.2, 58.1; -43.3, + 65.2; -38.3, 69.2; -33.4, 69.8; -28.5, 67; -23.6, 61; -18.6, 52; -13, 38.6; -5.98, 18.6; 8.79, -26.9; 15.1, -44; 20.8, -56.2; 25.7 , -64; 30.6, -68.6; 35.5, -70; 40.5, -67.9; 45.4, -62.5; 50.3, - - 54.1; 55.9, -41.3; 63, -21.7; 70, 0], style(color=8))), + 54.1; 55.9, -41.3; 63, -21.7; 70, 0], style(color=8))), Diagram( - Line(points=[-80, -90; -80, 84], style(color=8)), - Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, - fillColor=8)), - Line(points=[-99, -40; 85, -40], style(color=8)), - Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, - fillColor=8)), - Line(points=[-40, 0; -31.6, 34.2; -26.1, 53.1; -21.3, 66.4; -17.1, - 74.6; -12.9, 79.1; -8.64, 79.8; -4.42, 76.6; -0.201, 69.7; 4.02, - 59.4; 8.84, 44.1; 14.9, 21.2; 27.5, -30.8; 33, -50.2; 37.8, -64.2 - ; 42, -73.1; 46.2, -78.4; 50.5, -80; 54.7, -77.6; 58.9, -71.5; - 63.1, -61.9; 67.9, -47.2; 74, -24.8; 80, 0], style(color=0, - thickness=2)), - Line(points=[-41, -2; -80, -2], style(color=0, thickness=2)), - Text( - extent=[-106, -11; -60, -29], - string="offset", - style(color=9)), - Line(points=[-41, -2; -41, -40], style(color=8, pattern=2)), - Text( - extent=[-60, -43; -14, -61], - string="startTime", - style(color=9)), - Text( - extent=[84, -52; 108, -72], - string="time", - style(color=9)), - Line(points=[-9, 79; 43, 79], style(color=8, pattern=2)), - Line(points=[-42, -1; 50, 0], style(color=8, pattern=2)), + Line(points=[-80, -90; -80, 84], style(color=8)), + Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, + fillColor=8)), + Line(points=[-99, -40; 85, -40], style(color=8)), + Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, + fillColor=8)), + Line(points=[-40, 0; -31.6, 34.2; -26.1, 53.1; -21.3, 66.4; -17.1, 74.6 + ; -12.9, 79.1; -8.64, 79.8; -4.42, 76.6; -0.201, 69.7; 4.02, 59.4 + ; 8.84, 44.1; 14.9, 21.2; 27.5, -30.8; 33, -50.2; 37.8, -64.2; 42 + , -73.1; 46.2, -78.4; 50.5, -80; 54.7, -77.6; 58.9, -71.5; 63.1, + -61.9; 67.9, -47.2; 74, -24.8; 80, 0], style(color=0, thickness=2 + )), + Line(points=[-41, -2; -80, -2], style(color=0, thickness=2)), + Text( + extent=[-106, -11; -60, -29], + string="offset", + style(color=9)), + Line(points=[-41, -2; -41, -40], style(color=8, pattern=2)), + Text( + extent=[-60, -43; -14, -61], + string="startTime", + style(color=9)), + Text( + extent=[84, -52; 108, -72], + string="time", + style(color=9)), + Line(points=[-9, 79; 43, 79], style(color=8, pattern=2)), + Line(points=[-42, -1; 50, 0], style(color=8, pattern=2)), Polygon(points=[33, 80; 30, 67; 37, 67; 33, 80], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[37, 57; 83, 39], - string="I", - style(color=9)), + extent=[37, 57; 83, 39], + string="I", + style(color=9)), Polygon(points=[33, 1; 30, 14; 36, 14; 33, 1; 33, 1], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[33, 79; 33, 0], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Text( - extent=[-73, 82; -53, 102], - string="i", + extent=[-73, 82; -53, 102], + string="i", style(color=8)))); end SineCurrent; - - model ExpSineCurrent "Exponentially damped sine current source" + + model ExpSineCurrent "Exponentially damped sine current source" parameter Real I=1 "Amplitude of sine wave"; - parameter Modelica.SIunits.Frequency freqHz=2 "Frequency of sine wave"; - parameter Modelica.SIunits.Angle phase=0 "Phase of sine wave"; - parameter Modelica.SIunits.Damping damping=1 - "Damping coefficient of sine wave"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.ExpSine signalSource( - amplitude={I}, - freqHz={freqHz}, - phase={phase}, - damping={damping}, - offset={offset}, - startTime={startTime})); + parameter SI.Frequency freqHz=2 "Frequency of sine wave"; + parameter SI.Angle phase=0 "Phase of sine wave"; + parameter SI.Damping damping=1 "Damping coefficient of sine wave"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.ExpSine signalSource( + amplitude={I}, + freqHz={freqHz}, + phase={phase}, + damping={damping})); annotation ( - Icon(Line(points=[-80, -14; -75.2, 18.3; -72, 36.3; -68.7, 50.5; -65.5, - 60.2; -62.3, 65.3; -59.1, 65.6; -55.9, 61.3; -52.7, 53.1; -48.6, + Icon(Line(points=[-80, -14; -75.2, 18.3; -72, 36.3; -68.7, 50.5; -65.5, + 60.2; -62.3, 65.3; -59.1, 65.6; -55.9, 61.3; -52.7, 53.1; -48.6, 38.2; -43, 11.8; -35, -27.9; -30.2, -47.7; -26.1, -59.9; -22.1, - - 67.2; -18.1, -69.3; -14.1, -66.5; -10.1, -59.3; -5.23, -46.1; - 8.44, -0.3; 13.3, 12.4; 18.1, 20.8; 22.1, 24; 26.9, 23.2; 31.8, + 67.2; -18.1, -69.3; -14.1, -66.5; -10.1, -59.3; -5.23, -46.1; + 8.44, -0.3; 13.3, 12.4; 18.1, 20.8; 22.1, 24; 26.9, 23.2; 31.8, 17.8; 38.2, 5.4; 51.1, -24.5; 57.5, -35.2; 63.1, -39.9; 68.7, - - 39.9; 75.2, -34.5; 80, -27.8], style(color=8))), + 39.9; 75.2, -34.5; 80, -27.8], style(color=8))), Diagram( - Line(points=[-80, -90; -80, 84], style(color=8)), - Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, - fillColor=8)), - Line(points=[-99, -40; 85, -40], style(color=8)), - Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, - fillColor=8)), - Line(points=[-50, 0; -46.1, 28.2; -43.5, 44; -40.9, 56.4; -38.2, 64.9 - ; -35.6, 69.4; -33, 69.6; -30.4, 65.9; -27.8, 58.7; -24.5, 45.7; - -19.9, 22.5; -13.4, -12.2; -9.5, -29.5; -6.23, -40.1; -2.96, - - 46.5; 0.302, -48.4; 3.57, -45.9; 6.83, -39.6; 10.8, -28.1; 21.9, - 12; 25.8, 23.1; 29.7, 30.5; 33, 33.3; 36.9, 32.5; 40.8, 27.8; 46 - , 16.9; 56.5, -9.2; 61.7, -18.6; 66.3, -22.7; 70.9, -22.6; 76.1, - -18; 80, -12.1], style(color=0, thickness=2)), - Text( - extent=[-78, 1; -55, -19], - string="offset", - style(color=9)), - Text( - extent=[-72, -36; -26, -54], - string="startTime", - style(color=9)), - Text( - extent=[84, -52; 108, -72], - string="time", - style(color=9)), - Line(points=[-50, 0; 18, 0], style(color=8, pattern=2)), - Line(points=[-50, 0; -81, 0], style(color=0, thickness=2)), - Line(points=[-50, 77; -50, 0], style(color=8, pattern=2)), - Line(points=[18, -1; 18, 76], style(color=8, pattern=2)), - Line(points=[18, 73; -50, 73], style(color=8)), - Text( - extent=[-42, 88; 9, 74], - string="1/freqHz", - style(color=9)), + Line(points=[-80, -90; -80, 84], style(color=8)), + Polygon(points=[-80, 100; -86, 84; -74, 84; -80, 100], style(color=8, + fillColor=8)), + Line(points=[-99, -40; 85, -40], style(color=8)), + Polygon(points=[101, -40; 85, -34; 85, -46; 101, -40], style(color=8, + fillColor=8)), + Line(points=[-50, 0; -46.1, 28.2; -43.5, 44; -40.9, 56.4; -38.2, 64.9; + -35.6, 69.4; -33, 69.6; -30.4, 65.9; -27.8, 58.7; -24.5, 45.7; - + 19.9, 22.5; -13.4, -12.2; -9.5, -29.5; -6.23, -40.1; -2.96, -46.5 + ; 0.302, -48.4; 3.57, -45.9; 6.83, -39.6; 10.8, -28.1; 21.9, 12; + 25.8, 23.1; 29.7, 30.5; 33, 33.3; 36.9, 32.5; 40.8, 27.8; 46, + 16.9; 56.5, -9.2; 61.7, -18.6; 66.3, -22.7; 70.9, -22.6; 76.1, - + 18; 80, -12.1], style(color=0, thickness=2)), + Text( + extent=[-78, 1; -55, -19], + string="offset", + style(color=9)), + Text( + extent=[-72, -36; -26, -54], + string="startTime", + style(color=9)), + Text( + extent=[84, -52; 108, -72], + string="time", + style(color=9)), + Line(points=[-50, 0; 18, 0], style(color=8, pattern=2)), + Line(points=[-50, 0; -81, 0], style(color=0, thickness=2)), + Line(points=[-50, 77; -50, 0], style(color=8, pattern=2)), + Line(points=[18, -1; 18, 76], style(color=8, pattern=2)), + Line(points=[18, 73; -50, 73], style(color=8)), + Text( + extent=[-42, 88; 9, 74], + string="1/freqHz", + style(color=9)), Polygon(points=[-49, 73; -40, 75; -40, 71; -49, 73], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[18, 73; 10, 75; 10, 71; 18, 73], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-50, -61; -19, -61], style(color=8)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-50, -61; -19, -61], style(color=8)), Polygon(points=[-18, -61; -26, -59; -26, -63; -18, -61], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-51, -63; -27, -75], - string="t", - style(color=9)), - Text( - extent=[-82, -67; 108, -96], - string="I*exp(-damping*t)*sin(2*pi*freqHz*t+phase)", - style(color=9)), - Line(points=[-50, 0; -50, -40], style(color=8, pattern=2)), - Line(points=[-50, -54; -50, -72], style(color=8, pattern=2)), - Line(points=[18, -76; -1, -48], style(color=8, pattern=2)), - Text( - extent=[-74, 83; -54, 103], - string="i", - style(color=8))), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-51, -63; -27, -75], + string="t", + style(color=9)), + Text( + extent=[-82, -67; 108, -96], + string="I*exp(-damping*t)*sin(2*pi*freqHz*t+phase)", + style(color=9)), + Line(points=[-50, 0; -50, -40], style(color=8, pattern=2)), + Line(points=[-50, -54; -50, -72], style(color=8, pattern=2)), + Line(points=[18, -76; -1, -48], style(color=8, pattern=2)), + Text( + extent=[-74, 83; -54, 103], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.33, - y=0.06, - width=0.6, + x=0.33, + y=0.06, + width=0.6, height=0.75)); end ExpSineCurrent; - - model ExponentialsCurrent " Rising and falling exponential current source" + + model ExponentialsCurrent " Rising and falling exponential current source" parameter Real iMax=1 "Upper bound for rising edge"; - parameter Modelica.SIunits.Time riseTime(min=0) = 0.5 "Rise time"; - parameter Modelica.SIunits.Time riseTimeConst(min=Modelica.Constants.SMALL - ) = 0.1 "Rise time constant"; - parameter Modelica.SIunits.Time fallTimeConst(min=Modelica.Constants.SMALL - ) = riseTimeConst "Fall time constant"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Exponentials signalSource( - outMax={iMax}, - riseTime={riseTime}, - riseTimeConst={riseTimeConst}, + parameter SI.Time riseTime(min=0) = 0.5 "Rise time"; + parameter SI.Time riseTimeConst(min=Modelica.Constants.small) = 0.1 + "Rise time constant"; + parameter SI.Time fallTimeConst(min=Modelica.Constants.small) = riseTimeConst + "Fall time constant"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Exponentials signalSource( + outMax={iMax}, + riseTime={riseTime}, + riseTimeConst={riseTimeConst}, fallTimeConst={fallTimeConst})); annotation ( Icon(Line(points=[-76, -59; -73.2, -44.3; -70.3, -31.1; -66.8, -16.6; - 63.3, -4; -59.7, 6.92; -55.5, 18.18; -51.3, 27.7; -46.3, 37; - 40.6, 45.5; -34.3, 53.1; -27.2, 59.6; -18.7, 65.3; -8.1, 70.2; -6 - , 71; -3.88, 58.5; -1.05, 43.7; 1.78, 30.8; 4.606, 19.45; 8.14, + , 71; -3.88, 58.5; -1.05, 43.7; 1.78, 30.8; 4.606, 19.45; 8.14, 7.3; 11.68, -3; 15.9, -13.2; 20.2, -21.6; 25.1, -29.5; 30.8, - 36.4; 37.1, -42.3; 44.9, -47.5; 54.8, -51.8; 64, -54.4], style( - color=8))), + color=8))), Diagram( - Line(points=[-100, -70; 84, -70], style(color=8)), - Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, - fillColor=8)), - Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, - 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, - 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; + Line(points=[-100, -70; 84, -70], style(color=8)), + Polygon(points=[100, -70; 84, -64; 84, -76; 100, -70], style(color=8, + fillColor=8)), + Line(points=[-40, -30; -37.2, -15.3; -34.3, -2.1; -30.8, 12.4; -27.3, + 25; -23.7, 35.92; -19.5, 47.18; -15.3, 56.7; -10.3, 66; -4.6, + 74.5; 1.7, 82.1; 8.8, 88.6; 17.3, 94.3; 27.9, 99.2; 30, 100; 32.12, 87.5; 34.95, 72.7; 37.78, 59.8; 40.606, 48.45; 44.14, 36.3 ; 47.68, 26; 51.9, 15.8; 56.2, 7.4; 61.1, -0.5; 66.8, -7.4; 73.1 - , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, - thickness=2)), - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], + , -13.3; 80.9, -18.5; 90.8, -22.8; 100, -25.4], style(color=0, + thickness=2)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Polygon(points=[-40, -70; -43, -60; -38, -60; -40, -70; -40, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -29; -40, -60], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[-40, -30; -42, -40; -37, -40; -40, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), - Text( - extent=[-59, -71; -13, -89], - string="startTime", - style(color=9)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), + Text( + extent=[-59, -71; -13, -89], + string="startTime", + style(color=9)), Polygon(points=[-41, -30; -32, -28; -32, -32; -41, -30], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-40, -30; 29, -30], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), + color=8, + pattern=1, + thickness=1, + arrow=0)), Polygon(points=[29, -30; 21, -28; 21, -32; 29, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-26, -12; 19, -28], - string="riseTime", - style(color=9)), - Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), - Line(points=[30, 100; 30, -34], style(color=8, pattern=2)), - Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-26, -12; 19, -28], + string="riseTime", + style(color=9)), + Line(points=[-39, -30; -80, -30], style(color=0, thickness=2)), + Line(points=[30, 100; 30, -34], style(color=8, pattern=2)), + Text( + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.11, - y=0.12, - width=0.78, + x=0.11, + y=0.12, + width=0.78, height=0.83)); end ExponentialsCurrent; - - model PulseCurrent "Pulse current source" - parameter Modelica.SIunits.Current I=1 "Amplitude of pulse"; + + model PulseCurrent "Pulse current source" + parameter SI.Current I=1 "Amplitude of pulse"; parameter Real width( - final min=Modelica.Constants.SMALL, + final min=Modelica.Constants.small, final max=100) = 50 "Width of pulse in % of period"; - parameter Modelica.SIunits.Time period(final min=Modelica.Constants.SMALL) - = 1 "Time for one period"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Pulse signalSource( - amplitude={I}, - width={width}, + parameter SI.Time period(final min=Modelica.Constants.small) = 1 + "Time for one period"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Pulse signalSource( + amplitude={I}, + width={width}, period={period})); annotation ( - Icon(Line(points=[-70, -70; -40, -70; -40, 70; 0, 70; 0, -70; 40, -70; - 41, 70; 80, 70], style(color=8))), + Icon(Line(points=[-70, -70; -40, -70; -40, 70; 0, 70; 0, -70; 40, -70; 41 + , 70; 80, 70], style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, 1; -37, -12; -30, -12; -34, 1], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-34, -1; -34, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-33, -70; -36, -57; -30, -57; -33, -70; -33, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-33, -70; -36, -57; -30, -57; -33, -70; -33, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-78, -24; -35, -36], - string="offset", - style(color=9)), - Text( - extent=[-31, -69; 15, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-10, 0; -10, -70], style(color=8, pattern=2)), - Line(points=[-80, 0; -20, 0; -21, 50; 21, 50; 20, -1; 41, 0; 40, 50; - 80, 51], style(color=0, thickness=2)), - Line(points=[-19, 88; -19, 49], style(color=8, pattern=2)), - Line(points=[21, 74; 21, 50], style(color=9, pattern=2)), - Line(points=[41, 88; 41, 50], style(color=8, pattern=2)), - Line(points=[-19, 83; 42, 83], style(color=8)), - Line(points=[-19, 69; 21, 69], style(color=8)), - Text( - extent=[-9, 97; 37, 85], - string="period", - style(color=9)), - Text( - extent=[-18, 81; 21, 69], - string="width", - style(color=9)), - Line(points=[-52, 50; -19, 50], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-78, -24; -35, -36], + string="offset", + style(color=9)), + Text( + extent=[-31, -69; 15, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-10, 0; -10, -70], style(color=8, pattern=2)), + Line(points=[-80, 0; -20, 0; -21, 50; 21, 50; 20, -1; 41, 0; 40, 50; 80 + , 51], style(color=0, thickness=2)), + Line(points=[-19, 88; -19, 49], style(color=8, pattern=2)), + Line(points=[21, 74; 21, 50], style(color=9, pattern=2)), + Line(points=[41, 88; 41, 50], style(color=8, pattern=2)), + Line(points=[-19, 83; 42, 83], style(color=8)), + Line(points=[-19, 69; 21, 69], style(color=8)), + Text( + extent=[-9, 97; 37, 85], + string="period", + style(color=9)), + Text( + extent=[-18, 81; 21, 69], + string="width", + style(color=9)), + Line(points=[-52, 50; -19, 50], style(color=8, pattern=2)), Line(points=[-34, 50; -34, 1], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-78, 34; -37, 20], - string="I", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-78, 34; -37, 20], + string="I", + style(color=9)), Polygon(points=[-34, 49; -37, 36; -30, 36; -34, 49], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, 1; -37, 14; -31, 14; -34, 1; -34, 1], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[80, 51; 80, 0; 90, -1], style(color=0, thickness=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[80, 51; 80, 0; 90, -1], style(color=0, thickness=2)), Polygon(points=[-19, 69; -10, 71; -10, 67; -19, 69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[21, 69; 13, 71; 13, 67; 21, 69], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-19, 83; -10, 85; -10, 81; -19, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[41, 83; 33, 85; 33, 81; 41, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.4, - y=0.23, - width=0.6, + x=0.4, + y=0.23, + width=0.6, height=0.6)); end PulseCurrent; - - model SawToothCurrent "Saw tooth current source" - parameter Modelica.SIunits.Current I=1 "Amplitude of saw tooth"; - parameter Modelica.SIunits.Time period=1 "Time for one period"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.SawTooth signalSource(amplitude={I}, period={ - period})); + + model SawToothCurrent "Saw tooth current source" + parameter SI.Current I=1 "Amplitude of saw tooth"; + parameter SI.Time period=1 "Time for one period"; + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.SawTooth signalSource( + amplitude={I}, period={period})); annotation ( - Icon(Line(points=[-70, -71; -50, -71; 10, 70; 10, -71; 70, 70; 70, -71] - , style(color=8))), + Icon(Line(points=[-70, -71; -50, -71; 10, 70; 10, -71; 70, 70; 70, -71], + style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-34, -19; -37, -32; -30, -32; -34, -19], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-34, -20; -34, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-34, -70; -37, -57; -31, -57; -34, -70; -34, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-34, -70; -37, -57; -31, -57; -34, -70; -34, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-78, -24; -35, -36], - string="offset", - style(color=9)), - Text( - extent=[-31, -69; 15, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-10, -20; -10, -70], style(color=8, pattern=2)), - Line(points=[-10, 88; -10, -20], style(color=8, pattern=2)), - Line(points=[30, 88; 30, 59], style(color=8, pattern=2)), - Line(points=[-10, 83; 30, 83], style(color=8)), - Text( - extent=[-12, 97; 34, 85], - string="period", - style(color=9)), - Line(points=[-44, 60; 30, 60], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-78, -24; -35, -36], + string="offset", + style(color=9)), + Text( + extent=[-31, -69; 15, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-10, -20; -10, -70], style(color=8, pattern=2)), + Line(points=[-10, 88; -10, -20], style(color=8, pattern=2)), + Line(points=[30, 88; 30, 59], style(color=8, pattern=2)), + Line(points=[-10, 83; 30, 83], style(color=8)), + Text( + extent=[-12, 97; 34, 85], + string="period", + style(color=9)), + Line(points=[-44, 60; 30, 60], style(color=8, pattern=2)), Line(points=[-34, 47; -34, -7], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-78, 34; -37, 20], - string="I", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-78, 34; -37, 20], + string="I", + style(color=9)), Polygon(points=[-34, 60; -37, 47; -30, 47; -34, 60], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-34, -20; -37, -7; -31, -7; -34, -20; -34, -20], style - ( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-34, -20; -37, -7; -31, -7; -34, -20; -34, -20], style( + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-10, 83; -1, 85; -1, 81; -10, 83], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[30, 83; 22, 85; 22, 81; 30, 83], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-80, -20; -10, -20; 30, 60; 30, -20; 72, 60; 72, -20], - style(color=0, thickness=2)), - Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-80, -20; -10, -20; 30, 60; 30, -20; 72, 60; 72, -20], + style(color=0, thickness=2)), + Text( + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.37, - y=0.04, - width=0.6, + x=0.37, + y=0.04, + width=0.6, height=0.6)); end SawToothCurrent; - - model TrapezoidCurrent "Trapezoidal current source" - parameter Modelica.SIunits.Current I=1 "Amplitude of trapezoid"; - parameter Real rising( - final min=0, - final max=100) = 10 "Rising duration of trapezoid in % of period"; - parameter Real width( - final min=0, - final max=100) = 50 "Width of trapezoid in % of period"; - parameter Real falling( - final min=0, - final max=100) = 10 "Falling duration in % of period"; - parameter Modelica.SIunits.Time period(final min=Modelica.Constants.SMALL) - = 1 "Time for one period"; - parameter Integer nperiod=-1 + + model TrapezoidCurrent "Trapezoidal current source" + parameter SI.Current I=1 "Amplitude of trapezoid"; + parameter SI.Time rising(final min=0) = 0 "Rising duration of trapezoid"; + parameter SI.Time width(final min=0) = 0.5 "Width duration of trapezoid"; + parameter SI.Time falling(final min=0) = 0 "Falling duration of trapezoid"; + parameter SI.Time period(final min=Modelica.Constants.small) = 1 + "Time for one period"; + parameter Integer nperiod=-1 "Number of periods (< 0 means infinite number of periods)"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.Trapezoid signalSource( - amplitude={I}, - rising={rising}, - width={width}, - falling={falling}, - period={period}, + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Trapezoid signalSource( + amplitude={I}, + rising={rising}, + width={width}, + falling={falling}, + period={period}, nperiod={nperiod})); annotation ( - Icon(Line(points=[-81, -70; -60, -70; -30, 70; 1, 70; 30, -70; 51, -70; - 80, 70], style(color=8))), + Icon(Line(points=[-81, -70; -60, -70; -30, 70; 1, 70; 30, -70; 51, -70; + 80, 70], style(color=8))), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-45, -30; -47, -41; -43, -41; -45, -30], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-45, -31; -45, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Polygon(points=[-45, -70; -47, -60; -43, -60; -45, -70; -45, -70], + color=8, + pattern=1, + thickness=1, + arrow=0)), + Polygon(points=[-45, -70; -47, -60; -43, -60; -45, -70; -45, -70], style( - color=8, - fillColor=8, - fillPattern=1)), - Text( - extent=[-86, -43; -43, -55], - string="offset", - style(color=9)), - Text( - extent=[-47, -69; -1, -87], - string="startTime", - style(color=9)), - Text( - extent=[70, -80; 94, -100], - string="time", - style(color=9)), - Line(points=[-29, 79; -30, -70], style(color=8, pattern=2)), - Line(points=[-10, 59; -10, 40], style(color=8, pattern=2)), - Line(points=[20, 59; 20, 39], style(color=9, pattern=2)), - Line(points=[40, 59; 40, -30], style(color=8, pattern=2)), - Line(points=[-20, 75; 60, 75], style(color=8)), - Line(points=[-29, 56; 40, 56], style(color=8)), - Text( - extent=[-9, 88; 37, 76], - string="period", - style(color=9)), - Text( - extent=[-8, 70; 21, 60], - string="width", - style(color=9)), - Line(points=[-42, 40; -10, 40], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Text( + extent=[-86, -43; -43, -55], + string="offset", + style(color=9)), + Text( + extent=[-47, -69; -1, -87], + string="startTime", + style(color=9)), + Text( + extent=[70, -80; 94, -100], + string="time", + style(color=9)), + Line(points=[-29, 79; -30, -70], style(color=8, pattern=2)), + Line(points=[-10, 59; -10, 40], style(color=8, pattern=2)), + Line(points=[20, 59; 20, 39], style(color=9, pattern=2)), + Line(points=[40, 59; 40, -30], style(color=8, pattern=2)), + Line(points=[-20, 75; 60, 75], style(color=8)), + Line(points=[-29, 56; 40, 56], style(color=8)), + Text( + extent=[-9, 88; 37, 76], + string="period", + style(color=9)), + Text( + extent=[-8, 70; 21, 60], + string="width", + style(color=9)), + Line(points=[-42, 40; -10, 40], style(color=8, pattern=2)), Line(points=[-39, 40; -39, -19], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Text( - extent=[-77, 14; -40, 0], - string="I", - style(color=9)), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Text( + extent=[-77, 14; -40, 0], + string="I", + style(color=9)), Polygon(points=[-29, 56; -22, 58; -22, 54; -29, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-10, 56; -17, 58; -17, 54; -10, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-29, 75; -20, 77; -20, 73; -29, 75], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[60, 75; 52, 77; 52, 73; 60, 75], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[-80, -30; -30, -30; -9, 46; 21, 46; 40, -30; 60, -30; 80 - , 46; 100, 46], style(color=0, thickness=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[-80, -30; -30, -30; -9, 46; 21, 46; 40, -30; 60, -30; 80, + 46; 100, 46], style(color=0, thickness=2)), Polygon(points=[-39, 40; -41, 29; -37, 29; -39, 40], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-39, -29; -41, -19; -37, -19; -39, -29; -39, -29], + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-39, -29; -41, -19; -37, -19; -39, -29; -39, -29], style( - color=8, - fillColor=8, - fillPattern=1)), - Line(points=[60, 80; 60, -30], style(color=8, pattern=2)), + color=8, + fillColor=8, + fillPattern=1)), + Line(points=[60, 80; 60, -30], style(color=8, pattern=2)), Polygon(points=[39, 56; 32, 58; 32, 54; 39, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[20, 56; 27, 58; 27, 54; 20, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[20, 56; 13, 58; 13, 54; 20, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Polygon(points=[-12, 56; -5, 58; -5, 54; -12, 56], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Text( - extent=[-34, 70; -5, 60], - string="rising", - style(color=9)), + extent=[-34, 70; -5, 60], + string="rising", + style(color=9)), Text( - extent=[16, 70; 45, 60], - string="falling", - style(color=9)), + extent=[16, 70; 45, 60], + string="falling", + style(color=9)), Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.19, - y=0.28, - width=0.6, + x=0.19, + y=0.28, + width=0.6, height=0.63)); end TrapezoidCurrent; - - model TableCurrent "Current source by linear interpolation in a table" - parameter Real table[:, :]=[0, 0; 1, 1; 2, 4] + + model TableCurrent "Current source by linear interpolation in a table" + parameter Real table[:, :]=[0, 0; 1, 1; 2, 4] "Table matrix (time = first column, current = second column)"; - extends Modelica.Electrical.Analog.Interfaces.CurrentSource(redeclare - Modelica.Blocks.Sources.TimeTable signalSource(table=table)); + extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.TimeTable signalSource(table + =table)); annotation ( - Icon(Line(points=[-66, -36; -66, 84; 34, 84; 34, -36; -66, -36; -66, -6 - ; 34, -6; 34, 24; -66, 24; -66, 54; 34, 54; 34, 84; -16, 84; -16 - , -37], style(color=8))), + Icon(Line(points=[-66, -36; -66, 84; 34, 84; 34, -36; -66, -36; -66, -6; + 34, -6; 34, 24; -66, 24; -66, 54; 34, 54; 34, 84; -16, 84; -16, - + 37], style(color=8))), Coordsys( - extent=[-100, -100; 100, 100], - grid=[1, 1], - component=[20, 20]), + extent=[-100, -100; 100, 100], + grid=[1, 1], + component=[20, 20]), Window( - x=0.25, - y=0.01, - width=0.72, - height=0.86), + x=0.25, + y=0.01, + width=0.72, + height=0.86), Diagram( - Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, - fillColor=8)), - Line(points=[-80, 68; -80, -80], style(color=8)), - Line(points=[-90, -70; 82, -70], style(color=8)), + Polygon(points=[-80, 90; -88, 68; -72, 68; -80, 90], style(color=8, + fillColor=8)), + Line(points=[-80, 68; -80, -80], style(color=8)), + Line(points=[-90, -70; 82, -70], style(color=8)), Polygon(points=[90, -70; 68, -62; 68, -78; 90, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Rectangle(extent=[-20, 90; 30, -30], style( - color=7, - fillColor=8, - fillPattern=1)), - Line(points=[-20, -30; -20, 90; 80, 90; 80, -30; -20, -30; -20, 0; 80 - , 0; 80, 30; -20, 30; -20, 60; 80, 60; 80, 90; 30, 90; 30, -31], - style(color=0)), - Text( - extent=[-77, -42; -38, -58], - string="offset", - style(color=9)), + color=7, + fillColor=8, + fillPattern=1)), + Line(points=[-20, -30; -20, 90; 80, 90; 80, -30; -20, -30; -20, 0; 80, + 0; 80, 30; -20, 30; -20, 60; 80, 60; 80, 90; 30, 90; 30, -31], + style(color=0)), + Text( + extent=[-77, -42; -38, -58], + string="offset", + style(color=9)), Polygon(points=[-31, -30; -33, -40; -28, -40; -31, -30], style( - color=8, - fillColor=8, - fillPattern=1)), - Polygon(points=[-30, -70; -33, -60; -28, -60; -30, -70; -30, -70], + color=8, + fillColor=8, + fillPattern=1)), + Polygon(points=[-30, -70; -33, -60; -28, -60; -30, -70; -30, -70], style( - color=8, - fillColor=8, - fillPattern=1)), + color=8, + fillColor=8, + fillPattern=1)), Line(points=[-31, -31; -31, -70], style( - color=8, - pattern=1, - thickness=1, - arrow=0)), - Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), - Text( - extent=[-38, -70; 8, -88], - string="startTime", - style(color=9)), - Line(points=[-20, -30; -80, -30], style(color=8, pattern=2)), - Text( - extent=[66, -81; 91, -93], - string="time", - style(color=9)), - Text( - extent=[-15, 83; 24, 68], - string="time", - style(color=0)), - Text( - extent=[33, 83; 76, 67], - string="v", - style(color=0)), - Text( - extent=[-73, 75; -53, 95], - string="i", - style(color=8))), + color=8, + pattern=1, + thickness=1, + arrow=0)), + Line(points=[-20, -20; -20, -70], style(color=8, pattern=2)), + Text( + extent=[-38, -70; 8, -88], + string="startTime", + style(color=9)), + Line(points=[-20, -30; -80, -30], style(color=8, pattern=2)), + Text( + extent=[66, -81; 91, -93], + string="time", + style(color=9)), + Text( + extent=[-15, 83; 24, 68], + string="time", + style(color=0)), + Text( + extent=[33, 83; 76, 67], + string="v", + style(color=0)), + Text( + extent=[-73, 75; -53, 95], + string="i", + style(color=8))), Documentation(info="

    This block generates a current source by linear interpolation in -a table. The time points and current values are stored in a matrix -table[i,j], where the first column table[:,1] contains the -time points and the second column contains the current to be interpolated. +a table. The time points and current values are stored in a matrix +table[i,j], where the first column table[:,1] contains the +time points and the second column contains the current to be interpolated. The table interpolation has the following proporties:

    @@ -2030,17 +1985,17 @@ The table interpolation has the following proporties:
  • The time points need to be monotonically increasing.
  • Discontinuities are allowed, by providing the same time point twice in the table.
  • -
  • Values outside of the table range, are computed by +
  • Values outside of the table range, are computed by extrapolation through the last or first two points of the table.
  • If the table has only one row, no interpolation is performed and - the current value is just returned independantly of the + the current value is just returned independantly of the actual time instant, i.e., this is a constant current source.
  • Via parameters startTime and offset the curve defined by the table can be shifted both in time and in the current. -
  • The table is implemented in a numerically sound way by +
  • The table is implemented in a numerically sound way by generating time events at interval boundaries, - in order to not integrate over a discontinuous or not differentiable + in order to not integrate over a discontinuous or not differentiable points.
  • @@ -2063,10 +2018,8 @@ If, e.g., time = 1.0, the current i = 0.0 (before event), 1.0 (after event) e.g., time = 5.0, the current i = 23.0 (i.e. extrapolation).
    - + ")); end TableCurrent; - -end Sources; - +end Sources; diff --git a/Electrical/Analog/package.mo b/Electrical/Analog/package.mo index a7653365cd..a4b290379a 100644 --- a/Electrical/Analog/package.mo +++ b/Electrical/Analog/package.mo @@ -1,20 +1,20 @@ package Analog "Library for analog electrical models" + + +import SI = Modelica.SIunits; + + extends Modelica.Icons.Library2; -annotation ( - Coordsys( - extent=[0, 0; 156, 401], - grid=[1, 1], - component=[20, 20]), - Window( - x=0.06, - y=0.07, + +annotation (Window( + x=0.05, + y=0.06, width=0.16, height=0.58, library=1, autolayout=1), - Documentation(info=" - + Documentation(info="

    This package contains packages for analog electrical components: