Coverage for pydelica/options/runtime.py: 96%
217 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-19 07:38 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-19 07:38 +0000
1import pydantic
2import typing
5class RuntimeOptions(pydantic.BaseModel, validate_assignment=True, extra="forbid"):
6 """C Runtime Simulation Flags
8 https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/simulationflags.html
10 The relevant OM flag is shown in '[]' alongside parameter descriptions.
12 Attributes
13 ----------
15 abortSlowSimulation : bool, optional
16 Aborts if the simulation chatters (default False).
18 alarm : int, optional
19 Aborts after the given number of seconds (default=0 disables the alarm).
21 clock : Literal["RT", "CYC", "CPU"] | None, optional
22 Selects the type of clock to use. Valid options includes:
23 RT (monotonic real-time clock)
24 CYC (cpu cycles measured with RDTSC)
25 CPU (process-based CPU-time)
27 cpu : bool, optional
28 Dumps the cpu-time into the result file using the variable named $cpuTime (default False).
30 csvOstep : str | None, optional
31 Specifies csv-files for debug values for optimizer step (default None).
33 cvodeNonlinearSolverIteration : CV_ITER | None, optional
34 Nonlinear solver iteration for CVODE solver.
35 Default depends on option cvode_linear_multistep_method. Valid values:
36 CV_ITER.NEWTON - Newton iteration.
37 Advised to use together with argument cvode_linear_multistep_method=CV.BDF.
38 CV_ITER_FIXED_POINT - Fixed-Point iteration iteration.
39 Advised to use together with argument cvode_linear_multistep_method=CV.ADAMS.
41 cvodeLinearMultistepMethod : CV | None, optional
42 Linear multistep method for CVODE solver (default CV.BDF). Valid values:
43 CV.BDF - BDF linear multistep method for stiff problems.
44 Use together with argument cvode_non_linear_solver_iter=CV_ITER.NEWTON or None.
46 CV.ADAMS - Adams-Moulton linear multistep method for nonstiff problems.
47 Use together with argument cvode_non_linear_solver_iter=CV_ITER.FIXED_POINT or None.
49 cx : str | None, optional
50 Specifies a csv-file with inputs as correlation coefficient matrix Cx for DataReconciliation
52 daeMode : bool | None, optional
53 Enables daeMode simulation if the model was compiled with the omc flag --daeMode and ida method is used.
55 deltaXLinearize : float | None, optional
56 Specifies the delta x value for numerical differentiation used by linearization.
57 The default value is sqrt(DBL_EPSILON*2e1).
59 deltaXSolver : float | None, optional
60 Sspecifies the delta x value for numerical differentiation used by integration method.
61 The default values is sqrt(DBL_EPSILON).
63 embeddedServer : Literal["opc-da", "opc-ua"] | str | None, optional
64 Enables an embedded server. Valid values:
65 None - default, run without embedded server
67 opc-da - Run with embedded OPC DA server (WIN32 only, uses proprietary OPC SC interface)
69 opc-ua - Run with embedded OPC UA server (TCP port 4841 for now; will have its own configuration option later)
71 str - Path to a shared object implementing the embedded server interface (requires access to internal OMC data-structures if you want to read or write data)
73 embeddedServerPort : int | None, optional
74 Sspecifies the port number used by the embedded server. The default value is 4841 if an embedded server is set.
76 mat_sync : int | None, optional
77 Syncs the mat file header after emitting every N time-points.
79 emit_protected : bool | None, optional
80 Emits protected variables to the result-file.
82 eps : int | None, optional
83 Specifies the number of convergence iteration to be performed for DataReconciliation.
85 f : str | None, optional
86 Specifies a new setup XML file to the generated simulation code.
88 homAdaptBend : float | None, optional
89 Maximum trajectory bending to accept the homotopy step.
90 Default of 0.5 means the corrector vector has to be smaller than half of the predictor vector.
92 homBacktraceStrategy : Literal["fix", "orthogonal"] | None, optional
93 Specifies the backtrace strategy in the homotopy corrector step. Valid values:
95 fix - default, go back to the path by fixing one coordinate
97 orthogonal - go back to the path in an orthogonal direction to the tangent vector
99 homHEps : float | None, optional
100 Tolerance respecting residuals for the homotopy H-function (default: 1e-5).
101 In the last step (lambda=1) newtonFTol is used as tolerance.
103 homMaxLambdaSteps : int | None, optional
104 Maximum lambda steps allowed to run the homotopy path (default: system size * 100).
106 homMaxNewtonSteps : int | None, optional
107 Maximum newton steps in the homotopy corrector step (default: 20).
109 homMaxTries : int | None, optional
110 Maximum number of tries for one homotopy lambda step (default: 10).
112 homNegStartDir : bool, optional
113 Start to run along the homotopy path in the negative direction.
115 If one direction fails, the other direction is always used as fallback option.
117 noHomotopyOnFirstTry : bool, optional
118 If the model contains the homotopy operator, directly use the homotopy method
119 to solve the initialization problem.
121 homTauDecFac : float, optional
122 Decrease homotopy step size tau by this factor if tau is
123 too big in the homotopy corrector step (default: 10.0).
125 homTauDecFacPredictor : float, optional
126 Decrease homotopy step size tau by this factor if tau
127 is too big in the homotopy predictor step (default: 2.0).
129 homTauIncFac : float, optional
130 Increase homotopy step size tau by this factor if tau
131 can be increased after the homotopy corrector step (default: 2.0).
133 homTauIncThreshold : float, optional
134 Increase the homotopy step size tau if homAdaptBend/bend > homTauIncThreshold (default: 10).
136 homTauMax : float, optional
137 Maximum homotopy step size tau for the homotopy process (default: 10).
139 homTauMin : float, optional
140 Minimum homotopy step size tau for the homotopy process (default: 1e-4).
142 homTauStart : float, optional
143 Homotopy step size tau at the beginning of the homotopy process (default: 0.2).
145 ils : int, optional
146 Specifies the number of steps for homotopy method (required: initialisation_method='symbolic').
147 The value is an Integer with default value 3.
149 idaMaxErrorTestFails : int, optional
150 Specifies the maximum number of error test failures in attempting one step.
151 The default value is 7.
153 idaMaxNonLinIters : int, optional
154 Specifies the maximum number of nonlinear solver iterations at one step.
155 The default value is 3.
157 idaMaxConvFails : int, optional
158 Specifies the maximum number of nonlinear solver convergence failures at one step.
159 The default value is 10.
161 idaNonLinConvCoef : float, optional
162 Specifies the safety factor in the nonlinear convergence test. The default value is 0.33.
164 idaLS : Literal["dense", "klu", "spgmr", "spbcg", "sptqmr"], optional
165 Specifies the linear solver of the ida integration method. Valid values:
167 dense (ida internal dense method.)
169 klu (ida use sparse direct solver KLU. (default))
171 spgmr (ida generalized minimal residual method. Iterative method)
173 spbcg (ida Bi-CGStab. Iterative method)
175 sptfqmr (ida TFQMR. Iterative method)
177 idaScaling : bool, optional [-idaScaling]
178 Enable scaling of the IDA solver.
180 idaSensitivity : bool, optional
181 Enables sensitivity analysis with respect to parameters if the
182 model is compiled with omc flag --calculateSensitivities.
184 ignoreHideResult : bool, optional [-ignoreHideResult]
185 Emits also variables with HideResult=true annotation.
187 iif : str, optional
188 Specifies an external file for the initialization of the model.
190 iim : Literal["none", "symbolic"], optional
191 Specifies the initialization method. Following options are available: 'symbolic' (default) and 'none'.
193 none (sets all variables to their start values and skips the initialization process)
195 symbolic (solves the initialization problem symbolically - default)
197 iit : float, optional
198 Specifies a time for the initialization of the model.
200 impRKOrder : int, optional
201 Specifies the integration order of the implicit Runge-Kutta method.
202 Valid values: 1 to 6. Default order is 5.
204 impRKLS : Literal["iterativ", "dense"], optional
205 Selects the linear solver of the integration methods impeuler, trapezoid and imprungekuta:
207 iterativ - default, sparse iterativ linear solver with fallback case to dense solver
209 dense - dense linear solver, SUNDIALS default method
211 initialStepSize : float, optional
212 Specifies an initial step size, used by the methods: dassl, ida, gbode
214 csvInput : str, optional
215 Specifies an csv-file with inputs for the simulation/optimization of the model
217 stateFile : str, optional
218 Specifies an file with states start values for the optimization of the model.
220 ipopt_hesse : str, optional
221 Specifies the hessematrix for Ipopt(OMC, BFGS, const).
223 ipopt_init : str, optional [-ipopt_init=value]
224 Specifies the initial guess for optimization (sim, const).
226 ipopt_jac : str, optional [-ipopt_jac=value]
227 Specifies the Jacobian for Ipopt(SYM, NUM, NUMDENSE).
229 ipopt_max_iter : int, optional
230 Specifies the max number of iteration for ipopt.
232 ipopt_warm_start : int, optional
233 Specifies lvl for a warm start in ipopt: 1,2,3,...
235 jacobian : Literal["coloredNumerical", "internalNumerical", "coloredSymbolical", "numerical", "symbolical"], optional
236 Select the calculation method for Jacobian used by the integration method:
238 coloredNumerical (Colored numerical Jacobian, which is default for dassl and ida. With option -idaLS=klu a sparse matrix is used.)
240 internalNumerical (Dense solver internal numerical Jacobian.)
242 coloredSymbolical (Colored symbolical Jacobian. Needs omc compiler flag --generateSymbolicJacobian. With option -idaLS=klu a sparse matrix is used.)
244 numerical (Dense numerical Jacobian.)
246 symbolical (Dense symbolical Jacobian. Needs omc compiler flag --generateSymbolicJacobian.)
248 jacobianThreads : int, optional
249 Specifies the number of threads for jacobian evaluation in dassl or ida. The value is an Integer with default value 1.
251 l : float, optional [-l=value]
252 Specifies a time where the linearization of the model should be performed.
254 l_datarec : bool, optional [-l_datarec]
255 Emit data recovery matrices with model linearization.
257 logFormat : Literal["text", "xml", "xmltcp"], optional
258 Specifies the log format of the executable:
260 text (default)
262 xml
264 xmltcp (required -port flag)
266 ls : Literal["lapack", "lis", "klu", "umfpack", "totalpivot", "default"], optional [-ls=value]
267 Specifies the linear solver method
269 lapack (method using LAPACK LU factorization)
271 lis (method using iterative solver Lis)
273 klu (method using KLU sparse linear solver)
275 umfpack (method using UMFPACK sparse linear solver)
277 totalpivot (method using a total pivoting LU factorization for underdetermination systems)
279 default (default method - LAPACK with total pivoting as fallback)
281 ls_ipopt : str, optional
282 Specifies the linear solver method for Ipopt, default mumps.
283 Note: Use if you build ipopt with other linear solver like ma27
285 lss : Literal["default", "lis", "klu", "umfpack"], optional [-lss=value]
286 Specifies the linear sparse solver method
288 default (the default sparse linear solver (or a dense solver if there is none available) )
290 lis (method using iterative solver Lis)
292 klu (method using klu sparse linear solver)
294 umfpack (method using umfpack sparse linear solver)
296 lssMaxDensity : float, optional
297 Specifies the maximum density for using a linear sparse solver. The value is a Double with default value 0.2.
299 lssMinSize : int, optional
300 Specifies the minimum system size for using a linear sparse solver. The value is an Integer with default value 1000.
302 lvMaxWarn : int, optional
303 Maximum number of times some repeating warnings are displayed. Default value 3.
305 lv_time : (float, float), optional
306 Specifies in which time interval logging is active.
307 Doesn't affect LOG_STDOUT, LOG_ASSERT, and LOG_SUCCESS, LOG_STATS, LOG_STATS_V.
309 lv_system : (int, ...), optional
310 List of equation indices (available in the transformational debugger)
311 for which solver logs are shown (by default logs for all systems are shown)
313 mbi : int, optional
314 Specifies the maximum number of bisection iterations for state event detection
315 or zero for default behavior
317 mei : int, optional
318 Specifies the maximum number of event iterations.
319 The value is an Integer with default value 20.
321 maxIntegrationOrder : int, optional
322 Specifies maximum integration order, used by the methods: dassl, ida.
324 maxStepSize : float, optional
325 Specifies maximum absolute step size, used by the methods: dassl, ida, gbode.
327 measureTimePlotFormat : Literal['svg', 'jpg', 'ps', 'gif'], optional
328 Specifies the output format of the measure time functionality
330 newtonDiagnostics : bool, optional
331 Implementation of "On the choice of initial guesses for the Newton-Raphson algorithm."
332 See: https://doi.org/10.1016/j.amc.2021.125991
334 newtonFTol : float, optional
335 Tolerance respecting residuals for updating solution vector in Newton solver.
336 Solution is accepted if the (scaled) 2-norm of the residuals is smaller than
337 the tolerance newtonFTol and the (scaled) newton correction (delta_x)
338 is smaller than the tolerance newtonXTol. The value is a Double with default value 1e-12.
340 newtonMaxStepFactor : float, optional
341 Maximum newton step factor mxnewtstep = maxStepFactor * norm2(xScaling). Used currently only by KINSOL.
343 newtonXTol : float, optional
344 Tolerance respecting newton correction (delta_x) for updating solution vector in Newton solver.
345 Solution is accepted if the (scaled) 2-norm of the residuals is smaller than
346 the tolerance newtonFTol and the (scaled) newton correction (delta_x) is
347 smaller than the tolerance newtonXTol. The value is a Double with default value 1e-12.
349 newton : Literal['damped', 'damped2', 'damped_ls', 'damped_bt'], optional
350 Specifies the damping strategy for the newton solver.
352 damped (Newton with a damping strategy)
354 damped2 (Newton with a damping strategy 2)
356 damped_ls (Newton with a damping line search)
358 damped_bt (Newton with a damping backtracking and a minimum search via golden ratio method)
360 pure (Newton without damping strategy)
362 nls : Literal['hybrid', 'kinsol', 'kinsol', 'newton', 'mixed', 'homotopy'], optional
363 Specifies the nonlinear solver:
365 hybrid (Modification of the Powell hybrid method from minpack - former default solver)
367 kinsol (SUNDIALS/KINSOL includes an interface to the sparse direct solver, KLU. See simulation option -nlsLS for more information.)
369 newton (Newton Raphson - prototype implementation)
371 mixed (Mixed strategy. First the homotopy solver is tried and then as fallback the hybrid solver.)
373 homotopy (Damped Newton solver if failing case fixed-point and Newton homotopies are tried.)
376 nlsInfo : bool, optional
377 Outputs detailed information about solving process of non-linear systems into csv files.
379 nlsLS : Literal['default', 'totalpivot', 'lapack', 'klu'], optional
380 Specifies the linear solver used by the non-linear solver:
382 default (chooses the nls linear solver based on which nls is being used.)
384 totalpivot (internal total pivot implementation. Solve in some case even under-determined systems.)
386 lapack (use external LAPACK implementation.)
388 klu (use KLU direct sparse solver. Only with KINSOL available.)
390 nlssMaxDensity : float, optional
391 specifies the maximum density for using a non-linear sparse solver.
392 The default value is 0.1
394 nlssMinSize : int, optional
395 Value specifies the minimum system size for using a non-linear sparse solver.
396 The value is an Integer with default value 1000.
398 noemit : bool, optional
399 Do not emit any results to the result file.
401 noEquidistantTimeGrid : bool, optional
402 Output the internal steps given by dassl/ida instead of interpolating results
403 into an equidistant time grid as given by stepSize or numberOfIntervals.
405 noEquidistantOutputFrequency : int, optional
406 Value 'n' controls the output frequency in noEquidistantTimeGrid mode
407 and outputs every n-th time step
409 noEquidistantOutputTime : float, optional
410 Value timeValue controls the output time point in noEquidistantOutputTime
411 mode and outputs every time>=k*timeValue, where k is an integer
413 noEventEmit : bool, optional
414 Do not emit event points to the result file.
416 noRestart : bool, optional
417 Disables the restart of the integration method after an event
418 is performed, used by the methods: dassl, ida
420 noRootFinding : bool, optional
421 Disables the internal root finding procedure of methods: dassl and ida.
423 noScaling : bool, optional
424 Disables scaling for the variables and the residuals in the algebraic nonlinear solver KINSOL.
426 noSuppressAlg : bool, optional
427 Flag to not suppress algebraic variables in the local error test of the ida solver in daeMode.
428 In general, the use of this option is discouraged when solving DAE systems of index 1,
429 whereas it is generally encouraged for systems of index 2 or more.
431 optDebugJac : int, optional
432 Value specifies the number of iterations from the dynamic optimization,
433 which will be debugged, creating .csv and .py files.
435 optimizerNP : Literal[1, 3], optional
436 Value specifies the number of points in a subinterval. Currently supports numbers 1 and 3.
438 optimizerTimeGrid : str, optional
439 Specifies external file with time points.
441 output : list[str], optional
442 Output the variables a, b and c at the end of the simulation to the standard output:
443 time = value, a = value, b = value, c = value
445 outputPath : str, optional
446 Specifies a path for writing the output files i.e., model_res.mat, model_prof.intdata, model_prof.realdata etc.
448 override : list[str], optional
449 Override the variables or the simulation settings in the XML setup file For example:
450 var1=start1,var2=start2,par3=start3,startTime=val1,stopTime=val2
452 overrideFile : str, optional
453 Will override the variables or the simulation settings in the XML setup file with the values from the file.
454 Note that: overrideFile CANNOT be used with override. Use when variables for -override are too many. overrideFileName contains lines of the form: var1=start1
456 port : int, optional
457 Specifies the port for simulation status (default disabled).
459 r : str, optional
460 Specifies the name of the output result file. The default file-name is based on the model name and output format. For example: Model_res.mat.
462 reconcile : bool, optional
463 Run the Data Reconciliation numerical computation algorithm for constrained equations
465 reconcileBoundaryConditions : bool, optional
466 Run the Data Reconciliation numerical computation algorithm for boundary condition equations
468 reconcileState : bool, optional
469 Run the State Estimation numerical computation algorithm for constrained equations
471 gbm : Literal[
472 "adams",
473 "expl_euler",
474 "impl_euler",
475 "trapezoid",
476 "sdirk2",
477 "sdirk3",
478 "esdirk2",
479 "esdirk3",
480 "esdirk4",
481 "radauIA2",
482 "radauIA3",
483 "radauIA4",
484 "radauIIA2",
485 "radauIIA3",
486 "radauIIA4",
487 "lobattoIIIA3",
488 "lobattoIIIA4",
489 "lobattoIIIB3",
490 "lobattoIIIB4",
491 "lobattoIIIC3",
492 "lobattoIIIC4",
493 "gauss2",
494 "gauss3",
495 "gauss4",
496 "gauss5",
497 "gauss6",
498 "merson",
499 "mersonSsc1",
500 "mersonSsc2",
501 "heun",
502 "fehlberg12",
503 "fehlberg45",
504 "fehlberg78",
505 "fehlbergSsc1",
506 "fehlbergSsc2",
507 "rk810",
508 "rk1012",
509 "rk1214",
510 "dopri45",
511 "dopriSsc1",
512 "dopriSsc2",
513 "tsit5",
514 "rungekutta",
515 "rungekuttaSsc"
516 ], optional
517 Specifies the chosen solver of solver gbode (single-rate, slow states integrator).
519 adams (Implicit multistep method of type Adams-Moulton (order 2))
521 expl_euler (Explizit Runge-Kutta Euler method (order 1))
523 impl_euler (Implizit Runge-Kutta Euler method (order 1))
525 trapezoid (Implicit Runge-Kutta trapezoid method (order 2))
527 sdirk2 (Singly-diagonal implicit Runge-Kutta (order 2))
529 sdirk3 (Singly-diagonal implicit Runge-Kutta (order 3))
531 esdirk2 (Explicit singly-diagonal implicit Runge-Kutta (order 2))
533 esdirk3 (Explicit singly-diagonal implicit Runge-Kutta (order 3))
535 esdirk4 (Explicit singly-diagonal implicit Runge-Kutta (order 4))
537 radauIA2 (Implicit Runge-Kutta method of Radau family IA (order 3))
539 radauIA3 (Implicit Runge-Kutta method of Radau family IA (order 5))
541 radauIA4 (Implicit Runge-Kutta method of Radau family IA (order 7))
543 radauIIA2 (Implicit Runge-Kutta method of Radau family IIA (order 3))
545 radauIIA3 (Implicit Runge-Kutta method of Radau family IIA (order 5))
547 radauIIA4 (Implicit Runge-Kutta method of Radau family IIA (order 7))
549 lobattoIIIA3 (Implicit Runge-Kutta method of Lobatto family IIIA (order 4))
551 lobattoIIIA4 (Implicit Runge-Kutta method of Lobatto family IIIA (order 6))
553 lobattoIIIB3 (Implicit Runge-Kutta method of Lobatto family IIIB (order 4))
555 lobattoIIIB4 (Implicit Runge-Kutta method of Lobatto family IIIB (order 6))
557 lobattoIIIC3 (Implicit Runge-Kutta method of Lobatto family IIIC (order 4))
559 lobattoIIIC4 (Implicit Runge-Kutta method of Lobatto family IIIC (order 6))
561 gauss2 (Implicit Runge-Kutta method of Gauss (order 4))
563 gauss3 (Implicit Runge-Kutta method of Gauss (order 6))
565 gauss4 (Implicit Runge-Kutta method of Gauss (order 8))
567 gauss5 (Implicit Runge-Kutta method of Gauss (order 10))
569 gauss6 (Implicit Runge-Kutta method of Gauss (order 12))
571 merson (Explicit Runge-Kutta Merson method (order 4))
573 mersonSsc1 (Explicit Runge-Kutta Merson method with large stability region (order 1))
575 mersonSsc2 (Explicit Runge-Kutta Merson method with large stability region (order 2))
577 heun (Explicit Runge-Kutta Heun method (order 2))
579 fehlberg12 (Explicit Runge-Kutta Fehlberg method (order 2))
581 fehlberg45 (Explicit Runge-Kutta Fehlberg method (order 5))
583 fehlberg78 (Explicit Runge-Kutta Fehlberg method (order 8))
585 fehlbergSsc1 (Explicit Runge-Kutta Fehlberg method with large stability region (order 1))
587 fehlbergSsc2 (Explicit Runge-Kutta Fehlberg method with large stability region (order 2))
589 rk810 (Explicit 8-10 Runge-Kutta method (order 10))
591 rk1012 (Explicit 10-12 Runge-Kutta method (order 12))
593 rk1214 (Explicit 12-14 Runge-Kutta method (order 14))
595 dopri45 (Explicit Runge-Kutta method Dormand-Prince (order 5))
597 dopriSsc1 (Explicit Runge-Kutta method Dormand-Prince with large stability region (order 1))
599 dopriSsc2 (Explicit Runge-Kutta method Dormand-Prince with large stability region (order 2))
601 tsit5 (Explicit Runge-Kutta method from Tsitouras (order 5))
603 rungekutta (Explicit classical Runge-Kutta method (order 4))
605 rungekuttaSsc (Explicit Runge-Kutta method with large stabiliy region (order 1))
607 gbctrl : Literal["i", "pi", "pid", "const"], optional
608 Step size control of solver gbode (single-rate, slow states integrator).
610 i (I controller for step size)
612 pi (PI controller for step size)
614 pid (PID controller for step size)
616 const (Constant step size)
618 gberr : Literal["default", "richardson", "embedded"], optional
619 Error estimation method for solver gbode (single-rate, slow states integrator) Possible values:
621 default - depending on the Runge-Kutta method
623 richardson - Richardson extrapolation
625 embedded - Embedded scheme
627 gbint : Literal["linear", "hermite", "hermite_a", "hermite_b", "hermite_errctrl", "dense_output", "dense_output_errctrl"], optional
628 Interpolation method of solver gbode (single-rate, slow states integrator).
630 linear (Linear interpolation (1st order))
632 hermite (Hermite interpolation (3rd order))
634 hermite_a (Hermite interpolation (only for left hand side))
636 hermite_b (Hermite interpolation (only for right hand side))
638 hermite_errctrl (Hermite interpolation with error control)
640 dense_output (use dense output formula for interpolation)
642 dense_output_errctrl (use dense output fomular with error control)
644 gbfm : Literal[
645 "adams",
646 "expl_euler",
647 "impl_euler",
648 "trapezoid",
649 "sdirk2",
650 "sdirk3",
651 "esdirk2",
652 "esdirk3",
653 "esdirk4",
654 "radauIA2",
655 "radauIA3",
656 "radauIA4",
657 "radauIIA2",
658 "radaulIIA3",
659 "radaulIIA4",
660 "lobattoIIIA3",
661 "lobattoIIIA4",
662 "lobattoIIIB3",
663 "lobattoIIIB4",
664 "lobattoIIIC3",
665 "lobattoIIIC4",
666 "gauss2",
667 "gauss3",
668 "gauss4",
669 "gauss5",
670 "gauss6",
671 "merson",
672 "mersonSsc1",
673 "mersonSsc2",
674 "heun",
675 "fehlberg12",
676 "fehlberg45",
677 "fehlberg78",
678 "fehlbergSsc1",
679 "fehlbergSsc2",
680 "rk810",
681 "rk1012",
682 "dopri45",
683 "dopriSsc1",
684 "dopriSsc2",
685 "tsit5",
686 "rungekutta",
687 "rungekuttaSsc",
688 ], optional
689 Specifies the chosen solver of solver gbode (multi-rate, fast states integrator). Current Restriction: Fully implicit (Gauss, Radau, Lobatto) RK methods are not supported, yet.
691 adams (Implicit multistep method of type Adams-Moulton (order 2))
693 expl_euler (Explizit Runge-Kutta Euler method (order 1))
695 impl_euler (Implizit Runge-Kutta Euler method (order 1))
697 trapezoid (Implicit Runge-Kutta trapezoid method (order 2))
699 sdirk2 (Singly-diagonal implicit Runge-Kutta (order 2))
701 sdirk3 (Singly-diagonal implicit Runge-Kutta (order 3))
703 esdirk2 (Explicit singly-diagonal implicit Runge-Kutta (order 2))
705 esdirk3 (Explicit singly-diagonal implicit Runge-Kutta (order 3))
707 esdirk4 (Explicit singly-diagonal implicit Runge-Kutta (order 4))
709 radauIA2 (Implicit Runge-Kutta method of Radau family IA (order 3))
711 radauIA3 (Implicit Runge-Kutta method of Radau family IA (order 5))
713 radauIA4 (Implicit Runge-Kutta method of Radau family IA (order 7))
715 radauIIA2 (Implicit Runge-Kutta method of Radau family IIA (order 3))
717 radauIIA3 (Implicit Runge-Kutta method of Radau family IIA (order 5))
719 radauIIA4 (Implicit Runge-Kutta method of Radau family IIA (order 7))
721 lobattoIIIA3 (Implicit Runge-Kutta method of Lobatto family IIIA (order 4))
723 lobattoIIIA4 (Implicit Runge-Kutta method of Lobatto family IIIA (order 6))
725 lobattoIIIB3 (Implicit Runge-Kutta method of Lobatto family IIIB (order 4))
727 lobattoIIIB4 (Implicit Runge-Kutta method of Lobatto family IIIB (order 6))
729 lobattoIIIC3 (Implicit Runge-Kutta method of Lobatto family IIIC (order 4))
731 lobattoIIIC4 (Implicit Runge-Kutta method of Lobatto family IIIC (order 6))
733 gauss2 (Implicit Runge-Kutta method of Gauss (order 4))
735 gauss3 (Implicit Runge-Kutta method of Gauss (order 6))
737 gauss4 (Implicit Runge-Kutta method of Gauss (order 8))
739 gauss5 (Implicit Runge-Kutta method of Gauss (order 10))
741 gauss6 (Implicit Runge-Kutta method of Gauss (order 12))
743 merson (Explicit Runge-Kutta Merson method (order 4))
745 mersonSsc1 (Explicit Runge-Kutta Merson method with large stability region (order 1))
747 mersonSsc2 (Explicit Runge-Kutta Merson method with large stability region (order 2))
749 heun (Explicit Runge-Kutta Heun method (order 2))
751 fehlberg12 (Explicit Runge-Kutta Fehlberg method (order 2))
753 fehlberg45 (Explicit Runge-Kutta Fehlberg method (order 5))
755 fehlberg78 (Explicit Runge-Kutta Fehlberg method (order 8))
757 fehlbergSsc1 (Explicit Runge-Kutta Fehlberg method with large stability region (order 1))
759 fehlbergSsc2 (Explicit Runge-Kutta Fehlberg method with large stability region (order 2))
761 rk810 (Explicit 8-10 Runge-Kutta method (order 10))
763 rk1012 (Explicit 10-12 Runge-Kutta method (order 12))
765 rk1214 (Explicit 12-14 Runge-Kutta method (order 14))
767 dopri45 (Explicit Runge-Kutta method Dormand-Prince (order 5))
769 dopriSsc1 (Explicit Runge-Kutta method Dormand-Prince with large stability region (order 1))
771 dopriSsc2 (Explicit Runge-Kutta method Dormand-Prince with large stability region (order 2))
773 tsit5 (Explicit Runge-Kutta method from Tsitouras (order 5))
775 rungekutta (Explicit classical Runge-Kutta method (order 4))
777 rungekuttaSsc (Explicit Runge-Kutta method with large stabiliy region (order 1))
779 gbfctrl : Literal["i", "pi", "pid", "const"], optional
780 Step size control of solver gbode (multi-rate, fast states integrator).
782 i (I controller for step size)
784 pi (PI controller for step size)
786 pid (PID controller for step size)
788 const (Constant step size)
790 gbferr : Literal["default", "richardson", "embedded"], optional
791 Error estimation method for solver gbode (multi-rate, fast states integrator) Possible values:
793 default - depending on the Runge-Kutta method
795 richardson - Richardson extrapolation
797 embedded - Embedded scheme
799 gbfint : Literal["linear", "hermite", "hermite_a", "hermite_b", "hermite_errctrl", "dense_output", "dense_output_errctrl"], optional
800 Interpolation method of solver gbode (multi-rate, fast states integrator).
802 linear (Linear interpolation (1st order))
804 hermite (Hermite interpolation (3rd order))
806 hermite_a (Hermite interpolation (only for left hand side))
808 hermite_b (Hermite interpolation (only for right hand side))
810 hermite_errctrl (Hermite interpolation with error control)
812 dense_output (use dense output formula for interpolation)
814 dense_output_errctrl (use dense output fomular with error control)
816 gbfnls : Literal["newton", "kinsol"], optional
817 Non-linear solver method of solver gbode (multi-rate, fast states integrator).
819 newton (Newton method, dense)
821 kinsol (SUNDIALS KINSOL: Inexact Newton, sparse)
823 gbratio : float, optional
824 Define percentage of states for the fast states selection of solver gbode (values from 0 to 1).
826 rt : float, optional
827 Value specifies the scaling factor for real-time synchronization (0 disables).
828 A value > 1 means the simulation takes a longer time to simulate.
830 s : Literal[
831 "euler",
832 "heun",
833 "rungekutta",
834 "impeuler",
835 "trapezoid",
836 "imprungekutta",
837 "gbode",
838 "irksco",
839 "dassl",
840 "ida",
841 "cvode",
842 "rungekuttaSsc",
843 "symSolver",
844 "symSolverSsc",
845 "qss",
846 "optimization"
847 ], optional
848 Specifies the integration method. For additional information see the User's Guide
850 euler - Euler - explicit, fixed step size, order 1
852 heun - Heun's method - explicit, fixed step, order 2
854 rungekutta - classical Runge-Kutta - explicit, fixed step, order 4
856 impeuler - Euler - implicit, fixed step size, order 1
858 trapezoid - trapezoidal rule - implicit, fixed step size, order 2
860 imprungekutta - Runge-Kutta methods based on Radau and Lobatto IIA - implicit, fixed step size, order 1-6(selected manually by flag -impRKOrder)
862 gbode - generic bi-rate ODE solver - implicit, explicit, step size control, arbitrary order
864 irksco - own developed Runge-Kutta solver - implicit, step size control, order 1-2
866 dassl - default solver - BDF method - implicit, step size control, order 1-5
868 ida - SUNDIALS IDA solver - BDF method with sparse linear solver - implicit, step size control, order 1-5
870 cvode - experimental implementation of SUNDIALS CVODE solver - BDF or Adams-Moulton method - step size control, order 1-12
872 rungekuttaSsc - Runge-Kutta based on Novikov (2016) - explicit, step size control, order 4-5 [experimental]
874 symSolver - symbolic inline Solver [compiler flag +symSolver needed] - fixed step size, order 1
876 symSolverSsc - symbolic implicit Euler with step size control [compiler flag +symSolver needed] - step size control, order 1
878 qss - A QSS solver [experimental]
880 optimization - Special solver for dynamic optimization
882 single : bool, optional
883 Output results in single precision (mat-format only).
885 steps : bool, optional
886 Dumps the number of integration steps into the result file.
888 steadyState : bool, optional
889 Aborts the simulation if steady state is reached.
891 steadyStateTol : float, optional
892 This relative tolerance is used to detect steady state: max(|d(x_i)/dt|/nominal(x_i)) < steadyStateTol
894 sx : str, optional
895 Value specifies an csv-file with inputs as covariance matrix Sx for DataReconciliation
897 keepHessian : bool, optional
898 Value specifies the number of steps, which keep Hessian matrix constant.
900 w : bool, optional
901 Shows all warnings even if a related log-stream is inactive.
903 parmodNumThreads : int, optional
904 Value specifies the number of threads for simulation using parmodauto. If not specified (or is 0) it will use the systems max number of threads.
905 Note that this option is ignored if the model is not compiled with --parmodauto
907 Logging Setup
908 -------------
910 LOG_STDOUT: bool, optional
911 this stream is active by default
913 LOG_ASSERT: bool, optional
914 this stream is active by default
916 LOG_DASSL: bool, optional
917 additional information about dassl solver
919 LOG_DASSL_STATES: bool, optional
920 outputs the states at every dassl call)
922 LOG_DEBUG: bool, optional
923 additional debug information
925 LOG_DELAY: bool, optional
926 debug information for delay operator
928 LOG_DIVISION: bool, optional
929 Log division by zero
931 LOG_DSS: bool, optional
932 outputs information about dynamic state selection
934 LOG_DSS_JAC: bool, optional
935 outputs jacobian of the dynamic state selection
937 LOG_DT: bool, optional
938 additional information about dynamic tearing
940 LOG_DT_CONS: bool, optional
941 additional information about dynamic tearing (local and global constraints)
943 LOG_EVENTS: bool, optional
944 additional information during event iteration
946 LOG_EVENTS_V: bool, optional
947 verbose logging of event system
949 LOG_GBODE: bool, optional
950 information about GBODE solver
952 LOG_GBODE_V: bool, optional
953 verbose information about GBODE solve
955 LOG_GBODE_NLS: bool, optional
956 log non-linear solver process of GBODE solver
958 LOG_GBODE_NLS_V: bool, optional
959 verbose log non-linear solver process of GBODE solver
961 LOG_GBODE_STATES: bool, optional
962 output states at every GBODE call
964 LOG_INIT: bool, optional
965 additional information during initialization
967 LOG_INIT_HOMOTOPY: bool, optional
968 log homotopy initialization
970 LOG_INIT_V: bool, optional
971 verbose information during initialization
973 LOG_IPOPT: bool, optional
974 information from Ipopt
976 LOG_IPOPT_FULL: bool, optional
977 more information from Ipopt
979 LOG_IPOPT_JAC: bool, optional
980 check jacobian matrix with Ipopt
982 LOG_IPOPT_HESSE: bool, optional
983 check hessian matrix with Ipopt
985 LOG_IPOPT_ERROR: bool, optional
986 print max error in the optimization
988 LOG_JAC: bool, optional
989 outputs the jacobian matrix used by ODE solvers
991 LOG_LS: bool, optional
992 logging for linear systems
994 LOG_LS_V: bool, optional
995 verbose logging of linear systems
997 LOG_MIXED: bool, optional
998 logging for mixed systems
1000 LOG_NLS: bool, optional
1001 logging for nonlinear systems
1003 LOG_NLS_V: bool, optional
1004 verbose logging of nonlinear systems
1006 LOG_NLS_HOMOTOPY: bool, optional
1007 logging of homotopy solver for nonlinear systems
1009 LOG_NLS_JAC: bool, optional
1010 outputs the jacobian of nonlinear systems
1012 LOG_NLS_JAC_TEST: bool, optional
1013 tests the analytical jacobian of nonlinear systems
1015 LOG_NLS_NEWTON_DIAG: bool, optional
1016 Log Newton diagnostic
1018 LOG_NLS_RES: bool, optional
1019 outputs every evaluation of the residual function
1021 LOG_NLS_EXTRAPOLATE: bool, optional
1022 outputs debug information about extrapolate process
1024 LOG_RES_INIT: bool, optional
1025 outputs residuals of the initialization
1027 LOG_RT: bool, optional
1028 additional information regarding real-time processes
1030 LOG_SIMULATION: bool, optional
1031 additional information about simulation process
1033 LOG_SOLVER: bool, optional
1034 additional information about solver process
1036 LOG_SOLVER_V: bool, optional
1037 verbose information about the integration process
1039 LOG_SOLVER_CONTEXT: bool, optional
1040 context information during the solver process
1042 LOG_SOTI: bool, optional
1043 final solution of the initialization
1045 LOG_SPATIALDISTR: bool, optional
1046 logging of internal operations for spatialDistribution
1048 LOG_STATS: bool, optional
1049 additional statistics about timer/events/solver
1051 LOG_STATS_V: bool, optional
1052 additional statistics for LOG_STATS
1054 LOG_SUCCESS: bool, optional
1055 this stream is active by default
1057 LOG_SYNCHRONOUS: bool, optional
1058 log clocks and sub-clocks for synchronous features
1060 LOG_ZEROCROSSINGS: bool, optional
1061 additional information about the zerocrossings
1062 """
1064 abortSlowSimulation: bool = False
1065 alarm: pydantic.NonNegativeInt = 0
1066 clock: typing.Literal["RT", "CYC", "CPU"] | None = None
1067 cpu: bool = False
1068 csvOstep: pydantic.FilePath | None = None
1069 cvodeNonlinearSolverIteration: (
1070 typing.Literal["CV_ITER_NEWTON", "CV_ITER_FIXED_POINT"] | None
1071 ) = None
1072 cvodeLinearMultistepMethod: typing.Literal["CV_BDF", "CV_ADAMS"] | None = None
1073 cx: pydantic.FilePath | None = None
1074 daeMode: bool | None = None
1075 deltaXLinearize: pydantic.NonNegativeFloat | None = None
1076 deltaXSolver: pydantic.NonNegativeFloat | None = None
1077 embeddedServer: typing.Literal["opc-da", "opc-ua"] | pydantic.FilePath | None = None
1078 embeddedServerPort: int | None = None
1079 mat_sync: pydantic.PositiveInt | None = None
1080 emit_protected: bool | None = None
1081 eps: pydantic.PositiveInt | None = None
1082 f: pydantic.FilePath | None = None
1083 homAdaptBend: pydantic.PositiveFloat | None = None
1084 homBacktraceStrategy: typing.Literal["fix", "orthogonal"] | None = None
1085 homHEps: pydantic.PositiveFloat | None = None
1086 homMaxLambdaSteps: pydantic.PositiveInt | None = None
1087 homMaxNewtonSteps: pydantic.PositiveInt | None = None
1088 homMaxTries: pydantic.PositiveInt | None = None
1089 homNegStartDir: bool | None = None
1090 noHomotopyOnFirstTry: bool | None = None
1091 homTauDecFac: pydantic.PositiveFloat | None = None
1092 homTauDecFacPredictor: pydantic.PositiveFloat | None = None
1093 homTauIncFac: pydantic.PositiveFloat | None = None
1094 homTauIncThreshold: pydantic.PositiveFloat | None = None
1095 homTauMax: pydantic.PositiveFloat | None = None
1096 homTauMin: pydantic.PositiveFloat | None = None
1097 homTauStart: pydantic.PositiveFloat | None = None
1098 ils: pydantic.PositiveInt | None = None
1099 idaMaxErrorTestFails: pydantic.PositiveInt | None = None
1100 idaMaxNonLinIters: pydantic.PositiveInt | None = None
1101 idaMaxConvFails: pydantic.PositiveInt | None = None
1102 idaNonLinConvCoef: pydantic.PositiveFloat | None = None
1103 idaLS: typing.Literal["dense", "klu", "spgmr", "spbcg", "sptqmr"] | None = None
1104 idaScaling: bool | None = None
1105 idaSensitivity: bool | None = None
1106 ignoreHideResult: bool | None = None
1107 iif: pydantic.FilePath | None = None
1108 iim: typing.Literal["none", "symbolic"] | None = None
1109 iit: pydantic.NonNegativeFloat | None = None
1110 impRKOrder: pydantic.confloat(ge=1, le=6) | None = None
1111 impRKLS: typing.Literal["iterativ", "dense"] | None = None
1112 initialStepSize: pydantic.PositiveFloat | None = None
1113 csvInput: pydantic.FilePath | None = None
1114 stateFile: pydantic.FilePath | None = None
1115 ipopt_hesse: str | None = None # TODO: Unknown type
1116 ipopt_init: str | None = None # TODO: Unknown type
1117 ipopt_jac: str | None = None # TODO: Unknown type
1118 ipopt_max_iter: pydantic.PositiveInt | None = None
1119 ipopt_warm_start: pydantic.PositiveInt | None = None
1120 jacobian: (
1121 typing.Literal[
1122 "coloredNumerical",
1123 "internalNumerical",
1124 "coloredSymbolical",
1125 "numerical",
1126 "symbolical",
1127 ]
1128 | None
1129 ) = None
1130 jacobianThreads: pydantic.PositiveInt | None = None
1131 l: pydantic.NonNegativeFloat | None = None
1132 l_data_rec: bool | None = None
1133 logFormat: typing.Literal["text", "xml", "xmltcp"] | None = None
1134 ls: (
1135 typing.Literal["lapack", "lis", "klu", "umfpack", "totalpivot", "default"]
1136 | None
1137 ) = None
1138 ls_ipopt: str | None = None
1139 lss: typing.Literal["default", "lis", "klu", "umfpack"] | None = None
1140 lssMaxDensity: pydantic.PositiveFloat | None = None
1141 lssMinSize: pydantic.PositiveInt | None = None
1142 lvMaxWarn: pydantic.PositiveInt | None = None
1143 lv_time: (
1144 pydantic.conlist(max_length=2, min_length=2, item_type=pydantic.PositiveFloat)
1145 | None
1146 ) = None
1147 lv_system: tuple[pydantic.NonNegativeInt] | None = None
1148 mbi: pydantic.PositiveInt | None = None
1149 mei: pydantic.PositiveInt | None = None
1150 maxIntegrationOrder: pydantic.PositiveInt | None = None
1151 maxStepSize: pydantic.PositiveFloat | None = None
1152 measureTimePlotFormat: typing.Literal["svg", "jpg", "ps", "gif"] | None = None
1153 newtonDiagnostics: bool | None = None
1154 newtonFTol: pydantic.PositiveFloat | None = None
1155 newtonMaxStepFactor: float | None = None
1156 newtonXTol: pydantic.PositiveFloat | None = None
1157 newton: typing.Literal["damped", "damped2", "damped_ls", "damped_bt"] | None = None
1158 nls: (
1159 typing.Literal["hybrid", "kinsol", "kinsol", "newton", "mixed", "homotopy"]
1160 | None
1161 ) = None
1162 nlsInfo: bool | None = None
1163 nlsLS: typing.Literal["default", "totalpivot", "lapack", "klu"] | None = None
1164 nlssMaxDensity: pydantic.PositiveFloat | None = None
1165 nlssMinSize: pydantic.PositiveInt | None = None
1166 noemit: bool | None = None
1167 noEquidistantTimeGrid: bool | None = None
1168 noEquidistantOutputFrequency: pydantic.PositiveInt | None = None
1169 noEquidistantOutputTime: pydantic.PositiveFloat | None = None
1170 noEventEmit: bool | None = None
1171 noRestart: bool | None = None
1172 noRootFinding: bool | None = None
1173 noScaling: bool | None = None
1174 noSuppressAlg: bool | None = None
1175 optDebugJac: pydantic.PositiveInt | None = None
1176 optimizerNP: typing.Literal[1, 3] | None = None
1177 optimizerTimeGrid: pydantic.FilePath | None = None
1178 output: list[str] | None = None
1179 outputPath: pydantic.DirectoryPath | None = None
1180 override: list[str] | None = None
1181 overrideFile: pydantic.FilePath | None = None
1182 port: pydantic.PositiveInt | None = None
1183 r: str | None = None
1184 reconcile: bool | None = None
1185 reconcileBoundaryConditions: bool | None = None
1186 reconcileState: bool | None = None
1187 gbm: (
1188 typing.Literal[
1189 "adams",
1190 "expl_euler",
1191 "impl_euler",
1192 "trapezoid",
1193 "sdirk2",
1194 "sdirk3",
1195 "esdirk2",
1196 "esdirk3",
1197 "esdirk4",
1198 "radauIA2",
1199 "radauIA3",
1200 "radauIA4",
1201 "radauIIA2",
1202 "radauIIA3",
1203 "radauIIA4",
1204 "lobattoIIIA3",
1205 "lobattoIIIA4",
1206 "lobattoIIIB3",
1207 "lobattoIIIB4",
1208 "lobattoIIIC3",
1209 "lobattoIIIC4",
1210 "gauss2",
1211 "gauss3",
1212 "gauss4",
1213 "gauss5",
1214 "gauss6",
1215 "merson",
1216 "mersonSsc1",
1217 "mersonSsc2",
1218 "heun",
1219 "fehlberg12",
1220 "fehlberg45",
1221 "fehlberg78",
1222 "fehlbergSsc1",
1223 "fehlbergSsc2",
1224 "rk810",
1225 "rk1012",
1226 "rk1214",
1227 "dopri45",
1228 "dopriSsc1",
1229 "dopriSsc2",
1230 "tsit5",
1231 "rungekutta",
1232 "rungekuttaSsc",
1233 ]
1234 | None
1235 ) = None
1236 gbctrl: typing.Literal["i", "pi", "pid", "const"] | None = None
1237 gberr: typing.Literal["default", "richardson", "embedded"] | None = None
1238 gbint: (
1239 typing.Literal[
1240 "linear",
1241 "hermite",
1242 "hermite_a",
1243 "hermite_b",
1244 "hermite_errctrl",
1245 "dense_output",
1246 "dense_output_errctrl",
1247 ]
1248 | None
1249 ) = None
1250 gbnls: typing.Literal["newton", "kinsol"] | None = None
1251 gbfm: (
1252 typing.Literal[
1253 "adams",
1254 "expl_euler",
1255 "impl_euler",
1256 "trapezoid",
1257 "sdirk2",
1258 "sdirk3",
1259 "esdirk2",
1260 "esdirk3",
1261 "esdirk4",
1262 "radauIA2",
1263 "radauIA3",
1264 "radauIA4",
1265 "radauIIA2",
1266 "radaulIIA3",
1267 "radaulIIA4",
1268 "lobattoIIIA3",
1269 "lobattoIIIA4",
1270 "lobattoIIIB3",
1271 "lobattoIIIB4",
1272 "lobattoIIIC3",
1273 "lobattoIIIC4",
1274 "gauss2",
1275 "gauss3",
1276 "gauss4",
1277 "gauss5",
1278 "gauss6",
1279 "merson",
1280 "mersonSsc1",
1281 "mersonSsc2",
1282 "heun",
1283 "fehlberg12",
1284 "fehlberg45",
1285 "fehlberg78",
1286 "fehlbergSsc1",
1287 "fehlbergSsc2",
1288 "rk810",
1289 "rk1012",
1290 "dopri45",
1291 "dopriSsc1",
1292 "dopriSsc2",
1293 "tsit5",
1294 "rungekutta",
1295 "rungekuttaSsc",
1296 ]
1297 | None
1298 ) = None
1299 gbfctrl: typing.Literal["i", "pi", "pid", "const"] | None = None
1300 gbferr: typing.Literal["default", "richardson", "embedded"] | None = None
1301 gbfint: (
1302 typing.Literal[
1303 "linear",
1304 "hermite",
1305 "hermite_a",
1306 "hermite_b",
1307 "hermite_errctrl",
1308 "dense_output",
1309 "dense_output_errctrl",
1310 ]
1311 | None
1312 ) = None
1313 gbfnls: typing.Literal["newton", "kinsol"] | None = None
1314 s: (
1315 typing.Literal[
1316 "euler",
1317 "heun",
1318 "rungekutta",
1319 "impeuler",
1320 "trapezoid",
1321 "imprungekutta",
1322 "gbode",
1323 "irksco",
1324 "dassl",
1325 "ida",
1326 "cvode",
1327 "rungekuttaSsc",
1328 "symSolver",
1329 "symSolverSsc",
1330 "qss",
1331 "optimization",
1332 ]
1333 | None
1334 ) = None
1335 single: bool | None = None
1336 steps: bool | None = None
1337 steadyState: bool | None = None
1338 steadyStateTol: pydantic.PositiveFloat | None = None
1339 sx: pydantic.FilePath | None = None
1340 keepHessian: pydantic.PositiveInt | None = None
1341 w: bool | None = None
1342 parmodNumThreads: pydantic.PositiveInt | None = None
1343 LOG_STDOUT: bool | None = None
1344 LOG_ASSERT: bool | None = None
1345 LOG_DASSL: bool | None = None
1346 LOG_DASSL_STATES: bool | None = None
1347 LOG_DEBUG: bool | None = None
1348 LOG_DELAY: bool | None = None
1349 LOG_DIVISION: bool | None = None
1350 LOG_DSS: bool | None = None
1351 LOG_DSS_JAC: bool | None = None
1352 LOG_DT: bool | None = None
1353 LOG_DT_CONS: bool | None = None
1354 LOG_EVENTS: bool | None = None
1355 LOG_EVENTS_V: bool | None = None
1356 LOG_GBODE: bool | None = None
1357 LOG_GBODE_V: bool | None = None
1358 LOG_GBODE_NLS: bool | None = None
1359 LOG_GBODE_NLS_V: bool | None = None
1360 LOG_GBODE_STATES: bool | None = None
1361 LOG_INIT: bool | None = None
1362 LOG_INIT_HOMOTOPY: bool | None = None
1363 LOG_INIT_V: bool | None = None
1364 LOG_IPOPT: bool | None = None
1365 LOG_IPOPT_FULL: bool | None = None
1366 LOG_IPOPT_JAC: bool | None = None
1367 LOG_IPOPT_HESSE: bool | None = None
1368 LOG_IPOPT_ERROR: bool | None = None
1369 LOG_JAC: bool | None = None
1370 LOG_LS: bool | None = None
1371 LOG_LS_V: bool | None = None
1372 LOG_MIXED: bool | None = None
1373 LOG_NLS: bool | None = None
1374 LOG_NLS_V: bool | None = None
1375 LOG_NLS_HOMOTOPY: bool | None = None
1376 LOG_NLS_JAC: bool | None = None
1377 LOG_NLS_JAC_TEST: bool | None = None
1378 LOG_NLS_NEWTON_DIAG: bool | None = None
1379 LOG_NLS_RES: bool | None = None
1380 LOG_NLS_EXTRAPOLATE: bool | None = None
1381 LOG_RES_INIT: bool | None = None
1382 LOG_RT: bool | None = None
1383 LOG_SIMULATION: bool | None = None
1384 LOG_SOLVER: bool | None = None
1385 LOG_SOLVER_V: bool | None = None
1386 LOG_SOLVER_CONTEXT: bool | None = None
1387 LOG_SOTI: bool | None = None
1388 LOG_SPATIALDISTR: bool | None = None
1389 LOG_STATS: bool | None = None
1390 LOG_STATS_V: bool | None = None
1391 LOG_SUCCESS: bool | None = None
1392 LOG_SYNCHRONOUS: bool | None = None
1393 LOG_ZEROCROSSINGS: bool | None = None
1394 max_warn: int | None = None
1396 @pydantic.model_validator(mode="before")
1397 @classmethod
1398 def check_embedded_server_port(
1399 cls, values: dict[str, typing.Any] | None
1400 ) -> dict[str, typing.Any] | None:
1401 if (
1402 isinstance(values, dict)
1403 and values.get("embedded_server_port")
1404 and not values.get("embedded_server")
1405 ):
1406 raise AssertionError(
1407 "Cannot specify embedded server port without specifying value for 'embedded_server'"
1408 )
1409 return values
1411 @pydantic.model_validator(mode="before")
1412 @classmethod
1413 def check_homotopy_steps_and_symbolic(
1414 cls, values: dict[str, typing.Any] | None
1415 ) -> dict[str, typing.Any] | None:
1416 if (
1417 values
1418 and values.get("homotopy_n_steps") is not None
1419 and (_init_method := values.get("initialisation_method")) is not None
1420 and _init_method != "symbolic"
1421 ):
1422 raise AssertionError(
1423 f"Cannot specify 'homotopy_n_steps' with initialisation_method={_init_method}"
1424 )
1425 return values
1427 @pydantic.model_validator(mode="before")
1428 @classmethod
1429 def check_override_override_file(
1430 cls, values: dict[str, typing.Any] | None
1431 ) -> dict[str, typing.Any] | None:
1432 if values and values.get("override") is not None and values.get("overrideFile"):
1433 raise AssertionError("Cannot specify both 'override' and 'overrideFile'")
1434 return values
1436 def assemble_args(self) -> list[str]:
1437 _args_list: list[str] = []
1438 _log_levels_list: list[str] = []
1439 for arg_name, arg in self.model_dump().items():
1440 if not arg:
1441 continue
1442 if arg_name.startswith("LOG_"):
1443 _log_levels_list.append(f"{'-' if not arg else ''}{arg_name}")
1444 elif isinstance(arg, bool):
1445 _args_list.append(f"-{arg_name}")
1446 elif isinstance(arg, (list, tuple)):
1447 _args_list.append(f"-{arg_name}=" + ",".join(*arg))
1448 else:
1449 _args_list.append(f"-{arg_name}={arg}")
1451 if _log_levels_list:
1452 _args_list.append(f"-lv={','.join(_log_levels_list)}")
1454 return _args_list
1456 @property
1457 def inputPath(self) -> None:
1458 raise AssertionError(
1459 "Cannot access argument 'inputPath', this is used internally by Pydelica "
1460 "to setup simulations"
1461 )
1463 @inputPath.setter
1464 def inputPath(self, _) -> None:
1465 raise AssertionError(
1466 "Cannot set argument 'inputPath', this is used internally by Pydelica "
1467 "to setup simulations"
1468 )