Last active
April 18, 2019 02:34
-
-
Save ChrisRackauckas/cf91f4575b0587a45c72620384612b82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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