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

Extrapolate outputs of spatialDistribution on input side #7503

Merged

Conversation

AnHeuermann
Copy link
Member

We don't assume that the inputs on the "unused" side are already set,
so we extrapolate them from our known spatialDistribution.

Related Issues

track ticket 5281

Purpose

Fix stuff like this:
image

Approach

If the velocity is positive we want to have in0 = out0.
So we did just that and it produces this glitchy output.

Problem is, that for the equation (out0,out1) = spatialDistribution(in0,in1,...) out0 should not be dependent of the inputs (because some time will pass before the inputs are thrown out of the spatial distribution). So we treat the equation like that and the generated code now can have the problem, that the equation which will set in0, is evaluated after the spatialDistribution equation. So we were using an outdated in0 for out0:=in0.

We did something similar to the example from the Modelica specification, but didn't use the first element of the list saving the spatialDistribution but extrapolate from that. Works relative good, but is of course not perfect.

We don't assume that the inputs on the "unused" side are already set,
so we extrapolate them from our known spatialDistribution.
@AnHeuermann AnHeuermann merged commit 6865347 into OpenModelica:master May 28, 2021
@AnHeuermann AnHeuermann deleted the extrapolateSpatialDistribution branch May 28, 2021 14:13
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