@@ -60,13 +60,13 @@ function is_variable(x)
60
60
end
61
61
62
62
"""
63
- new_derived_named_parameter(variable, value, extra::String, suffix = true)
63
+ new_derived_named_parameter(variable, value, extra::String, prefix = true)
64
64
65
65
If `value isa Num` return `value`.
66
- If `value isa `[` LiteralParameter`](@ref) , replace it with its literal value.
66
+ If `value isa LiteralParameter`, replace it with its literal value.
67
67
Otherwise, create a new MTK `@parameter`
68
- whose name is created from `variable` by adding the `extra` string.
69
- If `suffix == true ` the extra is added at the end after a `_`. Otherwise
68
+ whose name is created from `variable` (which could also be just a `Symbol`) by adding the `extra` string.
69
+ If `prefix == false ` the ` extra` is added at the end after a `_`. Otherwise
70
70
it is added at the start, then a `_` and then the variable name.
71
71
72
72
For example,
@@ -79,9 +79,9 @@ Now `p` will be a parameter with name `:τ_x` and default value `0.5`.
79
79
"""
80
80
new_derived_named_parameter (v, value:: Num , args... ) = value
81
81
new_derived_named_parameter (v, value:: LiteralParameter , args... ) = value. p
82
- function new_derived_named_parameter (v, value:: Real , extra, suffix = true )
82
+ function new_derived_named_parameter (v, value:: Real , extra, prefix = true )
83
83
n = string (ModelingToolkit. getname (v))
84
- newstring = if suffix
84
+ newstring = if ! (prefix)
85
85
n* " _" * extra
86
86
else
87
87
extra* " _" * n
0 commit comments