File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " ProcessBasedModelling"
2
2
uuid = " ca969041-2cf3-4b10-bc21-86f4417093eb"
3
3
authors = [
" Datseris <[email protected] >" ]
4
- version = " 1.2.0 "
4
+ version = " 1.2.1 "
5
5
6
6
[deps ]
7
7
ModelingToolkit = " 961ee093-0014-501f-94e3-6117800e7a78"
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ The type must extend the following functions from the module `ProcessBasedModell
12
12
- (optional) `lhs(p)` which returns the left-hand-side. Let `τ = timescale(p)`.
13
13
Then default `lhs(p)` behaviour depends on `τ` as follows:
14
14
- Just `lhs_variable(p)` if `τ == NoTimeDerivative()`.
15
- - `Differential(t)(p)` if `τ == nothing`.
15
+ - `Differential(t)(p)` if `τ == nothing`, or multiplied with a number
16
+ if `τ isa LiteralParameter`.
16
17
- `τ_var*Differential(t)(p)` if `τ isa Union{Real, Num}`. If real,
17
18
a new named parameter `τ_var` is created that has the prefix `:τ_` and then the
18
19
lhs-variable name and has default value `τ`. Else if `Num`, `τ_var = τ` as given.
@@ -62,6 +63,8 @@ function lhs(p::Process)
62
63
v = lhs_variable (p)
63
64
if isnothing (τ) # time variability exists but timescale is nonexistent (unity)
64
65
return D (v) # `D` is the MTK canonical variable for time derivative
66
+ elseif τ isa LiteralParameter
67
+ return τ. p* D (v)
65
68
elseif τ isa NoTimeDerivative || iszero (τ) # no time variability
66
69
return v
67
70
else # τ is either Num or Real
You can’t perform that action at this time.
0 commit comments