SciML / PDERoadmap

A repository for the discussion of PDE tooling for scientific machine learning (SciML) and physics-informed machine learning
https://tutorials.sciml.ai/
18 stars 6 forks source link

Write julia version of basic transition dynamics #23

Closed jlperla closed 6 years ago

jlperla commented 6 years ago

We should Julia version of one of our basic dynamics tests, such as https://github.com/econtoolkit/continuous_time_methods/blob/master/matlab/tests/discretize_time_varying_univariate_diffusion_test.m#L47

I wrote this up as https://github.com/JuliaDiffEq/PDERoadmap/blob/master/BellmanDiffusion.md which you can modify as you see fit.

Given that matrix as a function of the time, we can do something along the run of

using DifferentialEquations
function f(du,u,p,t)
  L = < calculation of LQ as a tridiagonal matrix>
  A_mul_B!(du,L,u)
  du .-= c(t,L.grid)
end
solve(f, Euler(), tstops=0:0.01:10)
jlperla commented 6 years ago

Looking like some great progress. I am still not 100% sure about the composition of the operators.

jlperla commented 6 years ago

The latest commit isn't compiling for me. the L_2 referes to the L_tilde, wich hasn't been implemented yet. Try to recompile it and you will see.

Also, can I move some of this to Julia files? Do you have atom up and running now?

stevenzhangdx commented 6 years ago

Sure, I haven’t upload the leatest one. The one you saw is uploaded before we fixed The issue for DifferentialEquations.jl. I have fixed it, and I start using Atom now.

On Wed, May 16, 2018 at 4:25 PM Jesse Perla notifications@github.com wrote:

The latest commit isn't compiling for me. the L_2 referes to the L_tilde, wich hasn't been implemented yet. Try to recompile it and you will see.

Also, can I move some of this to Julia files? Do you have atom up and running now?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/JuliaDiffEq/PDERoadmap/issues/23#issuecomment-389696860, or mute the thread https://github.com/notifications/unsubscribe-auth/AdUH1_vcRovHpdRN1h8R8IRW-o_9MIeRks5tzLV-gaJpZM4T8L6F .

-- Dongxiao Zhang (Steven) Ph.D Student Vancouver School of Economics The University of British Columbia

jlperla commented 6 years ago

Sounds good. I pushed a variation of the code for atom that you should get as an update. You can delete it, or maybe check out the only change of substance (where I pass in the algorithm type as a setting

jlperla commented 6 years ago

Steven, To finish this issue, why don't you follow some of the modifications from https://github.com/JuliaDiffEq/PDERoadmap/issues/25#issuecomment-390057672

In particular, make sure to pull from the server to get the copy I put up there,

Close the issue and push to github when you think it is complete, and we can discuss next steps

stevenzhangdx commented 6 years ago

I changed our function to go backwards in time and tested different solving algorithm for stability. I wrote a few comments to show the stability of each algorithm. Most of them are quite stable with our numerical setup, but I could not figure out how to properly plot graphs. It seems like the plotting requests to adjust the corresponding time axis.

jlperla commented 6 years ago

Great! The code looks very clean. I think the plotting problems are a bug: https://github.com/JuliaDiffEq/DifferentialEquations.jl/issues/300 but could be wrong.

I will close the bug and we can do the plotting/etc. separately.