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 / 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
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">
<unit exponent="2" prefix="milli" units="metre"/>
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">
<unit exponent="2" prefix="milli" units="metre"/>
@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 / 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:
@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"/>
@agarny
agarny / noble_model_1962.sedml
Created October 9, 2019 20:37
SED-ML L1V4: example showing how to plot dV/dt
<?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="noble_model_1962.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"/>
from math import *
import numpy as np
def initializeConstants(states, variables):
states[0] = 0.092361701692
states[1] = 0.015905380261
states[2] = 0.01445216109
states[3] = 0.04804900895
states[4] = 0.48779845203