Overview
Comment: | Initial revision |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
3ca36505addfc2cb0ecd200cb6078be9 |
User & Date: | gawthrop@users.sourceforge.net on 1996-08-19 15:14:51 |
Other Links: | branch diff | manifest | tags |
Context
1996-08-19
| ||
15:33:22 |
Included new state matric (sm) rep. Generate step response (sr) from sm. check-in: b26f16f7c4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
15:14:51 | Initial revision check-in: 3ca36505ad user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
14:48:48 | Initial revision check-in: 5865c2e6c9 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Added mttroot/mtt/bin/trans/sm_r2m version [bde12852b6].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### # Bourne shell script: sm_r2m # Reduce constained state-space A,B,C,D and E matrices to Matlab # P.J.Gawthrop July 1990, Feb 1991, May 1991, Sep 91, Dec 93, Jan 94, May 94. # Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1996. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ############################################################### # Inform user echo Creating $1_sm.m # Remove the old log file rm -f sm_r2m.log # Use reduce to accomplish the transformation reduce >sm_r2m.log << EOF %Read in the definitions file IN "$1_def.r"; %Read the reduce state-space A,B,C and D matrices file IN "$1_sm.r"; %Set up the number of argument variables to zero in case the user has forgotten MTTNVar := 0; %Read in the parameter file IN "$1_sympar.r"; OUT "$1_sm.m"; %Headings - Matlab style %(Note. The ;; are deleted by for2mat) IF MTTNvar>0 THEN BEGIN write "function [MTTA,MTTB,MTTC,MTTD] = $1_sm(..."; FOR i := 1:MTTNvar DO BEGIN IF i<MTTNvar THEN write MTTVar(i,1), ",..." ELSE write MTTVar(i,1), ");;"; END; END ELSE write "function [MTTA,MTTB,MTTC,MTTD] = $1_sm;;"; IF MTTNvar>0 THEN BEGIN write "%function [MTTA,MTTB,MTTC,MTTD] = $1_sm(..."; FOR i := 1:MTTNvar DO BEGIN IF i<MTTNvar THEN write "%", MTTVar(i,1), ",..." ELSE write "%", MTTVar(i,1), ");;"; END; END ELSE write "%function [MTTA,MTTB,MTTC,MTTD] = $1_sm;;"; write "%Linearised state matrices for system $1"; write "%File $1_sm.m"; write "%Generated by MTT"; ON NERO; % Suppress zero elements. %Fortran switches - one line expressions OFF echo; ON fort$ cardno!* := 1$ fortwidth!* := 100$ OFF period$ write "MTTA = zeros(", MTTNx, ",", MTTNx, ");"; MTTA := MTTA; write "MTTB = zeros(", MTTNx, ",", MTTNu, ");"; MTTB := MTTB; write "MTTC = zeros(", MTTNy, ",", MTTNx, ");"; MTTC := MTTC; write "MTTD = zeros(", MTTNy, ",", MTTNu, ");"; MTTD := MTTD; OFF FORT; write ""; SHUT "$1_sm.m"; |