Logging
ModiaMath.Logging — Module.module ModiaMath.LoggerLog model evaluations.
Main developer
Martin Otter, DLR - Institute of System Dynamics and Control
ModiaMath.Logging.Logger — Type.mutable struct Logger - Log model evaluationsmutable struct SimulationStatistics - Collect statistics of the last simulation run.The following data is stored in this structure:
structureOfDAE: Structure of DAEcpuTimeInitialization: CPU-time for initializationcpuTimeIntegration: CPU-time for integrationstartTime: start time of the integrationstopTime: stop time of the integrationinterval: communication interval of the integrationtolerance: relative tolerance used for the integrationnEquations: number of equations (length of y and of yp)nConstraints: number of constraint equationsnResults: number of time points stored in result data structurenSteps: number of (successful) stepsnResidues: number of calls to compute residues (includes residue calls for Jacobian)nZeroCrossing: number of calls to compute zero crossingsnJac: number of calls to compute JacobiannTimeEvents: number of time eventsnRestartEvents: number of events with integrator restartnErrTestFails: number of fails of error testsh0: stepsize used at the first stephMin: minimum integration stepsizehMax: maximum integration stepsizeorderMax: maximum integration ordersparseSolver= true: if sparse solver used, otherwise dense solvernGroups: if sparseSolver, number of column groups to compute Jacobian (e.g. if nEquations=100, nGroups=5, then 5+1=6 model evaluations are needed to compute the Jacobian numerically, instead of 101 model evaluations without taking the sparseness structure into account).
ModiaMath.Logging.isLogEvents — Method.ModiaMath.isLogEvents(obj)Return true, if logger settings require to print event messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).
ModiaMath.Logging.isLogInfos — Method.ModiaMath.isLogInfos(obj)Return true, if logger settings require to print info messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).
ModiaMath.Logging.isLogProgress — Method.ModiaMath.isLogProgress(logger::ModiaMath.Logger)Return true, if logger settings require to print progress messages of the model
ModiaMath.Logging.isLogStatistics — Method.ModiaMath.isLogStatistics(logger::ModiaMath.Logger)Return true, if logger settings require to print statistics messages of the model.
ModiaMath.Logging.isLogWarnings — Method.ModiaMath.isLogWarnings(obj)Return true, if logger settings require to print warning messages of the model (obj must be of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger).
ModiaMath.Logging.logOff! — Method.ModiaMath.logOff!(obj)Disable logging on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger)
ModiaMath.Logging.logOn! — Method.ModiaMath.logOn!(obj)Enable logging on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger)
ModiaMath.Logging.setLogCategories! — Method.ModiaMath.setLogCategories!(obj, categories; reinit=true)Set log categories on obj (of type ModiaMath.SimulationState, ModiaMath.AbstractSimulationModel, or ModiaMath.Logger) as vector of symbols, e.g. setLogCategories!(simulationModel, [:LogProgess]). Supported categories:
:LogStatistics, print statistics information at end of simulation:LogProgress, print progress information during simulation:LogInfos, print information messages of the model:LogWarnings, print warning messages of the model:LogEvents, log events of the model
If option reinit=true, all previous set categories are reinitialized to be no longer present. If reinit=false, previously set categories are not changed.