From 2aef861b3530e30a326f3b5aff4bcb7b77c54b33 Mon Sep 17 00:00:00 2001 From: Torsten Sommer Date: Wed, 15 Nov 2023 10:44:52 +0100 Subject: [PATCH] Fix whitespace --- StateSpace/FMI3.xml | 124 +++++++++++++++++++++---------------------- StateSpace/model.c | 14 ++--- StateSpace/readme.md | 14 ++--- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/StateSpace/FMI3.xml b/StateSpace/FMI3.xml index 3eba264c..3188c42a 100644 --- a/StateSpace/FMI3.xml +++ b/StateSpace/FMI3.xml @@ -5,72 +5,72 @@ generationTool="Reference FMUs (development build)" instantiationToken="{D773325B-AB94-4630-BF85-643EB24FCB78}"> - + - + - - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/StateSpace/model.c b/StateSpace/model.c index 856bb1ec..e5d2ca9b 100644 --- a/StateSpace/model.c +++ b/StateSpace/model.c @@ -36,9 +36,9 @@ Status calculateValues(ModelInstance *comp) { // der(x) = Ax + Bu for (size_t i = 0; i < M(n); i++) { - + M(der_x)[i] = 0; - + for (size_t j = 0; j < M(n); j++) { M(der_x)[i] += M(A)[i][j] * M(x)[j]; } @@ -56,7 +56,7 @@ Status calculateValues(ModelInstance *comp) { for (size_t i = 0; i < M(r); i++) { M(y)[i] = 0; - + for (size_t j = 0; j < M(n); j++) { M(y)[i] += M(C)[i][j] * M(x)[j]; } @@ -282,9 +282,9 @@ size_t getNumberOfContinuousStates(ModelInstance* comp) { } void getContinuousStates(ModelInstance* comp, double x[], size_t nx) { - + // TODO: assert nx == M(n) - + UNUSED(nx); for (size_t i = 0; i < M(n); i++) { @@ -293,7 +293,7 @@ void getContinuousStates(ModelInstance* comp, double x[], size_t nx) { } void setContinuousStates(ModelInstance* comp, const double x[], size_t nx) { - + // TODO: assert nx == M(n) UNUSED(nx); @@ -314,4 +314,4 @@ void getDerivatives(ModelInstance* comp, double dx[], size_t nx) { for (size_t i = 0; i < M(n); i++) { dx[i] = M(der_x)[i]; } -} \ No newline at end of file +} diff --git a/StateSpace/readme.md b/StateSpace/readme.md index 5d87207f..870ff4d5 100644 --- a/StateSpace/readme.md +++ b/StateSpace/readme.md @@ -3,16 +3,16 @@ The StateSpace model implements the equation ``` -Ẋ = Ax + Bu -y = Cx + Du +der(x) = Ax + Bu + y = Cx + Du ``` -where +where -- `A` is an `n×n` matrix, where `n` is the number of states, -- `B` is an `n×m` matrix, where `m` is the number of inputs, -- `C` is an `r×n` matrix, where `r` is the number of outputs, -- `D` is an `r×m` matrix, and +- `A` is an `n` by `n` matrix, where `n` is the number of states, +- `B` is an `n` by `m` matrix, where `m` is the number of inputs, +- `C` is an `r` by `n` matrix, where `r` is the number of outputs, +- `D` is an `r` by `m` matrix, and - `x0` is the initial value of `x`