Compute the dissipative term for the FPPowerSystem3Bus system.
More...
#include <stdlib.h>
#include <basic.h>
#include <arrayfunctions.h>
#include <physicalmodels/fppowersystem3bus.h>
#include <hypar.h>
Go to the source code of this file.
Compute the dissipative term for the FPPowerSystem3Bus system.
- Author
- Debojyoti Ghosh
Definition in file FPPowerSystem3BusDiffusion.c.
◆ FPPowerSystem3BusDissipationFunction()
int FPPowerSystem3BusDissipationFunction |
( |
int |
dir1, |
|
|
int |
dir2, |
|
|
void * |
p, |
|
|
double |
t, |
|
|
double * |
dissp |
|
) |
| |
Compute the dissipation coefficient for the 3-bus power system
- Parameters
-
dir1 | First spatial dimension for the dissipation coefficient |
dir2 | Second spatial dimension for the dissipation coefficient |
p | Object of type FPPowerSystem3Bus |
t | Current simulation time |
dissp | Matrix of size ndims*ndims to hold the dissipation coefficients (row-major format) |
Definition at line 117 of file FPPowerSystem3BusFunctions.c.
129 double sigma11 = params->
sigma[0][0];
130 double sigma12 = params->
sigma[0][1];
131 double sigma21 = params->
sigma[1][0];
132 double sigma22 = params->
sigma[1][1];
134 double lambda11 = params->
lambda[0][0];
135 double lambda12 = params->
lambda[0][1];
136 double lambda21 = params->
lambda[1][0];
137 double lambda22 = params->
lambda[1][1];
139 double gamma = params->
gamma;
140 double omegaB = params->
omegaB;
144 dissp[2*
_MODEL_NDIMS_+0] = sigma11*sigma11*lambda11*lambda11*omegaB;
145 dissp[2*
_MODEL_NDIMS_+1] = sigma12*sigma12*lambda12*lambda12*omegaB;
146 dissp[3*
_MODEL_NDIMS_+0] = sigma21*sigma21*lambda21*lambda21*omegaB;
147 dissp[3*
_MODEL_NDIMS_+1] = sigma22*sigma22*lambda22*lambda22*omegaB;
149 dissp[2*
_MODEL_NDIMS_+2] = sigma11*sigma11*lambda11*(1.0-gamma*lambda11);
150 dissp[2*
_MODEL_NDIMS_+3] = sigma12*sigma12*lambda12*(1.0-gamma*lambda12);
151 dissp[3*
_MODEL_NDIMS_+2] = sigma21*sigma21*lambda21*(1.0-gamma*lambda21);
152 dissp[3*
_MODEL_NDIMS_+3] = sigma22*sigma22*lambda22*(1.0-gamma*lambda22);
156 dissp[2*
_MODEL_NDIMS_+0] = sigma11*sigma11*lambda11*omegaB*(lambda11*(1-exp(-t/lambda11))-t*exp(-t/lambda11));
157 dissp[2*
_MODEL_NDIMS_+1] = sigma12*sigma12*lambda12*omegaB*(lambda12*(1-exp(-t/lambda12))-t*exp(-t/lambda12));
158 dissp[3*
_MODEL_NDIMS_+0] = sigma21*sigma21*lambda21*omegaB*(lambda21*(1-exp(-t/lambda21))-t*exp(-t/lambda21));
159 dissp[3*
_MODEL_NDIMS_+1] = sigma22*sigma22*lambda22*omegaB*(lambda22*(1-exp(-t/lambda22))-t*exp(-t/lambda22));
161 dissp[2*
_MODEL_NDIMS_+2] = sigma11*sigma11*(lambda11*(1-exp(-t/lambda11))+gamma*lambda11*(t*exp(-t/lambda11)-lambda11*(1-exp(-t/lambda11))));
162 dissp[2*
_MODEL_NDIMS_+3] = sigma12*sigma12*(lambda12*(1-exp(-t/lambda12))+gamma*lambda12*(t*exp(-t/lambda12)-lambda12*(1-exp(-t/lambda12))));
163 dissp[3*
_MODEL_NDIMS_+2] = sigma21*sigma21*(lambda21*(1-exp(-t/lambda21))+gamma*lambda21*(t*exp(-t/lambda21)-lambda21*(1-exp(-t/lambda21))));
164 dissp[3*
_MODEL_NDIMS_+3] = sigma22*sigma22*(lambda22*(1-exp(-t/lambda22))+gamma*lambda22*(t*exp(-t/lambda22)-lambda22*(1-exp(-t/lambda22))));
#define _ArraySetValue_(x, size, value)
Structure containing variable and parameters specific to the 3-bus power system model. This structure contains the physical parameters and variables for the Fokker-Planck model for a 3-bus power system.
◆ FPPowerSystem3BusDiffusion()
int FPPowerSystem3BusDiffusion |
( |
double * |
f, |
|
|
double * |
u, |
|
|
int |
dir1, |
|
|
int |
dir2, |
|
|
void * |
s, |
|
|
double |
t |
|
) |
| |
Compute the dissipation term for the FPPowerSystem3Bus system
- Parameters
-
f | Array to hold the computed dissipation term vector (same layout as u) |
u | Array with the solution vector |
dir1 | First spatial dimension for the dissipation term being computed |
dir2 | Second spatial dimension for the dissipation term being computed |
s | Solver object of type HyPar |
t | Current simulation time |
Definition at line 15 of file FPPowerSystem3BusDiffusion.c.
29 int ghosts = solver->
ghosts;
Structure containing all solver-specific variables and functions.
int FPPowerSystem3BusDissipationFunction(int, int, void *, double, double *)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
Structure containing variable and parameters specific to the 3-bus power system model. This structure contains the physical parameters and variables for the Fokker-Planck model for a 3-bus power system.
#define _ArrayCopy1D_(x, y, size)