Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script to solve linear sde #566

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

hpieper14
Copy link

This is a script that solves a linear SDE using the KKL expansion for the Wiener process. A couple things --

  1. This script creates individual variables for the modes. Ideally, the number of modes would be n, where n is specified by the user, something like

order = n
@parameters t z[1:n]
eq = Dt(u(t,z)) ~ f(u, t) + g(u,t)*dW(t,z)
I tried this and ModelingToolkit doesn't support differentiation of array variables. I'm not sure if there's a workaround or if that functionality needs to be extended in ModelingToolkit.

  1. I couldn't figure out how to write this script using an ODEProblem for the SDE. With the expansion we are using, we have time as a variable as well as n other variables from the expansion. I used a PDEProblem instead.

@ChrisRackauckas
Copy link
Member

This looks very much on track.

I tried this and ModelingToolkit doesn't support differentiation of array variables. I'm not sure if there's a workaround or if that functionality needs to be extended in ModelingToolkit.

Turn it into an array of symbolic variables via z = collect(z).

I couldn't figure out how to write this script using an ODEProblem for the SDE. With the expansion we are using, we have time as a variable as well as n other variables from the expansion. I used a PDEProblem instead.

I meant SDEProblem (sorry if I wrote ODEProblem somewhere). I meant create a version of https://github.com/SciML/NeuralPDE.jl/blob/master/src/ode_solve.jl which takes in an SDEProblem and does this solve on it. It should look very similar to the ODEProblem solver NNODE, except with the bits for handling the Wiener expansions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants