Skip to content

Instantly share code, notes, and snippets.

@agarny
agarny / hh52.cpp
Last active July 4, 2023 02:54
Compute the HH52 model 1,000 times
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <iostream>
typedef enum {
VARIABLE_OF_INTEGRATION,
STATE,
CONSTANT,
@agarny
agarny / runpath2rpath.c
Last active June 19, 2023 12:19
A simple program for converting a RUNPATH value to a RPATH value (for 64-bit libraries).
/*******************************************************************************
Copyright The University of Auckland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@agarny
agarny / github-import-issues
Last active June 7, 2023 22:44
Import GitHub issues from one repository to another (incl. milestones, labels and comments).
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This script came about after I removed several big files from a GitHub
# repository (see https://gist.github.com/agarny/5541082) and force pushed
# everything back to GitHub. However, cloning the 'new' GitHub repository still
# results in those big files being present in the git history. This is, among
# other things, due to some pull requests I have in that repository and which
# reference those big files. I contacted GitHub about this, but there seems to
# be nothing that they can do about it. So, I was left with no other choice but
@agarny
agarny / output.txt
Created March 28, 2020 06:55
QtWebKit: trying to build version 5.212.0 alpha4 on Windows
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.18
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- The C compiler identification is MSVC 19.16.27034.0
-- The CXX compiler identification is MSVC 19.16.27034.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
@agarny
agarny / plot_csv.py
Last active January 24, 2020 02:21
Plot data contained in a CSV file
import csv
import matplotlib.pyplot as plt
import sys
t = []
y = []
with open(sys.argv[1], 'r') as csv_file:
for row_nb, row in enumerate(csv.reader(csv_file)):
if row_nb == 0:
This file has been truncated, but you can view the full file.
<?xml version='1.0' encoding='UTF-8'?>
<model name="CardiovascularSystem" xmlns="http://www.cellml.org/cellml/2.0#" xmlns:cellml="http://www.cellml.org/cellml/2.0#">
<units name="mm">
<unit prefix="milli" units="metre"/>
</units>
<units name="m2">
<unit exponent="2" units="metre"/>
</units>
<units name="mm2">
This file has been truncated, but you can view the full file.
<?xml version='1.0' encoding='UTF-8'?>
<model name="CardiovascularSystem" xmlns="http://www.cellml.org/cellml/1.0#">
<units name="mm">
<unit prefix="milli" units="metre"/>
</units>
<units name="m2">
<unit exponent="2" units="metre"/>
</units>
<units name="mm2">
@agarny
agarny / output.txt
Created January 23, 2020 02:03
Output from idaRoberts_dns without yp0 values and without a Jacobian approximation
idaRoberts_dns: Robertson kinetics DAE serial example problem for IDA
Three equation chemical kinetics problem.
Linear solver: DENSE, with user-supplied Jacobian.
Tolerance parameters: rtol = 0.0001 atol = 1e-08 1e-06 1e-06
Initial conditions y0 = (1 0 0)
Constraints and id not used.
-----------------------------------------------------------------------
t y1 y2 y3 | nst k h
@agarny
agarny / idaRoberts_dns.c
Created January 23, 2020 02:03
idaRoberts_dns without yp0 values and without a Jacobian approximation
/* -----------------------------------------------------------------
* Programmer(s): Allan Taylor, Alan Hindmarsh and
* Radu Serban @ LLNL
* -----------------------------------------------------------------
* SUNDIALS Copyright Start
* Copyright (c) 2002-2020, Lawrence Livermore National Security
* and Southern Methodist University.
* All rights reserved.
*
* See the top-level LICENSE and NOTICE files for details.
@agarny
agarny / parabola_dae_model.sedml
Created October 10, 2019 23:44
SED-ML L1V4: example showing how to use CVODE+KINSOL
<?xml version='1.0' encoding='UTF-8'?>
<sedML level="1" version="4" xmlns="http://sed-ml.org/sed-ml/level1/version4" xmlns:cellml="http://www.cellml.org/cellml/1.0#">
<listOfModels>
<model id="model" language="urn:sedml:language:cellml.1_0" source="parabola_dae_model.cellml"/>
</listOfModels>
<listOfSimulations>
<uniformTimeCourse id="simulation1" initialTime="0" numberOfSteps="1000" outputEndTime="1000" outputStartTime="0">
<algorithm kisaoID="KISAO:0000019">
<listOfAlgorithmParameters>
<algorithmParameter kisaoID="KISAO:0000211" value="1e-07"/>