Index: mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt +++ mttroot/mtt/lib/comp/compound/Sensitivity/sEMTF/sEMTF_lbl.txt @@ -1,14 +1,31 @@ %% Label file for system sEMTF (sEMTF_lbl.txt) %SUMMARY sEMTF Effort modulated TF - sensitivity version -%DESCRIPTION +%DESCRIPTION It is assumed that no sensitivity parameter is associated +%DESCRIPTION with this component. +%DESCRIPTION This is a built out of EMTFs and the 4 port AE3 component +%DESCRIPTION There is one argument alias - the transformer (flow) gain +%DESCRIPTION There are two CR aliases: one for the EMTF and one for +%DESCRIPTION the AE3 +%DESCRIPTION Examples: +%DESCRIPTION lin;slin n +%DESCRIPTION lsin;slsin l +%DESCRIPTION lcos;slcos l + + % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 2002/06/10 08:27:33 gawthrop +% %% Updated description +% %% +% %% Revision 1.1 2002/04/17 18:50:35 gawthrop +% %% Sensitivity EMTF components +% %% % %% Revision 1.1 2000/12/28 17:29:10 peterg % %% To RCS % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Index: mttroot/mtt/lib/control/PPP/ppp_optimise.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_optimise.m +++ mttroot/mtt/lib/control/PPP/ppp_optimise.m @@ -27,10 +27,16 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ + ## Revision 1.12 2002/06/11 11:25:25 gawthrop + ## No longer delay the simulated data. + ## + ## Revision 1.11 2002/05/20 13:32:36 gawthrop + ## Sanity check on y_0 + ## ## Revision 1.10 2002/05/13 16:01:09 gawthrop ## Addes Q weighting matrix ## ## Revision 1.9 2002/05/08 10:14:21 gawthrop ## Idetification now OK (Moved data range in ppp_optimise by one sample interval) @@ -118,29 +124,35 @@ while (abs(reduction)>extras.criterion)&&\ (abs(err)>extras.criterion)&&\ (iterations/$(SYS)/g' > $@ -$(SYS)_sfun_ae.mexglx: $(SYS)_sfun_ae.c sfun-debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_ae.c +$(SYS)_sfun_ae.mexglx: $(SYS)_sfun_ae.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h $(SYS)_ae.c echo Creating $@ mex $(SYS)_sfun_ae.c $(SYS)_sfun_ae.c:: ${MTT_REP}/sfun_rep/mex_ae.c.tmpl echo Creating $@ cat $^ | sed 's//$(SYS)/g' > $@ -$(SYS)_sfun_input.mexglx: $(SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_input.c $(SYS)_numpar.c +$(SYS)_sfun_input.mexglx: $(SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h $(SYS)_input.c $(SYS)_numpar.c echo Creating $@ mex $(SYS)_sfun_input.c $(SYS)_sfun_input.c:: ${MTT_REP}/sfun_rep/sfun_input.c.tmpl echo Creating $@ @@ -36,11 +36,11 @@ cat ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl |\ sed 's//$(SYS)/g' |\ ${MTT_REP}/sfun_rep/insert_file.sh > $@ $(SYS)_sfun.zip: $(SYS)_sfun.c sfun_debug.h useful-functions.hh $(SYS)_sfun_ae.c $(SYS)_sfun_input.c $(SYS)_sfun_interface.c \ - $(SYS)_def.h $(SYS)_sympar.h \ + $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h\ $(SYS)_ae.c $(SYS)_input.c $(SYS)_numpar.c $(SYS)_ode.c $(SYS)_odeo.c $(SYS)_state.c \ $(SYS).mdl README echo Creating $@ zip $@ $^ Index: mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/mdl.tmpl @@ -1,7 +1,7 @@ Model { - Name "" + Name "mdl" Version 4.00 SampleTimeColors off LibraryLinkDisplay "all" WideLines off ShowLineDimensions on @@ -25,12 +25,12 @@ Creator "geraint" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "geraint" ModifiedDateFormat "%" - LastModifiedDate "Thu May 23 16:35:42 2002" - ModelVersionFormat "1.%" + LastModifiedDate "Tue Jun 18 18:49:28 2002" + ModelVersionFormat "1.%" ConfigurationManager "None" SimParamPage "Solver" StartTime "0.0" StopTime "10.0" SolverMode "Auto" @@ -152,12 +152,12 @@ FontSize 9 FontWeight "normal" FontAngle "normal" } System { - Name "" - Location [51, 441, 346, 574] + Name "mdl" + Location [61, 487, 356, 620] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -188,11 +188,11 @@ RTWSystemCode "Auto" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" System { Name "MTT Model\n" - Location [45, 448, 1008, 720] + Location [55, 494, 1018, 766] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" @@ -254,10 +254,26 @@ LinearAnalysisOutput off LinearAnalysisInput off RTWStorageClass "Auto" } } + Block { + BlockType Memory + Name "Memory" + Position [870, 80, 900, 110] + X0 "0" + InheritSampleTime off + RTWStateStorageClass "Auto" + } + Block { + BlockType Memory + Name "Memory1" + Position [860, 175, 890, 205] + X0 "0" + InheritSampleTime off + RTWStateStorageClass "Auto" + } Block { BlockType "S-Function" Name "S-Function" Ports [4, 2] Position [710, 47, 840, 238] @@ -306,29 +322,41 @@ SrcBlock "MTT Model Inputs" SrcPort 1 DstBlock "S-Function" DstPort 1 } - Line { - SrcBlock "S-Function" - SrcPort 1 - Points [30, 0; 0, -70; -850, 0; 0, 105] - DstBlock "MTT Plant Model" - DstPort 1 - } Line { SrcBlock "In1" SrcPort 1 DstBlock "S-Function" DstPort 4 } Line { SrcBlock "S-Function" - SrcPort 2 + SrcPort 1 + DstBlock "Memory" + DstPort 1 + } + Line { + SrcBlock "Memory" + SrcPort 1 + Points [0, -55; -855, 0] + DstBlock "MTT Plant Model" + DstPort 1 + } + Line { + SrcBlock "Memory1" + SrcPort 1 DstBlock "Out1" DstPort 1 } + Line { + SrcBlock "S-Function" + SrcPort 2 + DstBlock "Memory1" + DstPort 1 + } } } Block { BlockType Outport Name "Out1" Index: mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/mex_ae.c.tmpl @@ -9,10 +9,11 @@ #include #include "sfun_debug.h" #include "useful-functions.hh" #include "_def.h" #include "_sympar.h" +#include "_cr.h" /* utility procedures */ double * array_of_double (size_t n) Index: mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/sfun.c.tmpl @@ -12,10 +12,11 @@ #include "simstruc.h" #include "sfun_debug.h" #include "useful-functions.hh" #include "_def.h" #include "_sympar.h" +#include "_cr.h" static double *mttdx; /* pointer to rates */ static double *mttu; /* pointer to inputs */ static double *mttpar; /* pointer to parameters */ static double *mttx; /* pointer to states */ @@ -162,12 +163,12 @@ for (i = 0; i < MTTNPAR; i++) { p[i] = mttpar[i]; } mexPutArray (MTT_MATLAB_P, "base"); - /* call fsolve */ - mexEvalString ("MTT_Ui = fsolve (@_sfun_ae, MTT_Ui, optimset('display','off'), MTT_X, MTT_U, MTT_T, MTT_P);"); + /* call solver */ + mexEvalString ("MTT_Ui = lsqnonlin (@_sfun_ae, MTT_Ui, [], [], optimset('display','off','diagnostics','off','TolX',1e-2,'TolFun',1e-2), MTT_X, MTT_U, MTT_T, MTT_P);"); /* retrieve result */ MTT_MATLAB_Ui = mexGetArray ("MTT_Ui", "base"); p = mxGetPr (MTT_MATLAB_Ui); for (i = 0; i < MTTNYZ; i++) { Index: mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl +++ mttroot/mtt/lib/rep/sfun_rep/sfun_input.c.tmpl @@ -12,10 +12,11 @@ #include "simstruc.h" #include "sfun_debug.h" #include "useful-functions.hh" #include "_def.h" #include "_sympar.h" +#include "_cr.h" static double *mttu; /* pointer to inputs */ static double *mttpar; /* pointer to parameters */ static double *mttx; /* pointer to states */ static double *mtty; /* pointer to outputs */