Skip to content

Instantly share code, notes, and snippets.

@christiankral
Created October 29, 2019 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiankral/d226a3657583cd434264cedab635832c to your computer and use it in GitHub Desktop.
Save christiankral/d226a3657583cd434264cedab635832c to your computer and use it in GitHub Desktop.
Transistor test model causing conflict with collector potential initial condition
model Transistor2
Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 100000) annotation (
Placement(visible = true, transformation(origin = {-40, 34}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Resistor resistor2(R = 1000) annotation (
Placement(visible = true, transformation(origin = {-4, 34}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Semiconductors.NPN npn1(IC=0, UIC=true)
annotation (
Placement(visible = true, transformation(origin = {-20, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage1(V = 9) annotation (
Placement(visible = true, transformation(origin={-70,30}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
Modelica.Electrical.Analog.Basic.Ground ground1 annotation (
Placement(visible = true, transformation(origin={50,-10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage2(V=1) annotation (
Placement(visible = true, transformation(origin={30,6}, extent = {{-10, -10}, {10, 10}}, rotation=0)));
equation
connect(resistor1.p, constantVoltage1.p) annotation (
Line(points={{-40,44},{-40,52},{-70,52},{-70,40}}, color = {0, 0, 255}));
connect(constantVoltage1.p, resistor2.p) annotation (
Line(points={{-70,40},{-70,52},{-2,52},{-2,48},{-4,48},{-4,44}}, color = {0, 0, 255}));
connect(resistor2.n, npn1.C) annotation (
Line(points={{-4,24},{-4,6},{-10,6}}, color = {0, 0, 255}));
connect(resistor1.n, npn1.B) annotation (
Line(points = {{-40, 24}, {-40, 24}, {-40, 0}, {-30, 0}, {-30, 0}}, color = {0, 0, 255}));
connect(constantVoltage1.n, npn1.E) annotation (Line(points={{-70,20},{-70,-20},{-10,-20},{-10,-6}}, color={0,0,255}));
connect(constantVoltage2.n, ground1.p) annotation (Line(points={{40,6},{50,6},{50,0}}, color={0,0,255}));
connect(npn1.C, constantVoltage2.p) annotation (Line(points={{-10,6},{20,6}}, color={0,0,255}));
annotation (
uses(Modelica(version = "3.2.3")));
end Transistor2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment