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
simplify =false, linear_independent =false, name =gensym(:Basis),
10
+
pins = [], observed = [], eval_expression =false,
11
+
kwargs...)
8
12
```
13
+
where `eqs` is either a vector containing symbolic functions using 'ModelingToolkit.jl' or a general function with the typical DiffEq signature `h(u,p,t)`, which can be used with an `Num` or vector of `Num`. `states` are the dependent variables used to describe the Basis, and
14
+
`parameters` are the optional parameters in the `Basis`. `iv` represents the independent variable of the system - in most cases the time. Additional arguments are `simplify`, which simplifies `eqs` before creating a `Basis`. `linear_dependent` breaks up `eqs` in linear independent elements which are unique. `name` is an optional name for the `Basis`, `pins` and `observed` can be using in accordance to ModelingToolkits documentation. `eval_expression` is used to generate a callable function from the eqs. If set to `false`, callable code will be returned. `true` will use `eval` on code returned from the function, which might cause worldage issues.
9
15
10
-
where `h` is either a vector of ModelingToolkit `Operation`s for the valid functional
11
-
forms or a general function with the typical DiffEq signature `h(u,p,t)`, which can be used with an `Operation` or vector of `Operation`. `u` are the ModelingToolkit `Variable`s used to describe the Basis, and
12
-
`parameters` are the optional ModelingToolkit `Variable`s used to describe the
13
-
parameters in the basis elements. `iv` represents the independent variable of the system - the time.
14
16
15
17
```@docs
16
18
Basis
17
19
```
18
20
19
21
## Example
20
22
21
-
We start by crearting some `Variables` and `Parameters` using `ModelingToolkit`.
23
+
We start by crearting some variables and parameters using `ModelingToolkit`.
22
24
```@example basis
23
25
using LinearAlgebra
24
26
using DataDrivenDiffEq
@@ -29,14 +31,11 @@ using ModelingToolkit
29
31
@parameters w[1:2]
30
32
```
31
33
32
-
To define a basis, simply write down the equations you want to be included as a
33
-
`Vector{Operation}`. Possible used parameters have to be given to the constructor.
34
+
To define a basis, simply write down the equations you want to be included as a `Vector`. Possible used parameters have to be given to the constructor.
34
35
```@example basis
35
36
h = [u[1]; u[2]; cos(w[1]*u[2]+w[2]*u[3])]
36
37
b = Basis(h, u, parameters = w)
37
38
```
38
-
What can a `Basis` do? Can it do stuff? Let's find out!
39
-
40
39
`Basis` are callable with the signature of functions to be used in `DifferentialEquations`.
41
40
So, the function value at a single point looks like:
42
41
```@example basis
@@ -70,7 +69,7 @@ push!(b, sin(u[1]))
70
69
size(b)
71
70
```
72
71
73
-
We can also define functions of time and add them
72
+
We can also define functions of the independent variable and add them
0 commit comments