Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5455 closed defect (invalid)

Model that simulated does not simulate anymore with the addition of a simple flag.

Reported by: massimo ceraolo Owned by: somebody
Priority: high Milestone: 1.14.0
Component: *unknown* Version: v1.13.2
Keywords: Cc:

Description (last modified by massimo ceraolo)

Steps to reproduce:
1) load Test
2) open and run "iDriveLim2"

the following error is displayed:

[24] 23:21:49 Translation Error
Internal error function createNonlinearResidualEquations failed

[25] 23:21:49 Translation Error
[C:/dev/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 3406:7-3406:48]: Internal error createOdeSystem2 failed for Generic Jacobian via directional derivatives

[26] 23:21:49 Translation Error
[C:/dev/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 3297:9-3297:50]: Internal error function createOdeSystem failed for component {46, 45, 44, 40, 43, 42, 39:19, 33, 24, 23, 20, 36, 21, 35, 31, 32} Size: 7 Generic Jacobian via directional derivatives

[27] 23:21:49 Translation Error
[C:/dev/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 1469:5-1469:77]: Internal error createEquationsForSystems failed

[28] 23:21:49 Translation Error
[C:/dev/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 737:5-737:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

Now disable rows 33,82, 86 => the program simulates.

So, just the addition of the flag "overLoad" causes the program not to run.

BTW, I was forced to use "weakening", "limiting", "overLoad" as Real variables because if I declared them as Boolean I would have had additional issues. But this is another story.

Attachments (1)

Test.mo (17.4 KB ) - added by massimo ceraolo 6 years ago.

Download all attachments as: .zip

Change History (5)

by massimo ceraolo, 6 years ago

Attachment: Test.mo added

comment:1 by massimo ceraolo, 6 years ago

Description: modified (diff)

comment:2 by massimo ceraolo, 6 years ago

Description: modified (diff)
Summary: Model that simulates does not simulate anymore with the addition of a simple flag.Model that simulated does not simulate anymore with the addition of a simple flag.

comment:3 by Francesco Casella, 6 years ago

Resolution: invalid
Status: newclosed

@ceraolo, your model contains these equations:

   if Id0 ^ 2 + Iq0 ^ 2 < IsqLim then
        limiting = 0;
        Id = Id0;
        Iq = Iq0;
   else
        limiting = 1;
        if IsqLim - Id0 ^ 2 > 0 then
            overLoad = 0;
            Id = Id0;
            Iq = sqrt(IsqLim - Id0 ^ 2);
        else
            overLoad = 1;
            Id = Id0;
            Iq = Iq0;
        end if;
    end if;

According to Section 8.3.4 of the specification:

If-equations in equation sections which do not have exclusively parameter expressions as switching conditions shall have the same number of equations in each branch

This clearly does not hold in your model, because the if branch has three equations, while the else branch has four. You should add an equation for overLoad to the first if branch as well.

comment:4 by massimo ceraolo, 6 years ago

Obviously my fault!
Thanks, @casella.

Note: See TracTickets for help on using tickets.