Overview
Comment:VERSION 2.1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 369009b211665392d3aeb9e6e8e104cbc238c2991d83581bf053ba28710f821e
User & Date: gawthrop@users.sourceforge.net on 1996-11-11 17:18:32
Other Links: branch diff | manifest | tags
Context
1996-11-11
17:23:03
Added numpar.m requirement to all .m targets check-in: 278efbc346 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
17:18:32
VERSION 2.1 check-in: 369009b211 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1996-11-10
10:48:45
Initial revision check-in: c320000403 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [951254ea5d] to [3365a25acf].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



## Revision 1.39  1996/11/09 20:22:54  peterg
## VERSION 2.0
##
## Revision 1.38  1996/11/09 20:17:34  peterg
## Fixed bug with null ARGS argument
## Put in new lib paths.
##







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.40  1996/11/09 21:17:38  peterg
## Fixed bug with copying at level 0.
##
## Revision 1.39  1996/11/09 20:22:54  peterg
## VERSION 2.0
##
## Revision 1.38  1996/11/09 20:17:34  peterg
## Fixed bug with null ARGS argument
## Put in new lib paths.
##
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775


# Create an arg file if it doesn't exist
$1_args.m:
	touch $1_args.m

#Create empty files (with titles) if not already there
#REPRESENTATION lbl	label file (txt)
$1_lbl.txt:
	echo Creating $1_lbl.txt
	( \
	echo "%SUMMARY System $1: <brief description here>"; \
	echo "%DESCRIPTION <Detailed description here>"; \
	echo "%% Label file for system $1 ($1_lbl.txt)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo "%% Each line should be of one of the following forms:"; \
	echo "%	a comment (ie starting with %)"; \
	echo "%	Component-name	CR_name	arg1,arg2,..argn"; \
	echo "%	blank"; \
        )> $1_lbl.txt

#REPRESENTATION cr	constitutive relationship for each subsystem (r)
$1_cr.r: $1_sub.sh
	lbl2cr_txt2r $1

	if [ "$level" = "0" ]; then \
	  mv $1_cr.r MTT_cr.r; \
	else \
	  echo >>  MTT_cr.r; \
	  echo "%% CRs for subsystem $1" >>  MTT_cr.r; \
	  cat $1_cr.r >> MTT_cr.r; rm -f $1_cr.r; \
	fi

	sh $1_sub.sh "mtt -q -l $level+1 " ' cr r'


	if [ "$level" = "0" ]; then \
	  mv MTT_cr.r $1_cr.r; \
	  echo 'END;' >> $1_cr.r; \
	fi

#REPRESENTATION simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce comands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
        )> $1_simp.r

#REPRESENTATION numpar	numerical parameter declaration (m) 
$1_numpar.m: $1_sympar.r $1_params.m
	sympar2numpar_r2m $1

#REPRESENTATION params	numerical parameter setting (m)
 $1_params.m: 
	echo Creating $1_params.m
	( \
	echo "%% Parameter file for system $1 ($1_params.m)"; \
	echo "%% This file provides the system params for simulation:";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo; \
        )> $1_params.m

#REPRESENTATION params	symbolic parameter setting (r)
 $1_params.r: 
	echo Creating $1_params.r
	( \
	echo "%% Parameter file for system $1 ($1_params.r)"; \
	echo "%% This file provides symbolic parameters for simplification";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
        )> $1_params.r

#REPRESENTATION input	input signal definition (m)
$1_input.m:
	echo Creating $1_input.m
	( \
	echo "function u = $1_input(t)"; \
	echo "%% Input file for system $1 ($1_input.m)"; \
	echo "%% This file provides the system input for simulation:";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo; \
	echo "% Set up system definitions"; \
	echo "[nx,ny,nu,nz,nyz] = $1_def;"; \
	echo "% Change the following lines as you wish"; \
	echo "u = zeros(nu,1);"; \
	echo "u(1) = 1;"; \
        )> $1_input.m

#REPRESENTATION sspar	steady-state definition (r)
$1_sspar.r:
	echo Creating $1_sspar.r
	(\
	echo "%% Reduce steady-state parameter file for $1 ($1_sspar.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
	)> $1_sspar.r

#REPRESENTATION rep	report (txt)
#REPRESENTATION rep	report (tex)
#REPRESENTATION rep	report (view)
$1_rep.txt:
	echo Creating $1_rep.txt
	( \
	echo "%% Outline report file for system $1 ($1_rep.txt)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo "abg ps"; \
	echo "lbl txt"; \
	echo "cbg ps"; \
	echo "dae tex"; \
	)> $1_rep.txt

#REPRESENTATION rbg	raw bond graph (m)
#Raw bond graph: fig file to mfile
$1_rbg.m: $1_abg.fig $1_lbl.txt
	rbg_fig2m $1
$1_cmp.m: $1_rbg.m
$1_fig.fig: $1_rbg.m

#Subsystem creation commands
$1_sub.sh: $1_cmp.m
	cmp2sub_m2sh $1

#REPRESENTATION sympar	symbolic parameters (r)
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt $1_params.r
	lbl2sympar_txt2r $1
	# echo "IN \"$1_params.r\";" >> $1_sympar.r
	echo 'END;' >> $1_sympar.r

#REPRESENTATION abg	acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
	sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
	rbg2abg_m $1


#REPRESENTATION cbg	causal bond graph (m)
#Acausal bond graph to causal bond graph: mfile
$1_cbg.m: $1_abg.m
	abg2cbg_m $1

#REPRESENTATION cbg	causal bond graph (fig)
#Causal bond graph: mfile to fig conversion
$1_cbg.fig: $1_cbg.m $1_rbg.m $1_fig.fig
	cbg_m2fig $1

#REPRESENTATION ese	elementary system equations (r)
#REPRESENTATION def	definitions - system orders etc. (r)
#Elementary system equations + definitions
$1_ese.r: $1_cbg.m
	   cbg2ese_m2r $1
$1_def.r: $1_ese.r
	touch $1_def.r
$1_def.m: $1_def.r
	def_r2m $1; matlab_tidy $1_def.m;

#REPRESENTATION dae	differential-algebraic equations (r)
#REPRESENTATION dae	differential-algebraic equations (m)
#REPRESENTATION dae	differential-algebraic equations (tex)
#REPRESENTATION dae	differential-algebraic equations (view)
#REPRESENTATION dae	differential-algebraic equations (ps)
#Differential-algebraic equations
$1_dae.r: $1_ese.r $1_cr.r $1_sympar.r
	ese2dae_r $1; tidy $1_dae.r
$1_dae.m: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2m $1; matlab_tidy $1_dae.m; matlab_tidy $1_daeo.m
$1_dae.c: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2c $1; c_tidy $1_dae.c
$1_dae.tex:	$1_dae.r $1_simp.r
	dae_r2tex $1; latex_tidy $1_dae.tex

#REPRESENTATION cse	constrained-state equations (r)
#REPRESENTATION cse	constrained-state equations (m)
#REPRESENTATION cse	constrained-state equations (tex)
#REPRESENTATION cse	constrained-state equations (view)
#REPRESENTATION cse	constrained-state equations (ps)
#Constrained-state equations
$1_cse.r: $1_dae.r $1_def.r $1_sympar.r
	dae2cse_r $1; tidy $1_cse.r
$1_cse.m: $1_def.r $1_cse.r $1_sympar.r
	cse_r2m $1; matlab_tidy $1_cse.m
$1_cse.tex: $1_cse.r  $1_sympar.r $1_simp.r
	cse_r2tex $1; latex_tidy $1_cse.tex

#REPRESENTATION ode	ordinary differential equations (r)
#REPRESENTATION ode	ordinary differential equations (m)
#REPRESENTATION ode	ordinary differential equations (tex)
#REPRESENTATION ode	ordinary differential equations (view)
#REPRESENTATION ode	ordinary differential equations (ps)
#Ordinary differential equations
$1_ode.r: $1_cse.r $1_def.r $1_sympar.r
	cse2ode_r $1; tidy $1_ode.r
$1_ode.m: $1_def.r $1_ode.r $1_sympar.r
	ode_r2m $1; matlab_tidy $1_ode.m; matlab_tidy $1_odeo.m
$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex

#REPRESENTATION obs	observer equations for CGPC (r)
#REPRESENTATION obs	observer equations for CGPC (m)
#REPRESENTATION obs	observer equations for CGPC (tex)
#REPRESENTATION obs	observer equations for CGPC (view)
#REPRESENTATION obs	observer equations for CGPC (ps)
#Observer functions for GPC
$1_obs.r: $1_ode.r $1_def.r $1_sympar.r
	ode2obs_r $1; tidy $1_obs.r
$1_obs.m: $1_def.r $1_obs.r $1_sympar.r
	obs_r2m $1; matlab_tidy $1_obs.m
$1_obs.tex: $1_obs.r  $1_sympar.r $1_simp.r
	obs_r2tex $1; latex_tidy $1_obs.tex


#REPRESENTATION rfe	robot-form equations (r)
#REPRESENTATION rfe	robot-form equations (tex)
#REPRESENTATION rfe	robot-form equations (view)
#REPRESENTATION rfe	robot-form equations (ps)
#Robot-form equations
$1_rfe.r: $1_cse.r $1_csm.r $1_def.r $1_sympar.r
	cse2rfe_r $1; tidy $1_rfe.r
$1_rfe.tex: $1_rfe.r  $1_sympar.r
	rfe_r2tex $1; latex_tidy $1_rfe.tex

#REPRESENTATION ss	steady-state equations (r)
#REPRESENTATION ss	steady-state equations (m)
#REPRESENTATION ss	steady-state equations (tex)
#REPRESENTATION ss	steady-state equations (view)
#REPRESENTATION ss	steady-state equations (ps)
#Steady-states
$1_ss.r: $1_def.r $1_sspar.r $1_sympar.r $1_cr.r $1_dae.r
	sspar2ss_r $1; tidy $1_ss.r
$1_ss.m: $1_def.r $1_sympar.r $1_ss.r 
	ss_r2m $1; matlab_tidy $1_ss.m
$1_ss.tex: $1_def.r $1_ss.r  $1_sympar.r $1_simp.r
	ss_r2tex $1; latex_tidy $1_ss.tex 


#REPRESENTATION dm	descriptor matrices (r)
#REPRESENTATION dm	descriptor matrices (m)
#REPRESENTATION dm	descriptor matrices (tex)
#REPRESENTATION dm	descriptor matrices (view)
#REPRESENTATION dm	descriptor matrices (ps)
#Linearised system: descriptor matrices
$1_dm.r: $1_dae.r $1_def.r $1_cr.r  $1_ss.r $1_sympar.r
	dae2dm_r $1; tidy $1_dm.r
$1_dm.m: $1_def.r $1_dm.r $1_sympar.r
		dm_r2m $1; matlab_tidy $1_dm.m
$1_dm.tex: $1_dm.r $1_sympar.r $1_simp.r 
	dm_r2tex $1; latex_tidy $1_dm.tex



#REPRESENTATION csm	constrained-state matrices (r)
#REPRESENTATION csm	constrained-state matrices (m)
#REPRESENTATION csm	constrained-state matrices (tex)
#REPRESENTATION csm	constrained-state matrices (view)
#REPRESENTATION csm	constrained-state matrices (ps)
#Linearised system: constrained-state matrices
$1_csm.r: $1_cse.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	cse2csm_r $1; tidy $1_csm.r
$1_csm.m: $1_def.r $1_csm.r
		csm_r2m $1;  matlab_tidy $1_csm.m
$1_csm.tex: $1_csm.r  $1_sympar.r $1_simp.r
	csm_r2tex $1; latex_tidy $1_csm.tex

#REPRESENTATION sm	state matrices (r)
#REPRESENTATION sm	state matrices (m)
#REPRESENTATION sm	state matrices (tex)
#REPRESENTATION sm	state matrices (view)
#REPRESENTATION sm	state matrices (ps)
#Linearised system: state matrices
$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $1; tidy $1_sm.r
$1_sm.m: $1_def.r $1_sm.r
		sm_r2m $1;  matlab_tidy $1_sm.m
$1_sm.tex: $1_sm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1; latex_tidy $1_sm.tex

#REPRESENTATION tf	transfer function (r)
#REPRESENTATION tf	transfer function (m)
#REPRESENTATION tf	transfer function (tex)
#REPRESENTATION tf	transfer function (view)
#REPRESENTATION tf	transfer function (ps)
#Linearised system: transfer function
$1_tf.r: $1_dm.r $1_sympar.r 
	dm2tf_r $1; tidy $1_tf.r
$1_tf.m: $1_def.r $1_tf.r
	tf_r2m $1; matlab_tidy $1_tf.m
$1_tf.tex: $1_def.r $1_tf.r $1_sympar.r $1_simp.r
	tf_r2tex $1; latex_tidy $1_tf.tex

#REPRESENTATION ir	impulse response - state (m)
#REPRESENTATION ir	impulse response - state (dat)
#REPRESENTATION ir	impulse response - state (ps)
#REPRESENTATION ir	impulse response - state (view)

#REPRESENTATION iro	impulse response - output (m)
#REPRESENTATION iro	impulse response - output (dat)
#REPRESENTATION iro	impulse response - output (ps)
#REPRESENTATION iro	impulse response - output (view)

#REPRESENTATION sr	step response - state (m)
#REPRESENTATION sr	step response - state (dat)
#REPRESENTATION sr	step response - state (ps)
#REPRESENTATION sr	step response - state (view)

#REPRESENTATION sro	step response - output (m)
#REPRESENTATION sro	step response - output (dat)
#REPRESENTATION sro	step response - output (ps)
#REPRESENTATION sro	step response - output (view)

#REPRESENTATION odes	ode solution - state (m)
#REPRESENTATION odes	ode solution - state (dat)
#REPRESENTATION odes	ode solution - state (ps)
#REPRESENTATION odes	ode solution - state (view)

#REPRESENTATION odeso	ode solution - output (m)
#REPRESENTATION odeso	ode solution - output (dat)
#REPRESENTATION odeso	ode solution - output (ps)
#REPRESENTATION odeso	ode solution - output (view)

#REPRESENTATION daes	dae solution - state (m)
#REPRESENTATION daes	dae solution - state (dat)
#REPRESENTATION daes	dae solution - state (ps)
#REPRESENTATION daes	dae solution - state (view)

#REPRESENTATION daeso	dae solution - output (m)
#REPRESENTATION daeso	dae solution - output (dat)
#REPRESENTATION daeso	dae solution - output (ps)
#REPRESENTATION daeso	dae solution - output (view)

#Time responses
$1_ir.m: $1_sm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	sm2ir_m $1 '$ARGS'
$1_iro.m: $1_ir.m
	touch $1_iro.m
$1_sr.m: $1_sm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	sm2sr_m $1 '$ARGS'
$1_sro.m: $1_sr.m
	touch $1_sro.m
$1_odes.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	ode2odes_m $1 '$ARGS'
$1_odeso.m: $1_odes.m
	touch $1_odeso.m
$1_daes.m: $1_dae.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	dae2daes_m $1 '$ARGS'
$1_daeso.m: $1_daes.m
	touch $1_daeso.m

#REPRESENTATION odess	ode numerical steady-states - states (m)
#REPRESENTATION odess	ode numerical steady-states - states (dat)
#REPRESENTATION odess	ode numerical steady-states - states (ps)
#REPRESENTATION odess	ode numerical steady-states - states (view)

#REPRESENTATION odesso	ode numerical steady-states - outputs (m)
#REPRESENTATION odesso	ode numerical steady-states - outputs (dat)
#REPRESENTATION odesso	ode numerical steady-states - outputs (ps)
#REPRESENTATION odesso	ode numerical steady-states - outputs (view)

#Numerical steady states
$1_odess.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	ode2odess_m $1 '$ARGS'
$1_odesso.m: $1_odess.m
	touch $1_odesso.m


#REPRESENTATION fr	frequency response (m)
#REPRESENTATION fr	frequency response (dat)
#REPRESENTATION fr	frequency response (ps)
#REPRESENTATION fr	frequency response (view)

#REPRESENTATION lmfr	loglog modulus frequency response (m)
#REPRESENTATION lmfr	loglog modulus frequency response (dat)
#REPRESENTATION lmfr	loglog modulus frequency response (ps)
#REPRESENTATION lmfr	loglog modulus frequency response (view)

#REPRESENTATION lpfr	semilog phase frequency response (m)
#REPRESENTATION lpfr	semilog phase frequency response (dat)
#REPRESENTATION lpfr	semilog phase frequency response (ps)
#REPRESENTATION lpfr	semilog phase frequency response (view)

#REPRESENTATION nyfr	Nyquist style frequency response (m)
#REPRESENTATION nyfr	Nyquist style frequency response (dat)
#REPRESENTATION nyfr	Nyquist style frequency response (ps)
#REPRESENTATION nyfr	Nyquist style frequency response (view)

#REPRESENTATION nifr	Nichols style frequency response (m)
#REPRESENTATION nifr	Nichols style frequency response (dat)
#REPRESENTATION nifr	Nichols style frequency response (ps)
#REPRESENTATION nifr	Nichols style frequency response (view)


#Frequency responses
$1_fr.m: $1_dm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	dm2fr_m $1 '$ARGS'
$1_lmfr.m: $1_fr.m
	touch $1_lmfr.m







|













|



















|








|



|









|









|















|








|
|
|











|










|






|






|




|




|
|








|
|
|
|
|










|
|
|
|
|








|
|
|
|
|








|
|
|
|
|









|
|
|
|






|
|
|
|
|









|
|
|
|
|










|
|
|
|
|








|
|
|
|
|








|
|
|
|
|








|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|



















|
|
|
|

|
|
|
|








|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|

|
|
|
|







382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778


# Create an arg file if it doesn't exist
$1_args.m:
	touch $1_args.m

#Create empty files (with titles) if not already there
#SUMMARY lbl	label file (txt)
$1_lbl.txt:
	echo Creating $1_lbl.txt
	( \
	echo "%SUMMARY System $1: <brief description here>"; \
	echo "%DESCRIPTION <Detailed description here>"; \
	echo "%% Label file for system $1 ($1_lbl.txt)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo "%% Each line should be of one of the following forms:"; \
	echo "%	a comment (ie starting with %)"; \
	echo "%	Component-name	CR_name	arg1,arg2,..argn"; \
	echo "%	blank"; \
        )> $1_lbl.txt

#SUMMARY cr	constitutive relationship for each subsystem (r)
$1_cr.r: $1_sub.sh
	lbl2cr_txt2r $1

	if [ "$level" = "0" ]; then \
	  mv $1_cr.r MTT_cr.r; \
	else \
	  echo >>  MTT_cr.r; \
	  echo "%% CRs for subsystem $1" >>  MTT_cr.r; \
	  cat $1_cr.r >> MTT_cr.r; rm -f $1_cr.r; \
	fi

	sh $1_sub.sh "mtt -q -l $level+1 " ' cr r'


	if [ "$level" = "0" ]; then \
	  mv MTT_cr.r $1_cr.r; \
	  echo 'END;' >> $1_cr.r; \
	fi

#SUMMARY simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce comands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
        )> $1_simp.r

#SUMMARY numpar	numerical parameter declaration (m) 
$1_numpar.m: $1_sympar.r $1_params.m
	sympar2numpar_r2m $1

#SUMMARY params	numerical parameter setting (m)
 $1_params.m: 
	echo Creating $1_params.m
	( \
	echo "%% Parameter file for system $1 ($1_params.m)"; \
	echo "%% This file provides the system params for simulation:";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo; \
        )> $1_params.m

#SUMMARY params	symbolic parameter setting (r)
 $1_params.r: 
	echo Creating $1_params.r
	( \
	echo "%% Parameter file for system $1 ($1_params.r)"; \
	echo "%% This file provides symbolic parameters for simplification";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
        )> $1_params.r

#SUMMARY input	input signal definition (m)
$1_input.m:
	echo Creating $1_input.m
	( \
	echo "function u = $1_input(t)"; \
	echo "%% Input file for system $1 ($1_input.m)"; \
	echo "%% This file provides the system input for simulation:";\
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo; \
	echo "% Set up system definitions"; \
	echo "[nx,ny,nu,nz,nyz] = $1_def;"; \
	echo "% Change the following lines as you wish"; \
	echo "u = zeros(nu,1);"; \
	echo "u(1) = 1;"; \
        )> $1_input.m

#SUMMARY sspar	steady-state definition (r)
$1_sspar.r:
	echo Creating $1_sspar.r
	(\
	echo "%% Reduce steady-state parameter file for $1 ($1_sspar.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
	)> $1_sspar.r

#SUMMARY rep	report (txt)
#SUMMARY rep	report (tex)
#SUMMARY rep	report (view)
$1_rep.txt:
	echo Creating $1_rep.txt
	( \
	echo "%% Outline report file for system $1 ($1_rep.txt)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo "abg ps"; \
	echo "lbl txt"; \
	echo "cbg ps"; \
	echo "dae tex"; \
	)> $1_rep.txt

#SUMMARY rbg	raw bond graph (m)
#Raw bond graph: fig file to mfile
$1_rbg.m: $1_abg.fig $1_lbl.txt
	rbg_fig2m $1
$1_cmp.m: $1_rbg.m
$1_fig.fig: $1_rbg.m

#Subsystem creation commands
$1_sub.sh: $1_cmp.m
	cmp2sub_m2sh $1

#SUMMARY sympar	symbolic parameters (r)
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt $1_params.r
	lbl2sympar_txt2r $1
	# echo "IN \"$1_params.r\";" >> $1_sympar.r
	echo 'END;' >> $1_sympar.r

#SUMMARY abg	acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
	sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
	rbg2abg_m $1


#SUMMARY cbg	causal bond graph (m)
#Acausal bond graph to causal bond graph: mfile
$1_cbg.m: $1_abg.m
	abg2cbg_m $1

#SUMMARY cbg	causal bond graph (fig)
#Causal bond graph: mfile to fig conversion
$1_cbg.fig: $1_cbg.m $1_rbg.m $1_fig.fig
	cbg_m2fig $1

#SUMMARY ese	elementary system equations (r)
#SUMMARY def	definitions - system orders etc. (r)
#Elementary system equations + definitions
$1_ese.r: $1_cbg.m
	   cbg2ese_m2r $1
$1_def.r: $1_ese.r
	touch $1_def.r
$1_def.m: $1_def.r
	def_r2m $1; matlab_tidy $1_def.m;

#SUMMARY dae	differential-algebraic equations (r)
#SUMMARY dae	differential-algebraic equations (m)
#SUMMARY dae	differential-algebraic equations (tex)
#SUMMARY dae	differential-algebraic equations (view)
#SUMMARY dae	differential-algebraic equations (ps)
#Differential-algebraic equations
$1_dae.r: $1_ese.r $1_cr.r $1_sympar.r
	ese2dae_r $1; tidy $1_dae.r
$1_dae.m: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2m $1; matlab_tidy $1_dae.m; matlab_tidy $1_daeo.m
$1_dae.c: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2c $1; c_tidy $1_dae.c
$1_dae.tex:	$1_dae.r $1_simp.r
	dae_r2tex $1; latex_tidy $1_dae.tex

#SUMMARY cse	constrained-state equations (r)
#SUMMARY cse	constrained-state equations (m)
#SUMMARY cse	constrained-state equations (tex)
#SUMMARY cse	constrained-state equations (view)
#SUMMARY cse	constrained-state equations (ps)
#Constrained-state equations
$1_cse.r: $1_dae.r $1_def.r $1_sympar.r
	dae2cse_r $1; tidy $1_cse.r
$1_cse.m: $1_def.r $1_cse.r $1_sympar.r
	cse_r2m $1; matlab_tidy $1_cse.m
$1_cse.tex: $1_cse.r  $1_sympar.r $1_simp.r
	cse_r2tex $1; latex_tidy $1_cse.tex

#SUMMARY ode	ordinary differential equations (r)
#SUMMARY ode	ordinary differential equations (m)
#SUMMARY ode	ordinary differential equations (tex)
#SUMMARY ode	ordinary differential equations (view)
#SUMMARY ode	ordinary differential equations (ps)
#Ordinary differential equations
$1_ode.r: $1_cse.r $1_def.r $1_sympar.r
	cse2ode_r $1; tidy $1_ode.r
$1_ode.m: $1_def.r $1_ode.r $1_sympar.r
	ode_r2m $1; matlab_tidy $1_ode.m; matlab_tidy $1_odeo.m
$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex

#SUMMARY obs	observer equations for CGPC (r)
#SUMMARY obs	observer equations for CGPC (m)
#SUMMARY obs	observer equations for CGPC (tex)
#SUMMARY obs	observer equations for CGPC (view)
#SUMMARY obs	observer equations for CGPC (ps)
#Observer functions for GPC
$1_obs.r: $1_ode.r $1_def.r $1_sympar.r
	ode2obs_r $1; tidy $1_obs.r
$1_obs.m: $1_def.r $1_obs.r $1_sympar.r
	obs_r2m $1; matlab_tidy $1_obs.m
$1_obs.tex: $1_obs.r  $1_sympar.r $1_simp.r
	obs_r2tex $1; latex_tidy $1_obs.tex


#SUMMARY rfe	robot-form equations (r)
#SUMMARY rfe	robot-form equations (tex)
#SUMMARY rfe	robot-form equations (view)
#SUMMARY rfe	robot-form equations (ps)
#Robot-form equations
$1_rfe.r: $1_cse.r $1_csm.r $1_def.r $1_sympar.r
	cse2rfe_r $1; tidy $1_rfe.r
$1_rfe.tex: $1_rfe.r  $1_sympar.r
	rfe_r2tex $1; latex_tidy $1_rfe.tex

#SUMMARY ss	steady-state equations (r)
#SUMMARY ss	steady-state equations (m)
#SUMMARY ss	steady-state equations (tex)
#SUMMARY ss	steady-state equations (view)
#SUMMARY ss	steady-state equations (ps)
#Steady-states
$1_ss.r: $1_def.r $1_sspar.r $1_sympar.r $1_cr.r $1_dae.r
	sspar2ss_r $1; tidy $1_ss.r
$1_ss.m: $1_def.r $1_sympar.r $1_ss.r 
	ss_r2m $1; matlab_tidy $1_ss.m
$1_ss.tex: $1_def.r $1_ss.r  $1_sympar.r $1_simp.r
	ss_r2tex $1; latex_tidy $1_ss.tex 


#SUMMARY dm	descriptor matrices (r)
#SUMMARY dm	descriptor matrices (m)
#SUMMARY dm	descriptor matrices (tex)
#SUMMARY dm	descriptor matrices (view)
#SUMMARY dm	descriptor matrices (ps)
#Linearised system: descriptor matrices
$1_dm.r: $1_dae.r $1_def.r $1_cr.r  $1_ss.r $1_sympar.r
	dae2dm_r $1; tidy $1_dm.r
$1_dm.m: $1_def.r $1_dm.r $1_sympar.r
		dm_r2m $1; matlab_tidy $1_dm.m
$1_dm.tex: $1_dm.r $1_sympar.r $1_simp.r 
	dm_r2tex $1; latex_tidy $1_dm.tex



#SUMMARY csm	constrained-state matrices (r)
#SUMMARY csm	constrained-state matrices (m)
#SUMMARY csm	constrained-state matrices (tex)
#SUMMARY csm	constrained-state matrices (view)
#SUMMARY csm	constrained-state matrices (ps)
#Linearised system: constrained-state matrices
$1_csm.r: $1_cse.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	cse2csm_r $1; tidy $1_csm.r
$1_csm.m: $1_def.r $1_csm.r
		csm_r2m $1;  matlab_tidy $1_csm.m
$1_csm.tex: $1_csm.r  $1_sympar.r $1_simp.r
	csm_r2tex $1; latex_tidy $1_csm.tex

#SUMMARY sm	state matrices (r)
#SUMMARY sm	state matrices (m)
#SUMMARY sm	state matrices (tex)
#SUMMARY sm	state matrices (view)
#SUMMARY sm	state matrices (ps)
#Linearised system: state matrices
$1_sm.r: $1_csm.r $1_def.r $1_cr.r $1_ss.r $1_sympar.r
	csm2sm_r $1; tidy $1_sm.r
$1_sm.m: $1_def.r $1_sm.r
		sm_r2m $1;  matlab_tidy $1_sm.m
$1_sm.tex: $1_sm.r  $1_sympar.r $1_simp.r
	sm_r2tex $1; latex_tidy $1_sm.tex

#SUMMARY tf	transfer function (r)
#SUMMARY tf	transfer function (m)
#SUMMARY tf	transfer function (tex)
#SUMMARY tf	transfer function (view)
#SUMMARY tf	transfer function (ps)
#Linearised system: transfer function
$1_tf.r: $1_dm.r $1_sympar.r 
	dm2tf_r $1; tidy $1_tf.r
$1_tf.m: $1_def.r $1_tf.r
	tf_r2m $1; matlab_tidy $1_tf.m
$1_tf.tex: $1_def.r $1_tf.r $1_sympar.r $1_simp.r
	tf_r2tex $1; latex_tidy $1_tf.tex

#SUMMARY ir	impulse response - state (m)
#SUMMARY ir	impulse response - state (dat)
#SUMMARY ir	impulse response - state (ps)
#SUMMARY ir	impulse response - state (view)

#SUMMARY iro	impulse response - output (m)
#SUMMARY iro	impulse response - output (dat)
#SUMMARY iro	impulse response - output (ps)
#SUMMARY iro	impulse response - output (view)

#SUMMARY sr	step response - state (m)
#SUMMARY sr	step response - state (dat)
#SUMMARY sr	step response - state (ps)
#SUMMARY sr	step response - state (view)

#SUMMARY sro	step response - output (m)
#SUMMARY sro	step response - output (dat)
#SUMMARY sro	step response - output (ps)
#SUMMARY sro	step response - output (view)

#SUMMARY odes	ode solution - state (m)
#SUMMARY odes	ode solution - state (dat)
#SUMMARY odes	ode solution - state (ps)
#SUMMARY odes	ode solution - state (view)

#SUMMARY odeso	ode solution - output (m)
#SUMMARY odeso	ode solution - output (dat)
#SUMMARY odeso	ode solution - output (ps)
#SUMMARY odeso	ode solution - output (view)

#SUMMARY daes	dae solution - state (m)
#SUMMARY daes	dae solution - state (dat)
#SUMMARY daes	dae solution - state (ps)
#SUMMARY daes	dae solution - state (view)

#SUMMARY daeso	dae solution - output (m)
#SUMMARY daeso	dae solution - output (dat)
#SUMMARY daeso	dae solution - output (ps)
#SUMMARY daeso	dae solution - output (view)

#Time responses
$1_ir.m: $1_sm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	sm2ir_m $1 '$ARGS'
$1_iro.m: $1_ir.m
	touch $1_iro.m
$1_sr.m: $1_sm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	sm2sr_m $1 '$ARGS'
$1_sro.m: $1_sr.m
	touch $1_sro.m
$1_odes.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	ode2odes_m $1 '$ARGS'
$1_odeso.m: $1_odes.m
	touch $1_odeso.m
$1_daes.m: $1_dae.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	dae2daes_m $1 '$ARGS'
$1_daeso.m: $1_daes.m
	touch $1_daeso.m

#SUMMARY odess	ode numerical steady-states - states (m)
#SUMMARY odess	ode numerical steady-states - states (dat)
#SUMMARY odess	ode numerical steady-states - states (ps)
#SUMMARY odess	ode numerical steady-states - states (view)

#SUMMARY odesso	ode numerical steady-states - outputs (m)
#SUMMARY odesso	ode numerical steady-states - outputs (dat)
#SUMMARY odesso	ode numerical steady-states - outputs (ps)
#SUMMARY odesso	ode numerical steady-states - outputs (view)

#Numerical steady states
$1_odess.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
	ode2odess_m $1 '$ARGS'
$1_odesso.m: $1_odess.m
	touch $1_odesso.m


#SUMMARY fr	frequency response (m)
#SUMMARY fr	frequency response (dat)
#SUMMARY fr	frequency response (ps)
#SUMMARY fr	frequency response (view)

#SUMMARY lmfr	loglog modulus frequency response (m)
#SUMMARY lmfr	loglog modulus frequency response (dat)
#SUMMARY lmfr	loglog modulus frequency response (ps)
#SUMMARY lmfr	loglog modulus frequency response (view)

#SUMMARY lpfr	semilog phase frequency response (m)
#SUMMARY lpfr	semilog phase frequency response (dat)
#SUMMARY lpfr	semilog phase frequency response (ps)
#SUMMARY lpfr	semilog phase frequency response (view)

#SUMMARY nyfr	Nyquist style frequency response (m)
#SUMMARY nyfr	Nyquist style frequency response (dat)
#SUMMARY nyfr	Nyquist style frequency response (ps)
#SUMMARY nyfr	Nyquist style frequency response (view)

#SUMMARY nifr	Nichols style frequency response (m)
#SUMMARY nifr	Nichols style frequency response (dat)
#SUMMARY nifr	Nichols style frequency response (ps)
#SUMMARY nifr	Nichols style frequency response (view)


#Frequency responses
$1_fr.m: $1_dm.m $1_numpar.m $1_params.m $1_args.m $1_def.m
	dm2fr_m $1 '$ARGS'
$1_lmfr.m: $1_fr.m
	touch $1_lmfr.m


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