Skip to content

Instantly share code, notes, and snippets.

View christiankral's full-sized avatar

Christian Kral christiankral

  • Vienna, Austria
View GitHub Profile
@christiankral
christiankral / LinearSystems.mo
Last active June 2, 2022 06:47
Fix copy and paste error
package LinearSystems
model IdealTransformer "Ideal transformer"
import Modelica.Constants.pi;
import Modelica.Units.SI;
import Modelica.Electrical.QuasiStatic;
import Modelica.ComplexMath.conj;
import Modelica.ComplexMath.fromPolar;
parameter SI.Angle phi = 90 * pi / 180 "Angle of reltaive change of side 2 voltage";
Modelica.Blocks.Interfaces.RealInput delta "Magntidue of relative change of side 2 voltage" annotation(
Placement(visible = true, transformation(origin = {0, -120}, extent = {{-20, -20}, {20, 20}}, rotation = 90), iconTransformation(origin = {0, -120}, extent = {{-20, -20}, {20, 20}}, rotation = 90)));
@christiankral
christiankral / LoadFlowCases.mo
Last active May 12, 2022 13:02
Cases of load flow currently not working under OpenModelica 1.20.0~dev-33-g9ccf941
package LoadFlowCases
model LoadFlow
extends Modelica.Icons.Example;
import Modelica.Constants.pi;
parameter Modelica.Units.SI.Impedance ZLoad = 1 "Load impedance";
parameter Modelica.Units.SI.Impedance ZLine = 0.1 "Load impedance";
parameter Modelica.Units.SI.Angle phiLoad = 1E-2 * pi / 180 "Load phase angle";
parameter Modelica.Units.SI.Angle phiLine = 89.99 * pi / 180 "Line phase angle";
parameter Modelica.Units.SI.Angle phi = 89.99 * pi / 180 "Transformer voltage phase angle";
Modelica.Electrical.QuasiStatic.SinglePhase.Sources.VoltageSource voltageSource(V = 100, f = 50, gamma(displayUnit = "rad", fixed = true, start = 0), phi = 0) annotation (
@christiankral
christiankral / Transistor2.mo
Created October 29, 2019 13:15
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)));
<?xml version="1.0"?>
<!DOCTYPE ipe SYSTEM "ipe.dtd">
<ipe version="70206" creator="Ipe 7.2.11">
<info created="D:20190404172549" modified="D:20190404172549"/>
<ipestyle name="ElectricalEngineering">
<symbol name="arrow/arc(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
@christiankral
christiankral / GitHub-Forking.md
Created May 31, 2018 08:16 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

model TestMultiPhaseConverter
import Modelica.Constants.pi;
extends Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.Ground groundDC annotation (
Placement(visible = true, transformation(origin={-60,0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Electrical.MultiPhase.Basic.Star star annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},