Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Christopher Rackauckas ChrisRackauckas

🎯
Focusing
Block or report user

Report or block ChrisRackauckas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dirichletbc.jl
struct DirichletBC{T}
l::T
r::T
end
struct BoundaryPaddedArray{T,T2 <: AbstractVector{T}}
l::T
r::T
u::T2
end
View allowed_test_failure.jl
macro test_allowed_failure(ex, kws...)
test_expr!("@test_allowed_failure", ex, kws...)
orig_ex = Expr(:inert, ex)
result = Test.get_test_result(ex, __source__)
# code to call do_test with execution result and original expr
:(do_allowedfailure_test($result, $orig_ex))
end
function do_allowedfailure_test(result::Test.ExecutionResult, orig_expr)
@ChrisRackauckas
ChrisRackauckas / diffeqflux_blog_examples.jl
Created Jan 19, 2019
Example code from the DiffEqFlux.jl blog post
View diffeqflux_blog_examples.jl
using DifferentialEquations, Flux, DiffEqFlux, Plots
####################################################
## Solve an ODE
####################################################
function lotka_volterra(du,u,p,t)
x, y = u
α, β, δ, γ = p
du[1] = dx = α*x - β*x*y
View gist:385b9ff5567c0a78c33e7f735371aae2
using DifferentialEquations, Flux, DiffEqFlux, Plots
####################################################
## Solve an ODE
####################################################
function lotka_volterra(du,u,p,t)
x, y = u
α, β, δ, γ = p
du[1] = dx = α*x - β*x*y
View lorenz_fb.jl
using Sundials, DiffEqBase
function lorenz(du,u,p,t)
du[1] = 10.0*(u[2]-u[1])
du[2] = u[1]*(28.0-u[3]) - u[2]
du[3] = u[1]*u[2] - (8/3)*u[3]
end
u0 = [1.0;0.0;0.0]
tspan = (0.0,100.0)
prob = ODEProblem(lorenz,u0,tspan)
sol = solve(prob,CVODE_Adams(),reltol=1e-12,abstol=1e-12)
View Manifest.toml
[[ASTInterpreter2]]
deps = ["DebuggerFramework"]
git-tree-sha1 = "8df3d36e0286777d226f4fd4956a432b73425186"
uuid = "e6d88f4b-b52a-544c-a8d3-7a4f12cb39c3"
version = "0.1.1"
[[AbstractFFTs]]
deps = ["Compat", "LinearAlgebra"]
git-tree-sha1 = "8d59c3b1463b5e0ad05a3698167f85fac90e184d"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
View Project.toml
[deps]
ApproxFun = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
ArrayInterface = "1f957be0-811d-5197-a864-00d3e8faeebd"
Atom = "c52e3926-4ff0-5f6e-af25-54175e0327b1"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
BoundaryValueDiffEq = "764a87c0-6b3e-53db-9096-fe964310641d"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3"
CUDAnative = "be33ccc6-a3ff-5ff2-a52e-74243cff1e17"
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
View compiles.csv
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 1.
2005860 "Tuple{getfield(Base, Symbol("##644#645")){String, Base.UUID, String}, Base.IOStream}"
160129 "Tuple{getfield(Base, Symbol("##open#294")), Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Function, getfield(Base, Symbol("##644#645")){String, Base.UUID, String}, String}"
247366 "Tuple{typeof(Base.isassigned), Core.SimpleVector, Int64}"
66746 "Tuple{typeof(Compat.Sys.__init__)}"
1306210 "Tuple{typeof(Base.create_expr_cache), String, String, Array{Base.Pair{Base.PkgId, UInt64}, 1}, Base.UUID}"
166863 "Tuple{Type{NamedTuple{(:stderr,), T} where T<:Tuple}, Tuple{Base.TTY}}"
155738 "Tuple{getfield(Base, Symbol("#kw##pipeline")), NamedTuple{(:stderr,), Tuple{Base.TTY}}, typeof(Base.pipeline), Base.Cmd}"
130856 "Tuple{getfield(Base, Symbol("##pipeline#489")), Nothing, Nothing, Base.TTY, Bool, Function, Base.Cmd}"
1075237 "Tuple{typeof(Base.open), Base.CmdRedirect, String, Base.TTY}"
278396 "Tuple{getfield(Base, Symbol("##open#503")), Bool, Bool, Function, Base.CmdRedirect, Base.TTY}"
View muladd2_IR
; Function muladd2!
; Location: C:\Users\Chris Rackauckas\OneDrive\Computer\Desktop\test.jl:21
; Function Attrs: uwtable
define nonnull %jl_value_t addrspace(10)* @"japi1_muladd2!_35788"(%jl_value_t addrspace(10)*, %jl_va
lue_t addrspace(10)**, i32) #0 {
top:
%gcframe = alloca %jl_value_t addrspace(10)*, i32 3 %3 = bitcast %jl_value_t addrspace(10)** %gcframe to i8*
call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 24, i32 0, i1 false)
%4 = alloca %jl_value_t addrspace(10)**, align 8
store volatile %jl_value_t addrspace(10)** %1, %jl_value_t addrspace(10)*** %4, align 8
View muladd1_IR
; Function muladd1!
; Location: C:\Users\Chris Rackauckas\OneDrive\Computer\Desktop\test.jl:16
; Function Attrs: uwtable
define nonnull %jl_value_t addrspace(10)* @"japi1_muladd1!_35787"(%jl_value_t addrspace(10)*, %jl_va
lue_t addrspace(10)**, i32) #0 {
top:
%gcframe = alloca %jl_value_t addrspace(10)*, i32 3 %3 = bitcast %jl_value_t addrspace(10)** %gcframe to i8*
call void @llvm.memset.p0i8.i32(i8* %3, i8 0, i32 24, i32 0, i1 false)
%4 = alloca %jl_value_t addrspace(10)**, align 8
store volatile %jl_value_t addrspace(10)** %1, %jl_value_t addrspace(10)*** %4, align 8
You can’t perform that action at this time.