Differences From Artifact [3c0a37e2cf]:

To Artifact [9db1b72ad7]:


12
13
14
15
16
17
18



19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+
+









@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@comment  Version control history
@comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@comment  $Id$
@comment  $Log$
@comment  Revision 1.2  2001/07/03 22:59:10  gawthrop
@comment  Fixed problems with argument passing for CRs
@comment
@comment  Revision 1.1  2001/06/04 08:18:52  gawthrop
@comment  Putting documentation under CVS
@comment
@comment  Revision 1.66  2000/12/05 14:20:55  peterg
@comment  Added the c++  anf m CR info.
@comment
@comment  Revision 1.65  2000/11/27 15:36:15  peterg
413
414
415
416
417
418
419





420
421
422
423
424
425
426
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434







+
+
+
+
+







* Steady-state solutions - symbolic (ss)::  

Simulation parameters

* Euler integration::           
* Implicit integration::        

Simulation output

* Viewing results with gnuplot::  
* Exporting results to SciGraphica::  

Representations

* Representation summary::      
* Defining representations::    
* Verbal description (desc)::   
* Acausal bond graph (abg)::    
* Stripped acausal bond graph (sabg)::  
492
493
494
495
496
497
498

499
500
501
502
503
504
505
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514







+







* SS component labels ::        
* Other component labels ::     
* Component names::             
* Component constitutive relationship::  
* Component arguments::         
* Parameter declarations::      
* Units declarations::          
* Interface Control Definition::  
* Aliases::                     
* Parameter passing::           
* Old-style labels (lbl)::      

Other component labels 

* Component names::             
2218
2219
2220
2221
2222
2223
2224



























































2225
2226
2227
2228
2229
2230
2231
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







mtt -o -c -ss OttoCycle odeso ps 'OttoCycle_cycle_V'
@end example
An example of plotting one variable against another is:
@example
mtt -o -c -ss OttoCycle odeso ps 'OttoCycle_cycle_V:OttoCycle_cycle_P'
@end example

@menu
* Viewing results with gnuplot::  
* Exporting results to SciGraphica::  
@end menu

@node Viewing results with gnuplot, Exporting results to SciGraphica, Simulation output, Simulation output
@comment  node-name,  next,  previous,  up@subsection
@subsection Viewing results with gnuplot
@cindex gnuplot

Simulation results may be viewed in
@uref{http://www.gnuplot.org,gnuplot} with the command

@example
mtt [options] rc gnuplot view
@end example

The plot format is controlled by the file @emph{sys_gnuplot.txt}. A default version
of this file, which will cause gnuplot to plot the time-history of each state
and each output individually, may be created with the command

@example
mtt rc gnuplot txt
@end example

resulting in

@example
wait=-1
set data style lines
set xlabel "time"
set grid
set term X11

plot "rc_odes.dat2" using 1:4 axes x1y1 title "rc_c_c;
pause(wait);
plot "rc_odes.dat2" using 1:2 axes x1y1 title "rc_e2_e2
; pause(wait);
@end example

The file is used as an input to the gnuplot program and may therefore be
edited to contain any valid gnuplot commands.

@node Exporting results to SciGraphica,  , Viewing results with gnuplot, Simulation output
@comment  node-name,  next,  previous,  up
@subsection Exporting results to SciGraphica
@cindex SciGraphica

Simulation results can be converted into an XML-format
@uref{http://scigraphica.sourceforge.net,SciGraphica} (version 0.61)
@emph{.sg} file with the command

@example
mtt [options] sys odes sg
@end example

The SciGraphica file will contain two worksheets, X_sys and Y_sys, containing
the state and output time-histories from the simulation.

@c      node   next  prev  up
@node   Sensitivity models, Representations, Simulation, Top
@chapter Sensitivity models
@cindex Sensitivity models
@pindex Sensitivity models

The sensitivity model of a system is a set of equations giving the
3250
3251
3252
3253
3254
3255
3256

3257
3258
3259
3260
3261
3262
3263
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332







+







* SS component labels ::        
* Other component labels ::     
* Component names::             
* Component constitutive relationship::  
* Component arguments::         
* Parameter declarations::      
* Units declarations::          
* Interface Control Definition::  
* Aliases::                     
* Parameter passing::           
* Old-style labels (lbl)::      
@end menu

@node SS component labels , Other component labels , Labels (lbl), Labels (lbl)
@comment  node-name,  next,  previous,  up
3403
3404
3405
3406
3407
3408
3409
3410

3411
3412
3413
3414
3415
3416
3417
3472
3473
3474
3475
3476
3477
3478

3479
3480
3481
3482
3483
3484
3485
3486







-
+







#NOTPAR foo
#NOTPAR bar
@end example

For comapability with old code, VAR may be used in place of PAR, but
this usage is deprecated.

@node Units declarations, Aliases, Parameter declarations, Labels (lbl)
@node Units declarations, Interface Control Definition, Parameter declarations, Labels (lbl)
@comment  node-name,  next,  previous,  up
@subsection Units declarations
@cindex units declarations
@pindex units declarations
@pindex UNITS
The units and domains of ports (@pxref{Ports}) are declared as:
@example
3443
3444
3445
3446
3447
3448
3449























































































3450

3451
3452
3453
3454
3455
3456
3457
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605

3606
3607
3608
3609
3610
3611
3612
3613







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+







@item the same for connected ports when both ports have defined units.
@end itemize
No checks are done if one or both ends of a bond are not connected to a
port with defined units.



@node Interface Control Definition, Aliases, Units declarations, Labels (lbl)
@comment  node-name,  next,  previous,  up
@subsection Interface Control Definition
@cindex ICD (label file directive)
It is sometimes useful to be able to automatically generate a set of 
assignments mapping @strong{MTT} inputs and outputs to an external interface
definition. This can be achieved with use of the @emph{#ICD} directive.

@example
#ICD    PressureSensor		PUMP1_PRESSURE_SENSOR,Pa;null,none
#ICD    Electrical		PUMP1_VOLTAGE,volt;PUMP1_CURRENT,amp

% Component type De
	PressureSensor	SS      external

% Component type SS
	Electrical	SS	external,external
@end example


The ICD directive consists of 3 whitespace delimited fields:

@enumerate
@item [%|#]ICD
@item component name
@item Four comma (,) or semi-colon (;) delimited fields:

@enumerate
@item name of effort parameter
@item unit of effort parameter
@item name of flow parameter
@item unit of flow parameter
@end enumerate
@end enumerate

If no parameter name is required, a value of "null" should be used.
If the parameter does not have any units, a value of "none" should be used.

ICD parameters may be aliased @pxref{Aliases} in the same way as normal
parameters, thus it is possible to define some or all of the ICD in higher
level components.

The command

@example
mtt sys ICD txt
@end example

will generate a text file containing a list of mappings:

@example
## Interface Control Definition for System sys
## sys_ICD.txt: Generated by MTT Thu Jul 12 21:21:21 CDT 2001

Input:  PUMP1_VOLTAGE           sys_P1_1_Electrical      Causality: Effort   Units: volt
Output: PUMP1_CURRENT           sys_P1_1_Electrical      Causality: Flow     Units: amp
Output: PUMP1_PRESSURE_SENSOR   sys_P1_1_PressureSensor  Causality: Effort   Units: Pa
@end example

A set of assignments can be generated with the command
@example
mtt sys ICD m
@end example

resulting in:

@example
# Interface Control Definition mappings for system sys
# sys_ICD.m: Generated by MTT Thu Jul 12 21:26:56 CDT 2001

# Inputs

        mttu(1) = PUMP1_VOLTAGE;

# Outputs

        PUMP1_CURRENT                  = mtty(1);
        PUMP1_PRESSURE_SENSOR          = mtty(2);
@end example

A similar file will be generated by the command
@example
mtt sys ICD cc
@end example



@node Aliases, Parameter passing, Units declarations, Labels (lbl)
@node Aliases, Parameter passing, Interface Control Definition, Labels (lbl)
@comment  node-name,  next,  previous,  up
@subsection Aliases
@cindex aliases
@pindex aliases

Aliases provide a convenient mechanism for relabelling words appearing
in the label file (@pxref{Labels (lbl)}). There are three contexts in
4195
4196
4197
4198
4199
4200
4201



4202
4203
4204
4205
4206
4207
4208
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367







+
+
+







# Generated by MTT at Mon Jun 16 15:10:17 BST 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.2  2001/07/03 22:59:10  gawthrop
# %% Fixed problems with argument passing for CRs
# %%
# %% Revision 1.1  2001/06/04 08:18:52  gawthrop
# %% Putting documentation under CVS
# %%
# %% Revision 1.66  2000/12/05 14:20:55  peterg
# %% Added the c++  anf m CR info.
# %%
# %% Revision 1.65  2000/11/27 15:36:15  peterg
5245
5246
5247
5248
5249
5250
5251


5252
5253
5254
5255
5256
5257
5258
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419







+
+







        @code{xdvi} a document viewer.
@item ps
        @code{ghostview} another document viewer.
@item gdat
        @code{gnuplot} a data viewer.
@item c
        @code{gcc} a c compiler.
@item sg
	@code{scigraphica} a plotting package.
@end ftable

These tools are automatically invoked as appropriate by @strong{MTT};
but for more advanced use, these tools can be used directly on files
(with the appropriate suffix) generated by @strong{MTT}.



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