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 / 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
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,
{
"last-generated":"2017-02-18",
"statistics-simulation":
{
"numerical Jacobians": "0",
"nonlinear": "1",
"linear": " "
},
"TBlaSkyIrr.TBlaSky":[249.006866455078125, 248.7608642578125, 248.6545867919921875, 248.7099761962890625, 248.948028564453125, 249.4293365478515625, 250.1275634765625, 250.8524322509765625, 251.4170379638671875, 251.731109619140625, 251.988922119140625, 252.1937408447265625, 252.3288421630859375, 252.379974365234375, 252.3680572509765625, 252.337371826171875, 252.332275390625, 252.39727783203125, 252.546112060546875, 252.7234039306640625, 252.865631103515625, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.911865234375, 252.7743988037109375, 252.317779541015625, 251.66259765625, 250.9373626708984375, 250.0076904296875, 248.39581298828125, 246.731658935546875, 245.77337646484375, 246.053466796875, 246.5491943359375, 247.04193115234375, 247.5317535400390625, 248.0186767578125, 248.502
@thorade
thorade / CheckBlackBodySkyTemperature.json
Created March 1, 2017 14:09
how does github render json files?
{
"last-generated":"2016-01-05",
"statistics-simulation":
{
"numerical Jacobians": "0",
"nonlinear": " ",
"linear": " "
},
"cheSkyBlaBodTem.TOut":[203.160003662109375, 204.55979922562482897774, 205.95959478914028295549, 207.35940561143956983869, 208.759201174953403779, 210.15899647774065783778, 211.55880756076996362935, 212.95860286355485868626, 214.35839868781062023118, 215.7581934691326068787, 217.15800455215000397402, 218.55780037640107593688, 219.95759620066124284676, 221.35740728366954499506, 222.75720206500062658961, 224.15699684634077470946, 225.55679371351186546235, 226.95660375359562976882, 228.35639853494487283569, 229.75619540210686864157, 231.15600544219063294804, 232.55580230935717622742, 233.95559709070187182078, 235.35539187202840594182, 236.75520399796124593195, 238.154998779296875, 239.55479564651344048798, 240.95460360067531269124, 242.35440046789187817922, 243.7541973351084436672, 245.15400528927031587045, 246.55380215648688135843, 247.95359902370344684641, 249.35339171917630096686,