File mttroot/mtt/bin/trans/dm2fr_m artifact d561b3e13c part of check-in a0161c78ec


#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: dm2fr_m2dat

# Transformation: descriptor matrix to frequency response

# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  1996/08/11 09:32:12  peter
## Now takes the numpar parameters correctly
##
## Revision 1.1  1996/08/10 14:11:11  peter
## Initial revision
##
###############################################################

echo Creating $1_fr.dat

if [ "$2" = "" ]; 
then
  PARAMS='w=logspace(-1,2,100);'
  echo Using default parameter $PARAMS
else
  PARAMS=$2;
fi

 echo $PARAMS

$MATRIX << EOF  | awk '$1 !~ /[A-Za-cf-z]/ && NF>0 {print} '  >$1_fr.dat

  $PARAMS;

  [A,B,C,D,E] = $1_dm($1_numpar);
  fr = dm2fr(A,B,C,D,E,w);

  rfr = real(fr);
  ifr = imag(fr);

  [Ny,Nu]=size(D);
  NN = Ny*Nu;

  xy = [rfr(:,1), ifr(:,1)];
  for i=2:NN
    xy = [xy rfr(:,i) ifr(:,i)];
  end;
xy

EOF



MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]