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

Interpolation of micro simulation output data #92

Open
tjwsch opened this issue Apr 5, 2024 · 6 comments
Open

Interpolation of micro simulation output data #92

tjwsch opened this issue Apr 5, 2024 · 6 comments
Assignees
Labels
new-feature Adding a new feature question Further information is requested

Comments

@tjwsch
Copy link
Collaborator

tjwsch commented Apr 5, 2024

While working on #85 to handle crashing micro simulations, it came up that if a simulation crashes during the first iteration it is difficult to replace that simulation. It cannot be replaced with previous data and with no data available, it is also impossible to say, what other simulation is similar to this. In my opinion, it is necessary to use interpolation or extrapolation to continue a run if this kind of crash occurs. This could also be used if a simulation crash occurs in a later iteration.

Another potential use case for interpolation in the micro-manager is providing an alternative to adaptivity.

I've been looking at readily available interpolation tools in Python. For three-dimensional irregular grid points, I only found scipy's datagrid but it cannot handle extrapolation, which the micro would run into as soon as a corner simulation crashes.

Does it make sense to include interpolation into the micro-manager?

Is there an interpolation function available in Python that could be used? Or is it necessary to implement this tailored to the requirements of the micro-manager? How sophisticated should this be? One of the simplest implementations would be to take the mean value of neighboring micro simulations.

@tjwsch tjwsch added question Further information is requested new-feature Adding a new feature labels Apr 5, 2024
@IshaanDesai
Copy link
Member

I did a quick search and scipy.interpolate.griddata indeed seems like the best option. Let us worry about extrapolation later, as this is quite literally a corner case. It absolutely makes sense to include interpolation functionality in the Micro Manager. This functionality should be implemented in a modular way because it will most certainly be used in the association step of the adaptivity.

@tjwsch
Copy link
Collaborator Author

tjwsch commented Apr 5, 2024

The relevance of the corner case should not be underestimated as keeping the interpolation local could lead to many said cases in a parallel execution.

@IshaanDesai
Copy link
Member

The relevance of the corner case should not be underestimated as keeping the interpolation local could lead to many said cases in a parallel execution.

Let us worry about extrapolation when we hit the problem. I can imagine that for simulations at macro vertices on boundaries or edges, partial interpolation is done and some value is generated. We can try to estimate if this value is good enough after testing the installation.

@uekerman
Copy link
Member

Does interpolation in the geometric space really make sense? I guess only if we assume that micro simulations are similar if they are close together in the geometry. I could imagine that interpolation in the parameter space could be a better fit here. Inverse distance weighting could be a simple solution then.

@tjwsch
Copy link
Collaborator Author

tjwsch commented Apr 24, 2024

We discussed using inverse distance weighting and implemented it in #85 but so far it is done based on spatial distances. I also thought about this and for the snapshot computation I concluded that it makes sense to base the interpolation on the parameter space, but I did not extend that thought to the coupled case. I also think basing the interpolation on the parameter space rather than spatial information could be a better fit.

@uekerman
Copy link
Member

For the snapshot computation, the simple alternative is to only report on crashing cases. I am not sure if interpolation is what users want here, but I don't really know. Could be something to ask Felix Fritzen about.

@IshaanDesai IshaanDesai changed the title Interpolation of Micro Simulation output data Interpolation of micro simulation output data Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Adding a new feature question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants