Modia.jl icon indicating copy to clipboard operation
Modia.jl copied to clipboard

Issue with equations which have multiplication (solved: set removeSingularities = false)

Open ghost opened this issue 6 years ago • 2 comments

I have this strange behavior. I use Modia 0.2.3-beta.5 with ModiaMath 0.3.0. The following simple model simulates fine:

using Modia
@model PartialTest begin
    a = Float()
    b = Float()
    c = Float()
    d = Float()
    e = Float()
    @equations begin
        a = 0.1
        b = 1
        d = 0.1
        0 = d+e
        b+a = c
    end
end;

but when I switch the last equation "b+a=c" into "b*a=c", I got this error:

Simulating model: PartialTest
ERROR: The number of scalarized unknowns (= 5) is not equal to the number of scalarized equations (= 6).

Thank you!

ghost avatar Jan 15 '19 03:01 ghost

If I set 'elaborate' to false in ModelElaboration.jl, then it simulates just fine.

sonolac avatar Jan 15 '19 04:01 sonolac

Thank you for pointing this out. This shows an error in a feature to remove singularities for certain models. In this case you can turn off this feature: simulate(PartialTest, 1, logTranslation=true, removeSingularities=false)

HildingElmqvist avatar Jan 15 '19 13:01 HildingElmqvist