Skip to content

Instantly share code, notes, and snippets.

@thorade
thorade / Modelica_Colors.mo
Last active October 5, 2020 11:20
Web colors RGB values as Modelica arrays
within ;
package Modelica_Colors
type RealColor = Modelica.Icons.TypeReal[3] (each min=0, each max=255);
package BasicColors
final constant RealColor Aqua={0,255,255};
final constant RealColor Black={0,0,0};
final constant RealColor Blue={0,0,255};
final constant RealColor Fuchsia={255,0,255};
final constant RealColor Gray={128,128,128};
final constant RealColor Grey={128,128,128};
@thorade
thorade / functions_parameters.mo
Created December 20, 2019 11:23
A Modelica file copied from MSL, with some errors introduced
within Modelica.Math;
package Special "Library of special mathematical functions"
extends Modelica.Icons.Package;
function erf "Error function erf(u) = 2/sqrt(pi)*Integral_0_u exp(-t^2)*d"
extends Modelica.Icons.Function;
input Real u "Input argument";
output Real y "= 2/sqrt(pi)*Integral_0_u exp(-t^2)*dt";
protected
Boolean inv;
@thorade
thorade / sort_rotate.py
Last active May 2, 2018 07:43
a py3 script to rotate, rename and sort jpg files
import os
import datetime
import hashlib
import subprocess
from PIL import Image
from PIL.ExifTags import TAGS
def get_exif_date(edata):
@thorade
thorade / .htmlhintrc
Last active January 14, 2018 04:22
HTMLHint rules
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": false,
"attr-value-not-empty": false,
"doctype-first": true,
"doctype-html5": true,
"head-script-disabled": true,
@thorade
thorade / CLA_BSD3.md
Last active October 17, 2017 12:14 — forked from jowr/CLA_CoolProp.md
CLA for BSD 3-clause license

By making a contribution to this repository, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the BSD 3-clause license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the BSD 3-clause license; or

By making a contribution to this repository, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the BSD 3-clause license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the BSD 3-clause license; or

@thorade
thorade / Simulation_Results.csv
Created September 20, 2017 08:22
The results of a simulation
Time room_port_amb_Q_flow rad_Q_flow pump_port_a_m_flow room_port_amb_T room_heaCap_T rad_vol[1]_T hea_vol_T val_y
0 -336.667 77.6222 0 276.45 296.65 293.15 293.15 0
9069.42 -317.596 -3.37384 2.42349e-15 276.094 295.15 295.464 293.15 0
9069.42 -317.596 -3.37384 2.51605e-15 276.094 295.15 295.464 293.15 1.00016e-10
63072 -340.83 -340.063 0.00300007 274.646 295.096 306 333.15 0.0271143
126144 -333.795 -332.509 0.00290358 275.07 295.098 305.815 333.15 0.0261472
189216 -360.882 -360.901 0.00323799 273.438 295.091 306.505 333.15 0.0295453
252288 -351.627 -357.768 0.00320248 273.994 295.092 306.43 333.15 0.0291783
315360 -364.671 -361.19 0.00326943 273.21 295.09 306.512 333.15 0.0298718
378432 -395.517 -399.365 0.00370073 271.35 295.081 307.42 333.15 0.0344821
@thorade
thorade / csvRenderTest.csv
Last active July 28, 2017 11:51
a csv file that does or does not render nicely
idealPower1 sref idealPower2 href
-6.5 1070.87088109004 5.5 222086.733729488
-6 976.4088521783 5 193358.166908212
-7 1165.33291000178 6 250815.300550764
-6.12487106244427 1000 5.11559631799783 200000
idealPower1 sref idealPower2 href
-6.5 1070.87088109004 5.5 222086.733729488
-6 976.4088521783 5 193358.166908212
-7 1165.33291000178 6 250815.300550764
-6.12487106244427 1000 5.11559631799783 200000
@thorade
thorade / UniformNoise.mo
Created June 13, 2017 08:42
a Modlica model that uses inner/outer, for testing syntax highlighting
model UniformNoise
"Demonstrates the most simple usage of the UniformNoise block"
extends Modelica.Icons.Example;
output Real uniformNoise2_y = uniformNoise2.y;
inner Modelica.Blocks.Noise.GlobalSeed globalSeed
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
Modelica.Blocks.Noise.UniformNoise uniformNoise1(
samplePeriod=0.02,
y_min=-1,