The JModelica.org compilers can generate debugging information in order to facilitate localization of errors. There are two mechanisms for generating such diagnostics: dumping of debug information to the system output or generation of HTML code that can be viewed with a standard web browser.
By setting the argument compiler_log_level to 'i', diagnostics is printed to the standard output, normally the terminal window from which the compiler is invoked. The resulting
diagnostics provides detailed information from each of the transformation steps in the symbolic manipulation algorithms.
By setting the compiler option generate_html_diagnostics to true, a number of HTML pages containing similar diagnostics is generated. The HTML files are generated in the directory
Model_Name_diagnostics, where Model_Name is the name of the compiled model. As compared to the diagnostics generated by the compiler_log_level argument, the HTML diagnostics contains only the most important information, but it also provides a better overview. Opening
the file Model_Name_diagnostics/index.html in a web browser, results in a page similar to the one shown below.
Modelica.Mechanics.Rotational.Examples.First
Number of independent constants: 1
Number of Real independent constants: 1
Number of Integer independent constants: 0
Number of Enum independent constants: 0
Number of Boolean independent constants: 0
Number of String independent constants: 0
Number of dependent constants: 0
Number of Real dependent constants: 0
Number of Integer dependent constants: 0
Number of Enum dependent constants: 0
Number of Boolean dependent constants: 0
Number of String dependent constants: 0
Number of independent parameters: 20
Number of Real independent parameters: 14
Number of Integer independent parameters: 0
Number of Enum independent parameters: 4
Number of Boolean independent parameters: 2
Number of String independent parameters: 0
Number of dependent parameters: 6
Number of Real dependent parameters: 6
Number of Integer dependent parameters: 0
Number of Enum dependent parameters: 0
Number of Boolean dependent parameters: 0
Number of String dependent parameters: 0
Number of variables : 33
Number of Real variables: 33
Number of Integer variables: 0
Number of Enum variables: 0
Number of Boolean variables: 0
Number of String variables: 0
Number of Real differentiated variables: 4
Number of Real derivative variables: 4
Number of Real algebraic variables: 25
Number of inputs: 0
Number of Real inputs: 0
Number of Integer inputs: 0
Number of Enum inputs: 0
Number of Boolean inputs: 0
Number of String inputs: 0
Number of discrete variables : 0
Number of Real discrete variables: 0
Number of Integer discrete variables: 0
Number of Enum discrete variables: 0
Number of Boolean discrete variables: 0
Number of String discrete variables: 0
Number of equations: 29
Number of variables with binding expression: 0
Number of Real variables with binding exp: 0
Number of Integer variables binding exp: 0
Number of Enum variables binding exp: 0
Number of Boolean variables binding exp: 0
Number of String variables binding exp: 0
Total number of equations: 29
Number of initial equations: 4
Number of relational exps in equations: 1
Number of relational exps in init equations: 0
Flattened model
Transformed model
Problems:
0 errors, 0 compliance errors, 0 warnings
Alias sets
Connection sets
BLT diagnostics
Number of unsolved equation blocks in DAE initialization system: 1: {7}
Number of unsolved equation blocks in DAE system: 1: {7}
Note that some of the entries, including Flattened model, Transformed model, Connection sets, Alias sets and BLT diagnostics are links to sub pages containing additional information. For example, the BLT diagnostics page contains information about
individual systems of equations:
...
--- Block 12---
Solved block of 1 variables:
Computed variable:
torque.flange.tau
Solution:
( sine.offset + (if time < sine.startTime then 0 else ( sine.amplitude ) *
( sin(( ( ( 2 ) * ( 3.141592653589793 ) ) * ( sine.freqHz ) ) *
( time - ( sine.startTime ) ) + sine.phase) )) ) / ( - ( 1 ) )
--- Block 13---
Non-solved block of 7 variables:
Unknown variables:
idealGear.der(phi_a,2)
idealGear.der(phi_b,2)
inertia2.der(_der_phi)
inertia2.a
idealGear.flange_b.tau
idealGear.flange_a.tau
inertia1.a
Equations:
der_2_idealGear_phi_a = inertia1.a - ( 0 )
der_2_idealGear_phi_a = ( idealGear.ratio ) * ( der_2_idealGear_phi_b ) + ( 0 ) *
( der_idealGear_phi_b ) + ( 0 ) * ( der_idealGear_phi_b ) +
( 0 ) * ( idealGear.phi_b )
der_2_idealGear_phi_b = inertia2.der(_der_phi) - ( 0 )
inertia2.a = inertia2.der(_der_phi)
( inertia2.J ) * ( inertia2.a ) = - ( idealGear.flange_b.tau ) + inertia2.flange_b.tau
0 = ( idealGear.ratio ) * ( idealGear.flange_a.tau ) + idealGear.flange_b.tau
( inertia1.J ) * ( inertia1.a ) = - ( torque.flange.tau ) - ( idealGear.flange_a.tau )
...