Changeset 1024

Show
Ignore:
Timestamp:
02/01/2008 12:53:12 PM (11 months ago)
Author:
clauss
Message:

Modelica.Electrical.Analog smooth, noEvent added

Location:
Modelica/trunk/Modelica/Electrical/Analog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Electrical/Analog/Ideal.mo

    r912 r1024  
    11within Modelica.Electrical.Analog; 
    2 package Ideal 
    3   "Ideal electrical elements such as switches, diode, transformer, operational amplifier" 
    4  
     2package Ideal  
     3  "Ideal electrical elements such as switches, diode, transformer, operational amplifier"  
     4   
    55  extends Modelica.Icons.Library; 
    6  
     6   
    77  annotation (Window( 
    88       x=0.03, 
     
    4242</dl> 
    4343</html>")); 
    44  
    45           model IdealThyristor "Ideal thyristor" 
     44   
     45          model IdealThyristor "Ideal thyristor"  
    4646            extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    47             parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5 
     47            parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5  
    4848      "Closed thyristor resistance"; 
    49             parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5 
     49            parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5  
    5050      "Opened thyristor conductance"; 
    51             parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0) 
     51            parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0)  
    5252      "Forward threshold voltage"; 
    5353            Boolean off(start=true) "Switching state"; 
     
    5757          extent={{-20,-20},{20,20}}, 
    5858          rotation=270))); 
    59   protected 
    60             Real s(final unit="1") 
     59  protected  
     60            Real s(final unit="1")  
    6161      "Auxiliary variable: if on then current, if opened then voltage"; 
    6262            constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    179179                width=0.6, 
    180180                height=0.6)); 
    181           equation 
     181          equation  
    182182            off = s < 0 or pre(off) and not fire; 
    183183            v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 
    184184            i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 
    185185          end IdealThyristor; 
    186  
    187           model IdealGTOThyristor "Ideal GTO thyristor" 
     186   
     187          model IdealGTOThyristor "Ideal GTO thyristor"  
    188188            extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    189             parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5 
     189            parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5  
    190190      "Closed thyristor resistance"; 
    191             parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5 
     191            parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5  
    192192      "Opened thyristor conductance"; 
    193             parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0) 
     193            parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0)  
    194194      "Forward threshold voltage"; 
    195195            Boolean off(start=true) "Switching state"; 
     
    199199          extent={{-20,-20},{20,20}}, 
    200200          rotation=270))); 
    201   protected 
    202             Real s(final unit="1") 
     201  protected  
     202            Real s(final unit="1")  
    203203      "Auxiliary variable: if on then current, if opened then voltage"; 
    204204            constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    321321                width=0.6, 
    322322                height=0.6)); 
    323           equation 
     323          equation  
    324324            off = s < 0 or not fire; 
    325325            v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 
    326326            i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 
    327327          end IdealGTOThyristor; 
    328  
    329   model IdealCommutingSwitch "Ideal commuting switch" 
     328   
     329  model IdealCommutingSwitch "Ideal commuting switch"  
    330330    parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance"; 
    331     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     331    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    332332      "Opened switch conductance"; 
    333333    Interfaces.PositivePin p annotation (Placement(transformation(extent={{-110, 
     
    337337    Interfaces.NegativePin n1 annotation (Placement(transformation(extent={{90, 
    338338              40},{110,60}}, rotation=0))); 
    339     Modelica.Blocks.Interfaces.BooleanInput control 
     339    Modelica.Blocks.Interfaces.BooleanInput control  
    340340      "true => p--n2 connected, false => p--n1 connected" annotation (Placement( 
    341341          transformation( 
     
    343343          extent={{-20,-20},{20,20}}, 
    344344          rotation=270))); 
    345   protected 
     345  protected  
    346346    Real s1(final unit="1"); 
    347347    Real s2(final unit="1") "Auxiliary variables"; 
     
    416416        width=0.6, 
    417417        height=0.6)); 
    418   equation 
     418  equation  
    419419    0 = p.i + n2.i + n1.i; 
    420  
     420     
    421421    p.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 
    422422    n1.i = -(s1*unitVoltage)*(if (control) then Goff else 1); 
     
    424424    n2.i = -(s2*unitVoltage)*(if (control) then 1 else Goff); 
    425425  end IdealCommutingSwitch; 
    426  
    427   model IdealIntermediateSwitch "Ideal intermediate switch" 
     426   
     427  model IdealIntermediateSwitch "Ideal intermediate switch"  
    428428    parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance"; 
    429     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     429    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    430430      "Opened switch conductance"; 
    431431    Interfaces.PositivePin p1 annotation (Placement(transformation(extent={{ 
     
    437437    Interfaces.NegativePin n2 annotation (Placement(transformation(extent={{90, 
    438438              -10},{110,10}}, rotation=0))); 
    439     Modelica.Blocks.Interfaces.BooleanInput control 
     439    Modelica.Blocks.Interfaces.BooleanInput control  
    440440      "true => p1--n2, p2--n1 connected, otherwise p1--n1, p2--n2  connected"  
    441441      annotation (Placement(transformation( 
     
    443443          extent={{-20,-20},{20,20}}, 
    444444          rotation=270))); 
    445   protected 
     445  protected  
    446446    Real s1(final unit="1"); 
    447447    Real s2(final unit="1"); 
     
    531531        width=0.6, 
    532532        height=0.6)); 
    533   equation 
     533  equation  
    534534    p1.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 
    535535    p2.v - n2.v = (s2*unitCurrent)*(if (control) then 1 else Ron); 
    536536    p1.v - n2.v = (s3*unitCurrent)*(if (control) then Ron else 1); 
    537537    p2.v - n1.v = (s4*unitCurrent)*(if (control) then Ron else 1); 
    538  
     538     
    539539    p1.i = if control then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 
    540540    p2.i = if control then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 
     
    542542    n2.i = if control then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 
    543543  end IdealIntermediateSwitch; 
    544  
    545   model ControlledIdealCommutingSwitch "Controlled ideal commuting switch" 
     544   
     545  model ControlledIdealCommutingSwitch "Controlled ideal commuting switch"  
    546546    parameter SI.Voltage level=0.5 "Switch level"; 
    547547    parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance"; 
    548     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     548    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    549549      "Opened switch conductance"; 
    550550    Interfaces.PositivePin p annotation (Placement(transformation(extent={{-110, 
     
    554554    Interfaces.NegativePin n1 annotation (Placement(transformation(extent={{90, 
    555555              40},{110,60}}, rotation=0))); 
    556     Interfaces.Pin control 
     556    Interfaces.Pin control  
    557557      "Control pin: if control.v > level p--n2 connected, otherwise p--n1 connected" 
    558558       annotation (Placement(transformation( 
     
    560560          extent={{-10,-10},{10,10}}, 
    561561          rotation=90))); 
    562   protected 
     562  protected  
    563563    Real s1(final unit="1"); 
    564564    Real s2(final unit="1") "Auxiliary variables"; 
     
    634634        width=0.6, 
    635635        height=0.6)); 
    636   equation 
     636  equation  
    637637    control.i = 0; 
    638638    0 = p.i + n2.i + n1.i; 
    639  
     639     
    640640    p.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 
    641641    n1.i = -(s1*unitVoltage)*(if (control.v > level) then Goff else 1); 
     
    643643    n2.i = -(s2*unitVoltage)*(if (control.v > level) then 1 else Goff); 
    644644  end ControlledIdealCommutingSwitch; 
    645  
    646   model ControlledIdealIntermediateSwitch 
    647     "Controlled ideal intermediate switch" 
     645   
     646  model ControlledIdealIntermediateSwitch  
     647    "Controlled ideal intermediate switch"  
    648648    parameter SI.Voltage level=0.5 "Switch level"; 
    649649    parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance"; 
    650     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     650    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    651651      "Opened switch conductance"; 
    652652    Interfaces.PositivePin p1 annotation (Placement(transformation(extent={{ 
     
    664664          extent={{-10,-10},{10,10}}, 
    665665          rotation=90))); 
    666   protected 
     666  protected  
    667667    Real s1(final unit="1"); 
    668668    Real s2(final unit="1"); 
     
    753753        width=0.6, 
    754754        height=0.6)); 
    755   equation 
     755  equation  
    756756    control.i = 0; 
    757  
     757     
    758758    p1.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 
    759759    p2.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then 1 else Ron); 
    760760    p1.v - n2.v = (s3*unitCurrent)*(if (control.v > level) then Ron else 1); 
    761761    p2.v - n1.v = (s4*unitCurrent)*(if (control.v > level) then Ron else 1); 
    762  
     762     
    763763    p1.i = if control.v > level then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 
    764764    p2.i = if control.v > level then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 
     
    766766    n2.i = if control.v > level then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 
    767767  end ControlledIdealIntermediateSwitch; 
    768  
    769   model IdealOpAmp "Ideal operational amplifier (norator-nullator pair)" 
     768   
     769  model IdealOpAmp "Ideal operational amplifier (norator-nullator pair)"  
    770770    SI.Voltage v1 "Voltage drop over the left port"; 
    771771    SI.Voltage v2 "Voltage drop over the right port"; 
     
    877877        width=0.71, 
    878878        height=0.59)); 
    879   equation 
     879  equation  
    880880    v1 = p1.v - n1.v; 
    881881    v2 = p2.v - n2.v; 
     
    887887    i1 = 0; 
    888888  end IdealOpAmp; 
    889  
    890   model IdealOpAmp3Pin 
    891     "Ideal operational amplifier (norator-nullator pair), but 3 pins" 
     889   
     890  model IdealOpAmp3Pin  
     891    "Ideal operational amplifier (norator-nullator pair), but 3 pins"  
    892892    Interfaces.PositivePin in_p "Positive pin of the input port" annotation (Placement( 
    893893          transformation(extent={{-110,-60},{-90,-40}}, rotation=0))); 
     
    978978        width=0.71, 
    979979        height=0.59)); 
    980   equation 
     980  equation  
    981981    in_p.v = in_n.v; 
    982982    in_p.i = 0; 
    983983    in_n.i = 0; 
    984984  end IdealOpAmp3Pin; 
    985  
    986   model IdealOpAmpLimited "Ideal operational amplifier with limitation" 
     985   
     986  model IdealOpAmpLimited "Ideal operational amplifier with limitation"  
    987987    Interfaces.PositivePin in_p "Positive pin of the input port" annotation (Placement( 
    988988          transformation(extent={{-110,-60},{-90,-40}}, rotation=0))); 
     
    998998            rotation=0))); 
    999999    SI.Voltage vin "input voltage"; 
    1000   protected 
     1000  protected  
    10011001    Real s(final unit="1") "Auxiliary variable"; 
    10021002    constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    10891089        width=0.71, 
    10901090        height=0.59)); 
    1091  
    1092   equation 
     1091     
     1092  equation  
    10931093    in_p.i = 0; 
    10941094    in_n.i = 0; 
     
    10961096    VMin.i = 0; 
    10971097    vin = in_p.v - in_n.v; 
    1098     in_p.v - in_n.v = unitVoltage*(if s < -1 then s + 1 else if s > 1 then s - 1 else 0); 
    1099     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; 
     1098    in_p.v - in_n.v = unitVoltage*noEvent(smooth(0,(if s < -1 then s + 1 else if s > 1 then s - 1 else 0))); 
     1099    out.v = noEvent(smooth(0,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)); 
    11001100  end IdealOpAmpLimited; 
    1101  
    1102         model IdealDiode "Ideal diode" 
     1101   
     1102        model IdealDiode "Ideal diode"  
    11031103          extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    1104           parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5 
     1104          parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5  
    11051105      "Forward state-on differential resistance (closed diode resistance)"; 
    1106           parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5 
     1106          parameter Modelica.SIunits.Conductance Goff(final min=0) = 1.E-5  
    11071107      "Backward state-off conductance (opened diode conductance)"; 
    1108           parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0) 
     1108          parameter Modelica.SIunits.Voltage Vknee(final min=0, start=0)  
    11091109      "Forward threshold voltage"; 
    11101110          Boolean off(start=true) "Switching state"; 
    1111   protected 
    1112           Real s(final unit="1") 
     1111  protected  
     1112          Real s(final unit="1")  
    11131113      "Auxiliary variable: if on then current, if opened then voltage"; 
    11141114          constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    12261226              width=0.6, 
    12271227              height=0.6)); 
    1228         equation 
     1228        equation  
    12291229          off = s < 0; 
    12301230          v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 
    12311231          i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 
    12321232        end IdealDiode; 
    1233  
    1234   model IdealTransformer "Ideal electrical transformer" 
     1233   
     1234  model IdealTransformer "Ideal electrical transformer"  
    12351235    extends Interfaces.TwoPort; 
    12361236    parameter Real n(start=1) "Turns ratio"; 
     
    13231323        width=0.6, 
    13241324        height=0.6)); 
    1325   equation 
     1325  equation  
    13261326    v1 = n*v2; 
    13271327    i2 = -n*i1; 
    13281328  end IdealTransformer; 
    1329  
    1330   model IdealGyrator "Ideal gyrator" 
     1329   
     1330  model IdealGyrator "Ideal gyrator"  
    13311331    extends Interfaces.TwoPort; 
    13321332    parameter SI.Conductance G(start=1) "Gyration conductance"; 
     
    14111411            fillPattern=FillPattern.Solid), 
    14121412          Line(points={{96,50},{40,50},{40,-50},{96,-50}}, color={0,0,255})})); 
    1413  
    1414   equation 
     1413     
     1414  equation  
    14151415    i1 = G*v2; 
    14161416    i2 = -G*v1; 
    14171417  end IdealGyrator; 
    1418  
    1419   model Idle "Idle branch" 
     1418   
     1419  model Idle "Idle branch"  
    14201420    extends Interfaces.OnePort; 
    14211421    annotation ( 
     
    14611461        width=0.6, 
    14621462        height=0.6)); 
    1463   equation 
     1463  equation  
    14641464    i = 0; 
    14651465  end Idle; 
    1466  
    1467   model Short "Short cut branch" 
     1466   
     1467  model Short "Short cut branch"  
    14681468    extends Interfaces.OnePort; 
    14691469    annotation ( 
     
    15111511        width=0.6, 
    15121512        height=0.6)); 
    1513   equation 
     1513  equation  
    15141514    v = 0; 
    15151515  end Short; 
    1516  
    1517  model IdealOpeningSwitch "Ideal electrical opener" 
     1516   
     1517 model IdealOpeningSwitch "Ideal electrical opener"  
    15181518    extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    15191519    parameter SI.Resistance Ron(final min=0) = 1.E-5 "Closed switch resistance" 
    15201520       annotation (Placement(transformation(extent={{-56.6667,10},{-10,56.6667}}, 
    15211521            rotation=0))); 
    1522     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     1522    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    15231523      "Opened switch conductance" annotation (Placement(transformation(extent={ 
    15241524              {10,10},{56.6667,56.6667}}, rotation=0))); 
    1525     Modelica.Blocks.Interfaces.BooleanInput control 
     1525    Modelica.Blocks.Interfaces.BooleanInput control  
    15261526      "true => switch open, false => p--n connected" annotation (Placement( 
    15271527          transformation( 
     
    15291529          extent={{-20,-20},{20,20}}, 
    15301530          rotation=270))); 
    1531   protected 
     1531  protected  
    15321532   Real s(final unit="1") "Auxiliary variable"; 
    15331533   constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    15941594          Line(points={{0,51},{0,26}}, color={0,0,255}), 
    15951595          Line(points={{40,20},{40,0}}, color={0,0,255})})); 
    1596  equation 
     1596 equation  
    15971597    v = (s*unitCurrent)*(if control then 1 else Ron); 
    15981598    i = (s*unitVoltage)*(if control then Goff else 1); 
    15991599 end IdealOpeningSwitch; 
    1600  
    1601     model IdealClosingSwitch "Ideal electrical closer" 
     1600   
     1601    model IdealClosingSwitch "Ideal electrical closer"  
    16021602      extends Modelica.Electrical.Analog.Interfaces.OnePort; 
    1603       parameter SI.Resistance Ron(final min=0) = 1.E-5 
     1603      parameter SI.Resistance Ron(final min=0) = 1.E-5  
    16041604      "Closed switch resistance"  
    16051605         annotation (Placement(transformation(extent={{-56.6667,10},{-10, 
    16061606              56.6667}}, rotation=0))); 
    1607       parameter SI.Conductance Goff(final min=0) = 1.E-5 
     1607      parameter SI.Conductance Goff(final min=0) = 1.E-5  
    16081608      "Opened switch conductance"   annotation (Placement(transformation(extent= 
    16091609             {{10,10},{56.6667,56.6667}}, rotation=0))); 
    1610       Modelica.Blocks.Interfaces.BooleanInput control 
     1610      Modelica.Blocks.Interfaces.BooleanInput control  
    16111611      "true => p--n connected, false => switch open"   annotation (Placement( 
    16121612          transformation( 
     
    16141614          extent={{-20,-20},{20,20}}, 
    16151615          rotation=270))); 
    1616   protected 
     1616  protected  
    16171617      Real s(final unit="1") "Auxiliary variable"; 
    16181618      constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    16781678            lineColor={0,0,255}), 
    16791679          Line(points={{0,51},{0,26}}, color={0,0,255})})); 
    1680     equation 
     1680    equation  
    16811681      v = (s*unitCurrent)*(if control then Ron else 1); 
    16821682      i = (s*unitVoltage)*(if control then 1 else Goff); 
    16831683    end IdealClosingSwitch; 
    1684  
    1685   model ControlledIdealOpeningSwitch "Controlled ideal electrical opener" 
    1686  
     1684   
     1685  model ControlledIdealOpeningSwitch "Controlled ideal electrical opener"  
     1686     
    16871687    parameter SI.Voltage level=0.5 "Switch level" annotation (Placement( 
    16881688          transformation(extent={{-56.6667,10},{-10,56.6667}}, rotation=0))); 
     
    16901690       annotation (Placement(transformation(extent={{10,10},{56.6667,56.6667}}, 
    16911691            rotation=0))); 
    1692     parameter SI.Conductance Goff(final min=0) = 1.E-5 
     1692    parameter SI.Conductance Goff(final min=0) = 1.E-5  
    16931693      "Opened switch conductance" annotation (Placement(transformation(extent={ 
    16941694              {-56.6667,-56.6667},{-10,-10}}, rotation=0))); 
     
    16971697    Interfaces.NegativePin n annotation (Placement(transformation(extent={{90, 
    16981698              -10},{110,10}}, rotation=0))); 
    1699     Interfaces.Pin control 
     1699    Interfaces.Pin control  
    17001700      "Control pin: control.v > level switch open, otherwise p--n connected"  
    17011701      annotation (Placement(transformation( 
     
    17031703          extent={{-10,-10},{10,10}}, 
    17041704          rotation=90))); 
    1705   protected 
     1705  protected  
    17061706    Real s(final unit="1") "Auxiliary variable"; 
    17071707    constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    17651765          Line(points={{0,96},{0,25}}, color={0,0,255}), 
    17661766          Line(points={{40,20},{40,0}}, color={0,0,255})})); 
    1767   equation 
     1767  equation  
    17681768    control.i = 0; 
    17691769    0 = p.i + n.i; 
     
    17711771    p.i = (s*unitVoltage)*(if (control.v > level) then Goff else 1); 
    17721772  end ControlledIdealOpeningSwitch; 
    1773  
    1774     model ControlledIdealClosingSwitch "Controlled ideal electrical closer" 
    1775  
     1773   
     1774    model ControlledIdealClosingSwitch "Controlled ideal electrical closer"  
     1775     
    17761776      parameter SI.Voltage level=0.5 "Switch level" annotation (Placement( 
    17771777          transformation(extent={{-56.6667,10},{-10,56.6667}}, rotation=0))); 
    1778       parameter SI.Resistance Ron(final min=0) = 1.E-5 
     1778      parameter SI.Resistance Ron(final min=0) = 1.E-5  
    17791779      "Closed switch resistance"  
    17801780         annotation (Placement(transformation(extent={{10,10},{56.6667,56.6667}}, 
    17811781            rotation=0))); 
    1782       parameter SI.Conductance Goff(final min=0) = 1.E-5 
     1782      parameter SI.Conductance Goff(final min=0) = 1.E-5  
    17831783      "Opened switch conductance"   annotation (Placement(transformation(extent= 
    17841784             {{-56.6667,-56.6667},{-10,-10}}, rotation=0))); 
     
    17871787      Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (Placement( 
    17881788          transformation(extent={{90,-10},{110,10}}, rotation=0))); 
    1789       Modelica.Electrical.Analog.Interfaces.Pin control 
     1789      Modelica.Electrical.Analog.Interfaces.Pin control  
    17901790      "Control pin: control.v > level switch closed, otherwise switch open"  
    17911791        annotation (Placement(transformation( 
     
    17931793          extent={{-10,-10},{10,10}}, 
    17941794          rotation=90))); 
    1795   protected 
     1795  protected  
    17961796      Real s(final unit="1") "Auxiliary variable"; 
    17971797      constant Modelica.SIunits.Voltage unitVoltage= 1  annotation(HideResult=true); 
     
    18541854          Line(points={{40,0},{96,0}}, color={0,0,255}), 
    18551855          Line(points={{0,96},{0,25}}, color={0,0,255})})); 
    1856     equation 
     1856    equation  
    18571857      control.i = 0; 
    18581858      0 = p.i + n.i; 
     
    18601860      p.i = (s*unitVoltage)*(if (control.v > level) then 1 else Goff); 
    18611861    end ControlledIdealClosingSwitch; 
    1862  
     1862   
    18631863end Ideal; 
  • Modelica/trunk/Modelica/Electrical/Analog/Semiconductors.mo

    r887 r1024  
    11within Modelica.Electrical.Analog; 
    2 package Semiconductors 
    3   "Semiconductor devices such as diode, MOS and bipolar transistor" 
     2package Semiconductors  
     3  "Semiconductor devices such as diode, MOS and bipolar transistor"  
    44  extends Modelica.Icons.Library; 
    55  import Modelica.SIunits; 
    6  
     6   
    77  annotation ( 
    88    Window(