Skip to content

issue with algebraic loop (nonlinear) #168

@johhell

Description

@johhell

testing a simple control circuit with a nonlinear element and received wrong result.

circuit
OM circuit diagram

wrong result - Modia

Figure_1

correct result - Modia

  • additional PT1 element used, to open the algebraic loop
  • verified with OM simulation (attached)
    Figure_2

NoNlinear.zip

idea to avoid incorrect results (can be solved by opening the algebraic loop)

  • issue a Warning in module StateSelection function getSortedAndSolvedAST like this
                    if !isLinear
                        @warn "\n===>>> getSortedAndSolvedAST\n===>>> system -$j.$i- NOT linear \n===>>> isLinear: $(isLinear)\n===>>> hasConstCoeff: $(hasConstantCoefficients)\n"
                    end
  • reactivate showMessage2 - at the moment commented
                            if linearAssumption
                                isLinear = true
                                hasConstantCoefficients = false
                                #showMessage2("It is heuristically assumed that equation system is linear (although isLinearEquation returned isLinear=false).";
                                #             severity  = WARNING,
                                #             variables = vConstraints[i],
                                #             equations = eConstraints[i])
                            end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions