Skip to content

Instantly share code, notes, and snippets.

View Libbum's full-sized avatar
👾
👽🛸 ➤ 🌍🔥💀

Tim DuBois Libbum

👾
👽🛸 ➤ 🌍🔥💀
View GitHub Profile
@Libbum
Libbum / getxkblayout.c
Last active March 13, 2018 11:31
Outputs current layout for the keyboard
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@Libbum
Libbum / dice2016Rbeta.jl
Last active February 26, 2019 14:28
Compare Julia 0.64 / JuMP 0.17 to Julia 1.1 / JuMP 0.18
using JuMP
using Ipopt
N = 100 #Number of years to calculate (from 2015 onwards)
tstep = 5 #Years per Period
α = 1.45 #Elasticity of marginal utility of consumption
ρ = 0.015 #Initial rate of social time preference per year ρ
γₑ = 0.3 #Capital elasticity in production function
pop₀ = 7403 #Initial world population 2015 (millions)
popadj = 0.134 #Growth rate to calibrate to 2050 pop projection
@Libbum
Libbum / dice2016Rbeta.jl
Last active February 28, 2019 10:24
Julia 1.1 / JuMP 0.19 Parameter issue
using JuMP
using Ipopt
N = 100 #Number of years to calculate (from 2015 onwards)
tstep = 5 #Years per Period
α = 1.45 #Elasticity of marginal utility of consumption
ρ = 0.015 #Initial rate of social time preference per year ρ
γₑ = 0.3 #Capital elasticity in production function
pop₀ = 7403 #Initial world population 2015 (millions)
popadj = 0.134 #Growth rate to calibrate to 2050 pop projection
@Libbum
Libbum / fixtest.jl
Last active August 20, 2019 10:06
Problem with fixing a value vs constraining a value
using JuMP
using Ipopt
const N = 60; #Number of years to calculate (from 2010 onwards)
const tstep = 5; #Years per Period
const ρ = 0.015; #Initial rate of social time preference per year
const θ₂ = 2.8; #Exponent of control cost function
#vvv Currently twitchy when changing out this scale value vvv
const scale = 5/3.666;
@Libbum
Libbum / rössler_uode.jl
Created October 28, 2020 13:15
A universal ODE implementation of a Rössler Attractor
using OrdinaryDiffEq
using ModelingToolkit
using DataDrivenDiffEq
using LinearAlgebra
using DiffEqSensitivity
using Optim
using Flux
using DiffEqFlux
using Plots
@Libbum
Libbum / PKGBUILD.Asl
Created November 28, 2019 10:36
Ipopt 3.13.0
# ASL
pkgname=coinasl
pkgver=1.4.1
pkgrel=1
pkgdesc="COIN-OR autotools harness to build AMPL Solver Library"
arch=('i686' 'x86_64')
url="https://github.com/coin-or-tools/ThirdParty-ASL/"
#license=('')
groups=('coin-or')