#ifndef PW_PowerSystem__H
#define PW_PowerSystem__H
#include "meta/meta_modelica.h"
#include "util/modelica.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>

#include "simulation/simulation_runtime.h"
#ifdef __cplusplus
extern "C" {
#endif

typedef struct Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE_s {
  modelica_real _lossPowerArmature;
  modelica_real _lossPowerBrush;
  modelica_real _lossPowerCore;
  modelica_real _lossPowerExcitation;
  modelica_real _lossPowerFriction;
  modelica_real _lossPowerStrayLoad;
  modelica_real _lossPowerTotal;
  modelica_real _powerArmature;
  modelica_real _powerExcitation;
  modelica_real _powerInertiaRotor;
  modelica_real _powerInertiaStator;
  modelica_real _powerMechanical;
} Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE;
typedef base_array_t Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE_array;
extern struct record_description Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE__desc;

typedef struct Modelica_Electrical_Machines_Losses_BrushParameters_s {
  modelica_real _ILinear;
  modelica_real _V;
} Modelica_Electrical_Machines_Losses_BrushParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_BrushParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_BrushParameters__desc;

typedef struct Modelica_Electrical_Machines_Losses_CoreParameters_s {
  modelica_real _GcRef;
  modelica_real _PRef;
  modelica_real _VRef;
  modelica_integer _m;
  modelica_real _ratioHysteresis;
  modelica_real _wMin;
  modelica_real _wRef;
} Modelica_Electrical_Machines_Losses_CoreParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_CoreParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_CoreParameters__desc;

typedef struct Modelica_Electrical_Machines_Losses_FrictionParameters_s {
  modelica_real _PRef;
  modelica_real _linear;
  modelica_real _power_w;
  modelica_real _tauLinear;
  modelica_real _tauRef;
  modelica_real _wLinear;
  modelica_real _wRef;
} Modelica_Electrical_Machines_Losses_FrictionParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_FrictionParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_FrictionParameters__desc;

typedef struct Modelica_Electrical_Machines_Losses_StrayLoadParameters_s {
  modelica_real _IRef;
  modelica_real _PRef;
  modelica_real _power_w;
  modelica_real _tauRef;
  modelica_real _wRef;
} Modelica_Electrical_Machines_Losses_StrayLoadParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_StrayLoadParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_StrayLoadParameters__desc;

typedef Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance;
typedef base_array_t Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance_array;
extern struct record_description Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance__desc;

typedef Modelica_Electrical_Machines_Losses_BrushParameters Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters__desc;

typedef Modelica_Electrical_Machines_Losses_CoreParameters Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters__desc;

typedef Modelica_Electrical_Machines_Losses_FrictionParameters Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters__desc;

typedef Modelica_Electrical_Machines_Losses_StrayLoadParameters Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters;
typedef base_array_t Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters_array;
extern struct record_description Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters__desc;

DLLExport
Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE omc_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE (threadData_t *threadData, modelica_real omc_powerArmature, modelica_real omc_powerMechanical, modelica_real omc_powerInertiaStator, modelica_real omc_powerInertiaRotor, modelica_real omc_lossPowerTotal, modelica_real omc_lossPowerArmature, modelica_real omc_lossPowerCore, modelica_real omc_lossPowerStrayLoad, modelica_real omc_lossPowerFriction, modelica_real omc_lossPowerBrush, modelica_real omc_powerExcitation, modelica_real omc_lossPowerExcitation);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE(threadData_t *threadData, modelica_metatype _powerArmature, modelica_metatype _powerMechanical, modelica_metatype _powerInertiaStator, modelica_metatype _powerInertiaRotor, modelica_metatype _lossPowerTotal, modelica_metatype _lossPowerArmature, modelica_metatype _lossPowerCore, modelica_metatype _lossPowerStrayLoad, modelica_metatype _lossPowerFriction, modelica_metatype _lossPowerBrush, modelica_metatype _powerExcitation, modelica_metatype _lossPowerExcitation);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE,0}};
#define boxvar_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE)


DLLExport
Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance omc_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance (threadData_t *threadData, modelica_real omc_powerArmature, modelica_real omc_powerMechanical, modelica_real omc_powerInertiaStator, modelica_real omc_powerInertiaRotor, modelica_real omc_lossPowerTotal, modelica_real omc_lossPowerArmature, modelica_real omc_lossPowerCore, modelica_real omc_lossPowerStrayLoad, modelica_real omc_lossPowerFriction, modelica_real omc_lossPowerBrush, modelica_real omc_powerExcitation, modelica_real omc_lossPowerExcitation);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance(threadData_t *threadData, modelica_metatype _powerArmature, modelica_metatype _powerMechanical, modelica_metatype _powerInertiaStator, modelica_metatype _powerInertiaRotor, modelica_metatype _lossPowerTotal, modelica_metatype _lossPowerArmature, modelica_metatype _lossPowerCore, modelica_metatype _lossPowerStrayLoad, modelica_metatype _lossPowerFriction, modelica_metatype _lossPowerBrush, modelica_metatype _powerExcitation, modelica_metatype _lossPowerExcitation);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance,0}};
#define boxvar_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Interfaces_DCMachines_PowerBalanceDCEE$motor$powerBalance)


DLLExport
Modelica_Electrical_Machines_Losses_BrushParameters omc_Modelica_Electrical_Machines_Losses_BrushParameters (threadData_t *threadData, modelica_real omc_V, modelica_real omc_ILinear);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_BrushParameters(threadData_t *threadData, modelica_metatype _V, modelica_metatype _ILinear);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_BrushParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_BrushParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_BrushParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_BrushParameters)


DLLExport
Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters omc_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters (threadData_t *threadData, modelica_real omc_V, modelica_real omc_ILinear);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters(threadData_t *threadData, modelica_metatype _V, modelica_metatype _ILinear);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_BrushParameters$motor$brushParameters)


DLLExport
Modelica_Electrical_Machines_Losses_CoreParameters omc_Modelica_Electrical_Machines_Losses_CoreParameters (threadData_t *threadData, modelica_integer omc_m, modelica_real omc_PRef, modelica_real omc_VRef, modelica_real omc_wRef, modelica_real omc_ratioHysteresis, modelica_real omc_GcRef, modelica_real omc_wMin);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_CoreParameters(threadData_t *threadData, modelica_metatype _m, modelica_metatype _PRef, modelica_metatype _VRef, modelica_metatype _wRef, modelica_metatype _ratioHysteresis, modelica_metatype _GcRef, modelica_metatype _wMin);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_CoreParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_CoreParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_CoreParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_CoreParameters)


DLLExport
Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters omc_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters (threadData_t *threadData, modelica_integer omc_m, modelica_real omc_PRef, modelica_real omc_VRef, modelica_real omc_wRef, modelica_real omc_ratioHysteresis, modelica_real omc_GcRef, modelica_real omc_wMin);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters(threadData_t *threadData, modelica_metatype _m, modelica_metatype _PRef, modelica_metatype _VRef, modelica_metatype _wRef, modelica_metatype _ratioHysteresis, modelica_metatype _GcRef, modelica_metatype _wMin);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_CoreParameters$motor$coreParameters)


DLLExport
Modelica_Electrical_Machines_Losses_FrictionParameters omc_Modelica_Electrical_Machines_Losses_FrictionParameters (threadData_t *threadData, modelica_real omc_PRef, modelica_real omc_wRef, modelica_real omc_power_w, modelica_real omc_tauRef, modelica_real omc_linear, modelica_real omc_wLinear, modelica_real omc_tauLinear);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_FrictionParameters(threadData_t *threadData, modelica_metatype _PRef, modelica_metatype _wRef, modelica_metatype _power_w, modelica_metatype _tauRef, modelica_metatype _linear, modelica_metatype _wLinear, modelica_metatype _tauLinear);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_FrictionParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_FrictionParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_FrictionParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_FrictionParameters)


DLLExport
Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters omc_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters (threadData_t *threadData, modelica_real omc_PRef, modelica_real omc_wRef, modelica_real omc_power_w, modelica_real omc_tauRef, modelica_real omc_linear, modelica_real omc_wLinear, modelica_real omc_tauLinear);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters(threadData_t *threadData, modelica_metatype _PRef, modelica_metatype _wRef, modelica_metatype _power_w, modelica_metatype _tauRef, modelica_metatype _linear, modelica_metatype _wLinear, modelica_metatype _tauLinear);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_FrictionParameters$motor__frictionParameters)


DLLExport
Modelica_Electrical_Machines_Losses_StrayLoadParameters omc_Modelica_Electrical_Machines_Losses_StrayLoadParameters (threadData_t *threadData, modelica_real omc_PRef, modelica_real omc_IRef, modelica_real omc_wRef, modelica_real omc_power_w, modelica_real omc_tauRef);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_StrayLoadParameters(threadData_t *threadData, modelica_metatype _PRef, modelica_metatype _IRef, modelica_metatype _wRef, modelica_metatype _power_w, modelica_metatype _tauRef);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_StrayLoadParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_StrayLoadParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_StrayLoadParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_StrayLoadParameters)


DLLExport
Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters omc_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters (threadData_t *threadData, modelica_real omc_PRef, modelica_real omc_IRef, modelica_real omc_wRef, modelica_real omc_power_w, modelica_real omc_tauRef);

DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters(threadData_t *threadData, modelica_metatype _PRef, modelica_metatype _IRef, modelica_metatype _wRef, modelica_metatype _power_w, modelica_metatype _tauRef);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_StrayLoadParameters$motor$strayLoadParameters)


DLLExport
modelica_real omc_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop(threadData_t *threadData, Modelica_Electrical_Machines_Losses_BrushParameters _brushParameters, modelica_real _i);
DLLExport
modelica_metatype boxptr_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop(threadData_t *threadData, modelica_metatype _brushParameters, modelica_metatype _i);
static const MMC_DEFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop,2,0) {(void*) boxptr_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop,0}};
#define boxvar_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop MMC_REFSTRUCTLIT(boxvar_lit_Modelica_Electrical_Machines_Losses_DCMachines_brushVoltageDrop)
#include "PW_PowerSystem_model.h"


#ifdef __cplusplus
}
#endif
#endif

