00001
00002
00003
00004
00005 #ifndef _SOLVER_NR
00006 #define _SOLVER_NR
00007
00008 #include "complex.h"
00009
00010 typedef struct {
00011 int type;
00012 unsigned char phases;
00013 unsigned char origphases;
00014 complex *V;
00015 complex *S;
00016 complex *Y;
00017 complex *I;
00018 complex *extra_var;
00019 complex *house_var;
00020 int *Link_Table;
00021 unsigned int Link_Table_Size;
00022 double PL[3];
00023 double QL[3];
00024 double PG[3];
00025 double QG[3];
00026 double kv_base;
00027 double mva_base;
00028 double Jacob_A[3];
00029 double Jacob_B[3];
00030 double Jacob_C[3];
00031 double Jacob_D[3];
00032 unsigned int Matrix_Loc;
00033 double max_volt_error;
00034 char *name;
00035 int Parent_Node;
00036 int *Child_Nodes;
00037 unsigned int Child_Node_idx;
00038 } BUSDATA;
00039
00040 typedef struct {
00041 complex *Yfrom;
00042 complex *Yto;
00043 complex *YSfrom;
00044 complex *YSto;
00045 unsigned char phases;
00046 unsigned char origphases;
00047 int from;
00048 int to;
00049 bool *status;
00050 double v_ratio;
00051 char *name;
00052 } BRANCHDATA;
00053
00054 typedef struct Y_NR{
00055 int row_ind;
00056 int col_ind;
00057 double Y_value;
00058 } Y_NR;
00059
00060 typedef struct {
00061 int row_ind;
00062 int col_ind;
00063 complex Y[3][3];
00064 char size;
00065 } Bus_admit;
00066
00067
00068 int64 solver_nr(unsigned int bus_count, BUSDATA *bus, unsigned int branch_count, BRANCHDATA *branch, bool *bad_computations);
00069
00070 #endif