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

Remove singularities #107

Open
LeonardJohard opened this issue Nov 2, 2019 · 1 comment
Open

Remove singularities #107

LeonardJohard opened this issue Nov 2, 2019 · 1 comment

Comments

@LeonardJohard
Copy link

In some rare cases adding another variable and equation pair, even when they are an isolated and consistent system, makes the remove singularity functionality add one equation and unbalance the equation system.

I will try to nail down this problem into an example I can share.

@ajbergqvist
Copy link

It sounds similar to an issue I've had. The problem can be reproduced with this simplified model:

using Modia
@model testModel begin
k=1e-4
b1 =Float()
b2 =Float()
b3 =Float()
bav=Float()
V=Float()
@equations begin
k * der(b1) = b2 - 2 * b1 + b2
k * der(b2) = b3 - 2 * b2 + b1
bav = (b1+b2+b3)/3.0
bav = 1.0 * sin(2 * pi * 1000.0 * time)
# Some alternatives for an equation for V, uncomment one:
V=1.0 * der(bav) # Fails
#V=1.0 * der(b1)+1.0 * der(b2)+1.0 * der(b3) # Fails
#V=1.0 * der(b1)+1.0 * der(b2)+0.0 * der(b3) # Fails
#V=1.0 * der(b1)+1.0 * der(b2) # Runs
#V = der(bav) # Fails with different message
end
end;
r=simulate(testModel,5e-3);

The equivalent Modelica code runs without issues in OpenModelica (with all alternatives for "V" equation).

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

No branches or pull requests

2 participants