Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
menon-karthik committed Jun 25, 2024
1 parent da3afcc commit 97ec859
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/pages/add_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Below are details on the steps required to implement a new block in svZeroDSolve
## The class should have a `TripletsContributions num_triplets{*, *, *}` object.
* This specifies how many elements the governing equations of the block contribute to the global `F`, `E` and `dC_dy` matrices respectively. Details are in Step 3 below.

* The class should have an `update_constant` function and may also contain `update_time` and `update_solution` functions. These functions implement the governing equations for the block. Details are in Step 4 below.
## The class should have an `update_constant` function and may also contain `update_time` and `update_solution` functions. These functions implement the governing equations for the block. Details are in Step 4 below.

## *(Optional)* The class can have an `enum ParamId` object that relates the parameter indices to their names.
* This makes it easier to reference the parameters while implementing the governing equations of the block (discussed below).
Expand Down Expand Up @@ -137,11 +137,13 @@ e*dP_out/dt + f*Q_out*Q_out + g*P_out + h*I_1 = 0

* Implement the `update_constant`, `update_time` and `update_solution` functions.

* All matrix elements that are constant are specified in `update_constant(SparseSystem &system, std::vector<double> &parameters)`.
* All matrix elements that are constant are specified in `update_constant`.

* Matrix elements that depend only on time (not the solution of the problem itself) are specified in `update_time(SparseSystem &system, std::vector<double> &parameters)`.
* Matrix elements that depend only on time (not the solution of the problem itself) are specified in `update_time`.

* Matrix elements that change with the solution (i.e. depend on the state variables themselves) are specified in `update_solution`. Not all blocks will require the latter two functions.
* Matrix elements that change with the solution (i.e. depend on the state variables themselves) are specified in `update_solution`.

* Not all blocks will require the `update_time` and `update_solution` functions.

* The elements of the `E`, `F`, `dC_dy` and `dC_dydot` matrices are populated using the syntax
```
Expand Down

0 comments on commit 97ec859

Please sign in to comment.