You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build the observed function assuming the observed equations are all explicit,
415
-
i.e. there are no cycles.
414
+
Generates a function that computes the observed value(s) `ts` in the system `sys` assuming that there are no cycles in the equations.
415
+
416
+
The return value will be either:
417
+
* a single function if the input is a scalar or if the input is a Vector but `return_inplace` is false
418
+
* the out of place and in-place functions `(ip, oop)` if `return_inplace` is true and the input is a `Vector`
419
+
420
+
The function(s) will be:
421
+
* `RuntimeGeneratedFunction`s by default,
422
+
* A Julia `Expr` if `expression` is true,
423
+
* A directly evaluated Julia function in the module `eval_module` if `eval_expression` is true
424
+
425
+
The signatures will be of the form `g(...)` with arguments:
426
+
* `output` for in-place functions
427
+
* `unknowns` if `params_only` is `false`
428
+
* `inputs` if `inputs` is an array of symbolic inputs that should be available in `ts`
429
+
* `p...` unconditionally; note that in the case of `MTKParameters` more than one parameters argument may be present, so it must be splatted
430
+
* `t` if the system is time-dependent; for example `NonlinearSystem` will not have `t`
431
+
For example, a function `g(op, unknowns, p, inputs, t)` will be the in-place function generated if `return_inplace` is true, `ts` is a vector, an array of inputs `inputs` is given, and `params_only` is false for a time-dependent system.
432
+
433
+
Options not otherwise specified are:
434
+
* `output_type = Array` the type of the array generated by the out-of-place vector-valued function
435
+
* `checkbounds = true` checks bounds if true when destructuring parameters
436
+
* `op = Operator` sets the recursion terminator for the walk done by `vars` to identify the variables that appear in `ts`. See the documentation for `vars` for more detail.
437
+
* `throw = true` if true, throw an error when generating a function for `ts` that reference variables that do not exist
438
+
* `drop_expr` is deprecated.
439
+
* `mkarray`; only used if the output is an array (that is, `!isscalar(ts)`). Called as `mkarray(ts, output_type)` where `ts` are the expressions to put in the array and `output_type` is the argument of the same name passed to build_explicit_observed_function.
416
440
"""
417
441
functionbuild_explicit_observed_function(sys, ts;
418
442
inputs =nothing,
@@ -426,7 +450,8 @@ function build_explicit_observed_function(sys, ts;
426
450
return_inplace =false,
427
451
param_only =false,
428
452
op = Operator,
429
-
throw =true)
453
+
throw =true,
454
+
mkarray = MakeArray)
430
455
if (isscalar =symbolic_type(ts) !==NotSymbolic())
431
456
ts = [ts]
432
457
end
@@ -571,12 +596,11 @@ function build_explicit_observed_function(sys, ts;
0 commit comments