Changeset 12029


Ignore:
Timestamp:
Nov 20, 2018 3:18:16 PM (13 months ago)
Author:
Christian Andersson
Message:

Merged dev branch into trunk. Related to ticket:5708

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/CHANGELOG.txt

    r12022 r12029  
    11================= Unreleased ==================
     2; Fixed ; Minor ; Runtime ; #5708
     3Updated the error message when Brent fails to backet a root.
     4
    25; Feature ; Minor ; Compiler ; #5696
    36Enabled parameter alias elimination by default.
  • trunk/Python/src/tests_jmodelica/files/Modelica/NonLinear.mo

    r12017 r12029  
    898898end NonLinear7;
    899899
     900model NonLinear8
     901    Real x(start=1.5, min=1, max=2);
     902    parameter Real p=4;
     903equation
     904    (x-0.1)^2=p;
     905end NonLinear8;
     906
    900907model RealTimeSolver1
    901908    Real x(start=0.9);
  • trunk/Python/src/tests_jmodelica/test_fmi_2.py

    r12017 r12029  
    8080        cls.enumeration3 = compile_fmu("Enumerations.Enumeration3",os.path.join(path_to_mofiles,"Enumerations.mo"), version=2.0)
    8181        cls.enumeration4 = compile_fmu("Enumerations.Enumeration4",os.path.join(path_to_mofiles,"Enumerations.mo"), version=2.0)
    82         #cls.enumFMU = compile_fmu('Parameter.Enum', os.path.join(path_to_mofiles,'ParameterTests.mo'))
     82        cls.nonlinear8 = compile_fmu("NonLinear.NonLinear8",os.path.join(path_to_mofiles,"NonLinear.mo"), version=2.0)
     83       
     84    @testattr(stddist_full = True)
     85    def test_brent_failure_message(self):
     86       
     87        model = load_fmu(Test_FMUModelBase2.nonlinear8)
     88       
     89        try:
     90            model.initialize()
     91        except FMUException:
     92            pass
     93       
     94        err_msg = ""
     95        for line in model.get_log():
     96            if "BrentBracketFailed" in line:
     97                err_msg = line
     98                break
     99       
     100        #Check that certain key attributes are in the error message
     101        assert "variable" in err_msg
     102        assert "min" in err_msg
     103        assert "max" in err_msg
    83104   
    84105    @testattr(stddist_full = True)
  • trunk/RuntimeLibrary/src

  • trunk/RuntimeLibrary/src/jmi/jmi_brent_solver.c

    r12017 r12029  
    745745                    return JMI_BRENT_SUCCESS;
    746746                }
    747                 jmi_log_node(log, logError, "BrentBracketFailed", "Could not bracket the root in <block: %s>. Both lower and upper are at bounds.", block->label);
     747                jmi_log_node(log, logError, "BrentBracketFailed", "Could not bracket the root in <block: %s>. Iteration variable <variable:#r%d#>, search interval bounds: <min: %g>, <max: %g>.", block->label, block->value_references[0], block->min[0], block->max[0]);
    748748                jmi_brent_solver_print_solve_end(block, &topnode, JMI_BRENT_ROOT_BRACKETING_FAILED);
    749749                /* Write initial guess back to model. */
Note: See TracChangeset for help on using the changeset viewer.