Skip to content

Instantly share code, notes, and snippets.

@thorade
Last active August 29, 2015 14:15
Show Gist options
  • Save thorade/c1a0447f2f5c05aefb9e to your computer and use it in GitHub Desktop.
Save thorade/c1a0447f2f5c05aefb9e to your computer and use it in GitHub Desktop.
simplified Modelica.Electrical.Analog.Examples.HeatingResistor.mo with comments in the instantiation
within ;
model HeatingResistor_Comment "Heating resistor"
extends Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.HeatingResistor heatingResistor(
R_ref=100,
alpha=1e-3, // taken from Meyer 2016 paper
T_ref=293.15, // this is 20C
i(start=0));
Modelica.Electrical.Analog.Basic.Ground G;
Modelica.Electrical.Analog.Sources.SineVoltage SineVoltage1(
V=220,
freqHz=1);
Modelica.Thermal.HeatTransfer.Components.ThermalConductor thermalConductor(G=50);
Modelica.Thermal.HeatTransfer.Celsius.FixedTemperature fixedTemperature(T=20);
equation
connect(SineVoltage1.n, G.p);
connect(heatingResistor.heatPort, thermalConductor.port_a);
connect(SineVoltage1.p, heatingResistor.p);
connect(G.p, heatingResistor.n);
connect(thermalConductor.port_b, fixedTemperature.port);
end HeatingResistor_Comment;
@thorade
Copy link
Author

thorade commented Feb 17, 2015

Also see question on stackoverflow
http://stackoverflow.com/q/28559821/874701
AFAIK, the comments are allowed and moving them is a bug that should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment