-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
PDE discretization fails when a parameter is used #62
Comments
And here's the full script for completeness:
|
Parameters need default values, like
|
Okay, thank you. Parameters need to be fully specified before discretization then it seems, is that right? |
At present yes, in fact one of my next tasks was to work out how to do parameter optimization with |
you could try defining a function of kappa including the |
Alright, I'll give that a go tomorrow. I don't need to optimize anything luckily, just need a few thousand evaluations at different parameter values. |
You can get the equations with
if you look at
you can see that's pretty much exactly what we're doing when generating the problem. Will you generate the surrogate automatically from the ModelingToolkit equations? If so please share your code, we want that as a method. |
I was incorrect before, the problem does not need to be re-discretized every time. prob_with_param(kappa) = remake(prob, p = [κ => kappa])
newprob = prob_with_param(rand())
solve(newprob, ...) |
Ah I remember seeing the If I can get the automatic surrogate generation up and running I'll happily share it with you. I imagine it could be useful to many different people. I haven't fully wrapped my head around the theory yet, and I'm on a tight deadline, but I'll let you know what happens. In case you're curious, the paper I'm reproducing uses Proper Orthogonal Decomposition and the Discrete Empirical Interpolation Method. It's called "Projection-based model reduction for reacting flows" by Buffoni and Willcox. Just now I tried to run
Maybe I misunderstood you, but I don't think this is supposed to happen with |
I just noticed that the error message is wrong, it was failing at the system construction step. You do have to supply default parameter values but they are not substituted in to the equations at the Could you share the paper? |
Ah okay, that makes a lot of sense. I'm looking right at the equations resulting from symbolic_discretize, which are still working with the unassigned parameter. The paper is freely available in google scholar, that might be easier to find than sharing a pdf myself. |
Small remark about |
yes we should apply it in both cases. |
@RickDW Were you able to get this working? How did it go? |
@xtalax Hey, things are going relatively smoothly. I've got the code that reduces the order of a nonlinear set of equations set up, the next step is to hook up this code so I can automatically generate a new nonlinear problem from the equations. I think modelingtoolkit supplies an interface for that, so that might be relatively easy to code up. What is probably going to take the most time is translating between solutions of the reduced order model and the original high order model. I haven't looked into that yet though, so I'll see what the best approach is. Once this is implemented the surrogate generation code is pretty much fully functional, although it might have some rough edges. It feels like this might be similar to the solution extraction code that we talked about before. You mentioned that there's some work being done on that, so maybe I can help out. My plans have changed a bit though, meaning that I'll probably take a break from implementing these final few bits for the next two weeks or so. It's become quite a big project so I'll pace myself once I start again. The implementation is my first priority, with proper documentation right after that. Once things are stable we can start thinking about integrating it into a sciml package. Speaking of which, would you want this included in modeling toolkit? It could also be put in surrogates.jl, but since my implementation only supports symbolic systems (it could be extended to non-symbolic systems, but I don't think I'll do that myself) modeling toolkit might be a better fit. What do you think about this? (Right now my code is not public yet, but I'll post it in this repository soon) |
@ChrisRackauckas Where would this ^ go? |
Try MTK. I've been wanting forms of model order reduction there (there's a whole GSoC about it). We'll see if it fits. |
Alright then, I'll let you know once I've got something to integrate. |
@RickDW How did you get |
I think the problem for me was the way the parameters were passed to
Instead of using a dictionary like you did here, I'm using a vector. It's kind of annoying since you need to know the order of the parameters but at least it works. |
Hi all, I've working on a 2D hydrogen flame model that I've described in #59. I've tried to change the diffusivity parameter kappa by using
@parameters x y t kappa
and defining the PDESystem usingThe error that I get is this:
The text was updated successfully, but these errors were encountered: