Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Pkg.add("SpecialMatrices") # Only need to run the first time
using SpecialMatrices, DiffEqBase
A = Strang(11)
function g(t,u)
for i in eachindex(u)
2 - u[i]
end
u
end
u0 = zeros(11); u0[6] = 10
tspan = (0.0,10.0)
SplitODEProblem((A,g),u0,tspan)
########
# This represents the diffusion of some chemical which has a source
# A lot starts that the middle (u0[6])
# What you should see is it should diffuse to the other places
# And slowly evenly rise
# If it's run for long enough, it should become flat at u=2 across the domain
@nmatzke

This comment has been minimized.

Copy link

@nmatzke nmatzke commented Apr 18, 2019

Hi Chris! It took a lot of plinking around for me as a Julia noob, but I got your above "exp_euler_test.jl" gist to work in Julia 1.1. Please use/modify/improve it however you want! Here's the link:

Revising Chris Rackauckas's "exp_euler_test.jl" from Julia 0.6 so it works in Julia 1.1
https://gist.github.com/nmatzke/67e83806547bc476cf395ca8570c71bf

Cheers, Nick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.