NN library trained with actual motor data

Dependents:   NN_final

neural_network_3ph.h

Committer:
cpm219
Date:
2016-11-07
Revision:
0:efebbd20f066

File content as of revision 0:efebbd20f066:

//
// File: neural_network_3ph.h
//
// Code generated for Simulink model 'neural_network_3ph'.
//
// Model version                  : 1.12
// Simulink Coder version         : 8.10 (R2016a) 10-Feb-2016
// C/C++ source code generated on : Tue Nov 01 15:14:34 2016
//
// Target selection: ert.tlc
// Embedded hardware selection: ARM Compatible->ARM Cortex
// Code generation objectives: Unspecified
// Validation result: Not run
//
#ifndef RTW_HEADER_neural_network_3ph_h_
#define RTW_HEADER_neural_network_3ph_h_
#include <math.h>
#include <stddef.h>
#ifndef neural_network_3ph_COMMON_INCLUDES_
# define neural_network_3ph_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 // neural_network_3ph_COMMON_INCLUDES_

#include "neural_network_3ph_types.h"

// Macros for accessing real-time model data structure
#ifndef rtmGetErrorStatus
# define rtmGetErrorStatus(rtm)        ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
# define rtmSetErrorStatus(rtm, val)   ((rtm)->errorStatus = (val))
#endif

// Block signals (auto storage)
typedef struct {
  real_T dv0[8];
  real_T d0;
  real_T d1;
} B_neural_network_3ph_T;

// Constant parameters (auto storage)
typedef struct {
  // Expression: [0.91242867176908671;0.87305852679912554;0.040063223953927155;-0.34762192603285014;-0.2260490358434093;0.17441602364205572;-0.11509034045035864;-0.68074656113101228]
  //  Referenced by: '<S18>/IW{2,1}(1,:)''

  real_T IW211_Value[8];

  // Expression: [-0.071275893112401678;0.13385784646371734;-0.024456356984906252;0.015206448597457012;0.35879852843221061;0.1009749243263154;-0.15060922602202531;-0.47403081523358492;-0.091600947652789311;-0.15390953511989544;0.10857797535312828;0.23089434250147417;0.12737161332043898;-0.19055291801514804;0.31058412674710723;-0.13740060112318486;-0.19813543801452882;0.16524603419825093;0.12165656873326144;-0.31686349654330581;0.05297057736907175;0.31298149773166484;-0.13642862294236902;0.03066318084876429;-0.1123029836273618;-0.20726687401858274;-0.16843846669976986;0.35057734015547526;0.16504095583640721;-0.19742096578772403;0.028444850800720539;0.17823405774567555;-0.27309733421990312;0.04785908849235429;-0.12973084826467676;-0.1139776695202256;-0.1920728827778358;-0.19960008422850303;0.30335620532579977;0.074597717705682978;0.29338412947327197;0.29734137418565637;0.010390269724118778;0.71214271087354808;0.82630634549808624;0.78851639969654819;0.18452599934696684;0.31870018518441329;0.4458966613925896;-0.042821412460846593;0.59089337810678177;0.23823216096639224;-0.064143083682053376;0.18485962917550375;0.041430871737148524;-0.18698223584221751;-0.026416155784052264;0.079363221578798687;-0.10588640973836375;-0.19454231064527744;-0.038083087517368358]
  //  Referenced by: '<S7>/IW{1,1}(1,:)''

  real_T IW111_Value[61];

  // Expression: -xmin
  //  Referenced by: '<S22>/Subtract min x'

  real_T Subtractminx_Bias[61];

  // Expression: (ymax-ymin)./(xmax-xmin)
  //  Referenced by: '<S22>/range y // range x'

  real_T rangeyrangex_Gain[61];

  // Expression: [-0.14079270291259133;0.075097060293862039;0.097548280841266655;0.122141337856432;0.31356110473583509;0.036572041285211118;-0.46217742249268212;-0.096128177325205996;-0.16117413173551715;-0.0038088387801147594;-0.2187267531293276;0.60100152441594501;0.30010167957967415;0.45654671524721535;-0.21365082404385502;0.30844055803654047;0.087688543948680642;0.17305068890467157;-0.46157123586728932;0.051107132532999339;0.068781552992404044;0.032985953172833427;-0.010034886019429555;-0.13171209689016433;-0.35161109016838488;-0.13851823053904205;0.10742436463164182;0.35192011098161308;-0.014873758816197652;0.15987475547434343;-0.17684521995864472;0.23682093873603507;0.26629089121586719;0.14701980020970321;-0.18006619423591375;0.36354402742902908;-0.065973096539093778;-0.10473136169539492;-0.18941303892741307;0.066904176686767694;-0.56638766736538237;-0.20589361241171389;-0.2188968682971229;-0.26662759400534763;-0.63571219014772096;-0.38252743947470108;-0.20230401038643547;0.10244041598520415;-0.72357804643950607;0.12350056293028465;-0.23892706056388946;0.39381548156645124;0.086446874573855068;-0.22009039416768555;0.11541202420471959;-0.13149628236726313;0.2976931247502288;-0.47359003357503232;-0.11093213367003539;0.28420982464046629;-0.27813541777412509]
  //  Referenced by: '<S7>/IW{1,1}(2,:)''

  real_T IW112_Value[61];

  // Expression: [-0.084456730270245181;0.58733349111282318;0.17936570352799247;-0.046820293819257397;0.077425823516233921;0.042118644638427669;-0.15541506858622109;-0.21806043874678432;0.20841105004215704;0.3637843556320402;0.46539526105554929;0.19069410955427113;0.26122065538981704;-0.29142162266083815;0.50605722440588596;0.072041945573393662;-0.079495267944921885;-0.081426446603344221;0.043180931938690367;-0.45661616234543867;-0.28643756201013892;-0.35722726585776565;0.17863668897714363;-0.061757740303459201;-0.055551000761031158;-0.16309077992990334;-0.2134753613378432;0.36568437983158064;-0.47742214614074396;-0.13242805681539582;-0.13536000824053449;0.14368042410573648;-0.13193432520860854;0.19568961346738942;-0.20726008630185347;-0.031975839570050693;-0.32468323699409962;-0.14070858218061902;-0.17568685824955196;-0.23204441359857741;-0.16737345899958214;0.083914018896540904;-0.37568441907330463;0.71502300880057956;0.44852503988942782;0.69721750574600627;0.046763985914803963;-0.2833523279596819;-0.33597766672440671;0.18886915028743734;-0.16206798552232332;0.014736388944572481;0.0513199523290905;-0.17615344035683134;0.086904528780400017;0.028370462522593912;-0.58399936796390706;-0.018173557050327117;-0.17040216613725229;0.044736905967207669;0.090906641105825539]
  //  Referenced by: '<S7>/IW{1,1}(3,:)''

  real_T IW113_Value[61];

  // Expression: [0.021005946137016021;0.19718366519480082;-0.023299081768244127;0.20413461301025132;-0.084820294957001774;-0.13562367081414389;-0.096012887620031906;0.54892874673073688;-0.11908665773886642;-0.24273474593584815;0.064621690418897287;0.082352191620553988;-0.16387529810149537;0.17505431819902478;-0.0065207147320112402;-0.0735179099706188;0.20483105702924911;-0.3407776137571697;-0.088946996761660443;0.068986501339187323;-0.04209169186570165;0.15540990869056415;0.31309859711402782;0.057190228630878713;-0.025101675532944345;0.69927435503995017;0.24103839706509214;-0.070529641948201161;-0.031263384747906076;0.14969259289026771;0.027556302133330886;0.45915898454244825;0.094735467556555986;-0.075836015015641522;0.23117076266177419;0.088498085987116212;0.22423043114191982;0.22978498682288759;-0.14738343736308651;-0.012263194931625546;0.43611721121936858;0.065336291765769161;0.40879580028272078;-0.56651076907796805;-0.40968429567679598;-0.67382993754560672;-0.47205126544582082;0.28037641798517332;0.23201760842620678;-0.042079283577811197;-0.19867864924299325;-0.66492547349979125;-0.24996585460429027;0.035796065919241143;-0.22993478646063706;0.35953313501385709;-0.01885530552845148;0.2980673672260381;-0.35747461710754985;0.19584587513276655;-0.1483942673780459]
  //  Referenced by: '<S7>/IW{1,1}(4,:)''

  real_T IW114_Value[61];

  // Expression: [0.37445963154896855;-0.49405163737764368;0.16559878755113114;-0.44984172252857929;0.29252076718388131;-0.017110471508541912;-0.072250795995704456;0.79598027351478495;-0.14873008866077025;-0.11326449736945468;-0.42995565452875939;-0.48779821209189234;-0.40006644001062047;-0.19356057510707769;-0.21427159961897774;-0.25038161069458886;-0.040974125502976716;0.3365848601585803;-0.050914958240713772;0.5190147314014113;-0.24107540635093566;-0.1934783868728005;-0.072674819152811876;0.21231003254823202;0.25693642604555311;0.35451935654750366;0.055893650938210714;0.072313018913614802;0.41226252083353548;0.041554079413042358;-0.1579938423352874;-0.1500388478432213;0.043956797928874324;-0.57622055153489671;0.028752312215372236;-0.0862080319206531;0.50395776282350324;-0.076192968674376985;-0.44200818545374732;-0.585097443355729;0.2283917135193046;0.022557117479112064;0.68856028039077311;-0.16012304428054963;-0.086058638686184713;0.082024661752120004;-0.24321246983815453;0.72216890394071032;0.44160674514818499;-0.59482707060977236;0.080871231212135061;0.039783187150620743;0.3628731529110813;-0.28783492402449873;-0.13018797703535173;-0.064193240460515028;-0.39775198048264843;0.040086642906208628;0.24574345549430657;0.21511374514350187;-0.16624329230175122]
  //  Referenced by: '<S7>/IW{1,1}(5,:)''

  real_T IW115_Value[61];

  // Expression: [-0.077867144177964254;0.43163886504567234;0.18603026632978101;0.06572995516086641;0.047190753613861866;0.1705449714227677;-0.1558143446295347;0.033665821935455184;-0.26466598219050641;-0.12785055967677364;-0.16960436169937332;0.20051167162460423;-0.064000038217341959;-0.1607999262874113;0.38582366703937637;-0.0022363594804929166;-0.076958954598212587;0.11957819554218899;-0.39274825815468178;-0.058036355072305916;-0.23869722269696225;-0.33951486646420415;0.033155249374847859;0.0041318031005473099;0.17042187688161003;-0.35179903724537531;0.055519866927806957;-0.13611758102386737;0.15933378459004641;-0.22749584233988668;0.035377946589356377;0.38850242335277518;0.11486867616785471;0.20606948235036893;0.2498655545954592;-0.25698321597631002;0.19347443747832174;0.037138759069289748;-0.013253520896808636;0.18059786171082137;-0.15863337761190907;-0.32451983665088863;-0.049882325711410519;-0.50075477618008479;-0.48781289737470951;-0.299417065702763;-0.42298044544282404;-0.26167716443022682;-0.15767564695359576;0.124870370779991;-0.1541685996021987;-0.012871705517198011;0.17815686650020951;-0.44162259897048312;0.22040553143009342;-0.44678278010240935;0.32257926209600774;0.33514053213525546;0.021582482203882088;0.26483777756566579;-0.24795364886222729]
  //  Referenced by: '<S7>/IW{1,1}(6,:)''

  real_T IW116_Value[61];

  // Expression: [0.57665536655351513;0.15491875543269651;0.091542518919385224;-0.29967256187992403;-0.15849021986248443;-0.4354883995109422;-0.045846525102302957;0.32528678880114348;-0.18198496928088528;-0.099705683210863483;0.013837594358641125;-0.5522452914431295;-0.38220962897737243;-0.20167175230443746;-0.044541660723986853;-0.44272714631694099;0.3408154471616614;-0.24879018980417147;0.51027810265413831;-0.37364393440949384;-0.32710960413686602;0.14757141740511542;0.063204338291996925;0.26712888109015909;-0.082547272928340854;0.21892649963958472;0.10707481007301912;0.022059835558685542;-0.058111645168352349;-0.19156748658908529;-0.29549497478743353;-0.36843648377066424;0.1960293996744219;0.011615459936405906;0.0084647984625645864;-0.27192652508523418;0.48719015742633209;-0.17130196722975483;0.035732187739223167;0.14877269674906668;0.40561310983402166;0.034473532774222951;0.47165077934947053;-0.3744280093737925;-0.11494457929363699;-0.25302655773176186;-0.41567956114371396;-0.02862150911964333;0.56570672934017308;-0.52243542494882123;0.045749724229798019;-0.7664668586154616;0.070025968375514475;0.30956759081224822;-0.17458079658893647;0.15660161803754821;0.21463424735258751;0.20468993412065051;0.21760515873608324;-0.082440607181468367;0.18013554080178565]
  //  Referenced by: '<S7>/IW{1,1}(7,:)''

  real_T IW117_Value[61];

  // Expression: [0.33430282454999638;0.70597145203212375;0.41417887714944512;0.21815701791210779;-0.23960818055738919;-0.20653217007414562;-0.060623159699429933;0.10634313684796083;0.16355005349070184;-0.07383413539924244;0.17248722157050847;-0.15371054531776834;0.004912576075947403;-0.27213383763611293;-0.033167680962405952;-0.035502158352316709;-0.23502718445493731;-0.30701760357791308;-0.19633395621192049;-0.062767130371663316;-0.11375768357187536;-0.30957578078597425;-0.48928014267975695;0.11896103380375436;-0.36545829088739595;-0.26840912178392168;-0.072619565027379457;0.086114172080934415;0.22552815368990325;-0.25557329566874071;-0.10827416710879581;0.47417692171384934;-0.36892784217104013;0.12176659607444323;0.10005450551654509;-0.19203072353178635;-0.020816854525876446;-0.051844293569439273;0.28215194023469936;-0.11856780263707038;0.074818973719839491;-0.14449735716217516;0.29406140022917754;-0.15089388958094704;-0.1457025719217922;0.13345103465411942;0.15224521521617262;-0.046204180665812451;0.10937892792342316;-0.11080938640088225;-0.43607208247502127;0.34188895295038141;0.42023892961277715;-0.14866948322002801;0.27075320177254592;-0.17924936858384438;-0.59892864445349459;0.06347849646949022;-0.24561103308673962;0.04772276752769386;-0.14955635304615816]
  //  Referenced by: '<S7>/IW{1,1}(8,:)''

  real_T IW118_Value[61];

  // Expression: [1.2846678899861785;1.2180163868519278;0.91979097298807977;-0.20131263948775208;0.0079079201156904318;0.78346684312924986;1.2857973656727024;1.6023178101990716]
  //  Referenced by: '<S2>/b{1}'

  real_T b1_Value[8];

  // Expression: [0.057684840185086551;-0.96111494797957742;-0.0017522565466365631;0.30907780620268532;0.16681133919084157;-0.13774072318821817;-0.24572499931182781;0.43864350282926634]
  //  Referenced by: '<S18>/IW{2,1}(2,:)''

  real_T IW212_Value[8];
} ConstP_neural_network_3ph_T;

// Real-time Model Data Structure
struct tag_RTM_neural_network_3ph_T {
  const char_T * volatile errorStatus;
};

// Block signals (auto storage)
extern B_neural_network_3ph_T neural_network_3ph_B;

#ifdef __cplusplus

extern "C" {

#endif

#ifdef __cplusplus

}
#endif

// Constant parameters (auto storage)
extern const ConstP_neural_network_3ph_T neural_network_3ph_ConstP;

#ifdef __cplusplus

extern "C" {

#endif

  // Model entry point functions
  extern void neural_network_initialize(void);
  extern void neural_network_3ph_terminate(void);

#ifdef __cplusplus

}
#endif

// Customized model step function
#ifdef __cplusplus

extern "C" {

#endif

  extern void neural_network_custom(real_T arg_In1[61], real_T arg_Out1[2]);

#ifdef __cplusplus

}
#endif

// Real-time Model object
#ifdef __cplusplus

extern "C" {

#endif

  extern RT_MODEL_neural_network_3ph_T *const neural_network_3ph_M;

#ifdef __cplusplus

}
#endif

//-
//  These blocks were eliminated from the model due to optimizations:
//
//  Block '<S25>/Constants' : Unused code path elimination
//  Block '<S24>/Add min x' : Eliminated nontunable bias of 0


//-
//  The generated code includes comments that allow you to trace directly
//  back to the appropriate location in the model.  The basic format
//  is <system>/block_name, where system is the system number (uniquely
//  assigned by Simulink) and block_name is the name of the block.
//
//  Use the MATLAB hilite_system command to trace the generated code back
//  to the model.  For example,
//
//  hilite_system('<S3>')    - opens system 3
//  hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
//
//  Here is the system hierarchy for this model
//
//  '<Root>' : 'neural_network_3ph'
//  '<S1>'   : 'neural_network_3ph/Feed-Forward Neural Network'
//  '<S2>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1'
//  '<S3>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2'
//  '<S4>'   : 'neural_network_3ph/Feed-Forward Neural Network/Process Input 1'
//  '<S5>'   : 'neural_network_3ph/Feed-Forward Neural Network/Process Output 1'
//  '<S6>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/Delays 1'
//  '<S7>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}'
//  '<S8>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/tansig'
//  '<S9>'   : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod1'
//  '<S10>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod2'
//  '<S11>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod3'
//  '<S12>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod4'
//  '<S13>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod5'
//  '<S14>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod6'
//  '<S15>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod7'
//  '<S16>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 1/IW{1,1}/dotprod8'
//  '<S17>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2/Delays 1'
//  '<S18>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2/LW{2,1}'
//  '<S19>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2/purelin'
//  '<S20>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2/LW{2,1}/dotprod1'
//  '<S21>'  : 'neural_network_3ph/Feed-Forward Neural Network/Layer 2/LW{2,1}/dotprod2'
//  '<S22>'  : 'neural_network_3ph/Feed-Forward Neural Network/Process Input 1/mapminmax'
//  '<S23>'  : 'neural_network_3ph/Feed-Forward Neural Network/Process Input 1/removeconstantrows'
//  '<S24>'  : 'neural_network_3ph/Feed-Forward Neural Network/Process Output 1/mapminmax_reverse'
//  '<S25>'  : 'neural_network_3ph/Feed-Forward Neural Network/Process Output 1/removeconstantrows_reverse'

#endif                                 // RTW_HEADER_neural_network_3ph_h_

//
// File trailer for generated code.
//
// [EOF]
//