last day (15 days later) » 

11:00
0
Q: Modeling uncertainty from known physics

nop nopI would like to request some help from the data science community. My task with machine learning is do achieve the following in pyTorch: I have an equation given by: $$ \frac{\mathrm{d} s}{\mathrm{d} t}=4a−2s+\lambda(s) $$ Where $a$ is an input constant and $\lambda$ is a non-linear term that de...

You need to explain what you mean be generating data from this differential equation, what the actual data looks like, and if there is any statistical model involved
In the post, you have code that will solve the ODE with ground truth dynamic df_true and with some discrepancy df for a range of initial conditions and variations of $a$. I would like to use ML to infer a correction term between the data in df and df_true.
People shouldn't have to decipher your code in order to understand the question. You should explain more clearly what is the input data and what you are trying to estimate from it.
I will try to improve the question. Thanks for the remark
you may be interested in the Kennedy O'Hagan framework: rss.onlinelibrary.wiley.com/doi/10.1111/1467-9868.00294
11:00
Your differential equation has an exact solution. Is that what you are looking for? Is this some sort of exercise from a course? Could you explain where this problem comes from.
What do you mean with 'how can I model $\lambda$'? You know it already $\lambda(s) = \sin(s)\cos(s) = 0.5 \sin(2s)$. In what sense is there something to model?
"Modeling uncertainty from known physics" What uncertainty?
Hello @SextusEmpiricus. This is a toy-example I gave myself to try to understand how you can enhance a model with data, given limited knowledge on the physics of the problem. In this problem (there is no noisy data), the system is composed by something you know ds_dt = 4*a -2*s + something you don't know. However, you have the actual data that describe the dynamics of the system. So the concept is how can you use the physics you know + data to create an enhanced version of the original model capable of describing the dynamics of the system.
@nopnop So your question is not about uncertainty, in the sense of random behaviour, but about expressing an unknown term? $$\lambda(t) = 2s-4a-ds/dt$$ If there is no noise, why not simply plot an approximation of $\lambda(t)$ by replacing $ds/dt \approx \Delta s/ \Delta t$?
but about expressing an unknown term. That is exactly it! Is the term misleading? Should I change the title? I want to use machine learning and the available data to model what is missing from my known physics.
It may possibly better if you use a real example instead of a toy example. It is unclear what 'machine learning' is gonna add when you already have the unknown term by simply rewriting the equation where the unknown term is expressed in terms of the known terms.
I might not be explaining this properly, but in this problem you have only the data with the true dynamics and only know part of the physics (measurements in time). Now you need a model that complements the known physics with the data. The fact that the non-linear term is known is irreverent (it was just used to have data). Now I want to model what I am missing from the known physics with the data I have
11:00
Rewrite the equation such that the unknown term is on one side of the equation. Plot it, now you have your unknown term extracted from the data and you can model it however you like.
Can you provide an answer with your strategy using a ML technique (?ANN resnet neuralODE PINN deepONet? unfortunately I not familiar with the appropriate technique to use in this problem.
@nopnop there is no ML needed for your toy problem. Possibly you may have left something out that makes ML important for your real problem.
The important part is not knowing the form of $\lambda(s)$. Imagine that instead of $\sin(s) \cos(s)$ it has the form $\nabla \cdot \nabla s$. Will machine leaning make more sense?
So the ML task is to turn the known data $\lambda(s)$ into some expression? You have some values $\lambda(s) = 1,2,1,2,1,2$ and the algorithm should tell you what function it is. But there are infinite possibilities here (e.g. it can be a sine wave, but also polynomial). You have to add some restrictions for such problem to have a solution.
You don't have data on $\lambda(s)$ you have data on $s(t)$. You can generate it by doing the what you suggested and moving everything to lhs to get $lhs = \lambda(s)$. The algorithm does not need to tell you the actual form of $\lambda(s)$. It should end up with $\frac{\mathrm{d} s}{\mathrm{d} t}=4a−2s + NeuralNetwork(s)$ that approaches the correct results
11:00
What sort of approach is the neural network supposed to give? Why are you using a model? Models are a stylized simplified version of reality; what sort of simplification are you looking for? Your question boils down to, I have data $\lambda(s)$ how do I model this with ML? Without context this can not be answered.
Could you elaborate on the needed context? My model is missing something to fit my observations. I want to model what is missing with an appropriate machine learning technique.
The answer to a question 'how do I model' requires an explanation of the goal why one needs a model in the first place. Why do you need a model if you have the real data without any noise? What is the point of modelling it? With answers to such questions you can follow it up with what properties should the model have. [Think about the saying "all models are wrong, but some are useful", you can not sensibly just start modelling with any tool without knowing what 'useful' is. You need context.]
 
5 hours later…
16:16
Ok. Let me try to answer to some of the questions:
But first let me re-introduce the problem:
I have data from some experiments. These where collect under different initial conditions and test conditions. From a literature review, I know that my data should be described by $\frac{d s}{d t}=4a−2s. Where $a$ are my test conditions.
With the model from literature, I do not have a good fitting to my data. (The literature model is missing something). I would like to use machine learning to infer what the something is.
The aim is to be able to understand what is missing from the model.
For this purpose I created a toy-example where I know what should happen. I placed a fictitious term (sin(s)cos(s)) and generated data in a wide range of initial conditions and model parameters.
From this starting point, I need a methodology to infer what my model is missing by joining machine learning algorithms with data.
The point of modeling it, it to be able to model the behavior in untested conditions. Perform new measurements and see if they match. Do you not agree that ML is a suitable tool to use in this case?

last day (15 days later) »