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: |
56a25313feb31d17099b31ecd22556f6 |
User & Date: | gawthrop@users.sourceforge.net on 1996-08-12 19:09:13 |
Other Links: | branch diff | manifest | tags |
Context
1996-08-12
| ||
20:19:06 | Fiddled about with parameter passing - still not right check-in: e3ec643207 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
19:09:13 | Initial revision check-in: 56a25313fe user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
1996-08-11
| ||
19:49:27 | Parameter passing (via $4) added. check-in: bf28d3a1de user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Added mttroot/mtt/bin/trans/dm_r2m version [d6421498ca].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | #! /bin/sh ###################################### ##### Model Transformation Tools ##### ###################################### # Bourne shell script: dm_r2m # Reduce descriptor state-space A,B,C,D and E matrices to Matlab # P.J.Gawthrop 29th July 1990, 6th Feb 1991, 28 May 1991, Dec 1993, Jan 94 # Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993,1994. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ############################################################### #Inform user echo Creating $1_dm.m # Remove the old log file rm -f dm_r2m.log # Use reduce to accomplish the transformation reduce >dm_r2m.log << EOF ON BigFloat, NumVal; PRECISION 16; %Compatible with Matlab %Read in the definitions file in "$1_def.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"; %Read the reduce state-space A,B,C and D matrices file in "$1_dm.r"; OUT "$1_dm.m"; %Headings - Matlab style %(Note. The ;; are deleted by for2mat) IF MTTNvar>0 THEN BEGIN write "function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_dm(..."; 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,MTTE] = $1_dm;;"; IF MTTNvar>0 THEN BEGIN write "%function [MTTA,MTTB,MTTC,MTTD,MTTE] = $1_dm(..."; 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,MTTE] = $1_dm;;"; write "%Linearised descriptor matrices for system $1"; write "%File $1_dm.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$ MTTN := MTTNx + 2*MTTNz + MTTNyz; write "MTTA = zeros(", MTTN, ",", MTTN, ");"; MTTA := MTTA; write "MTTB = zeros(", MTTN, ",", MTTNu, ");"; MTTB := MTTB; write "MTTC = zeros(", MTTNy, ",", MTTN, ");"; MTTC := MTTC; write "MTTD = zeros(", MTTNy, ",", MTTNu, ");"; MTTD := MTTD; write "MTTE = zeros(", MTTN, ",", MTTN, ");"; MTTE := MTTE; SHUT "$1_dm.m"; |