︙ | | | ︙ | |
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# Copyright (C) 2000 by Peter J. Gawthrop
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.275 2000/10/12 18:38:47 peterg
## New method of sympar generation implemented - uses mtt_make_sympar
## Check/update of numpar.txt is forced.
##
## Revision 1.274 2000/10/12 15:11:54 peterg
## Added the update function for numpar only
##
|
>
>
>
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# Copyright (C) 2000 by Peter J. Gawthrop
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.276 2000/10/15 09:30:31 peterg
## *** empty log message ***
##
## Revision 1.275 2000/10/12 18:38:47 peterg
## New method of sympar generation implemented - uses mtt_make_sympar
## Check/update of numpar.txt is forced.
##
## Revision 1.274 2000/10/12 15:11:54 peterg
## Added the update function for numpar only
##
|
︙ | | | ︙ | |
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
|
sympar_txt2c $1
#SUMMARY sympar symbolic parameters (tex)
# txt to tex (LaTeX) sympar conversion
$1_sympar.tex: $1_sympar.txt
sympar_txt2tex $1
#SUMMARY logic Dynamic switch logic (txt)
$1_logic.txt:
echo Creating $1_logic.txt
( \
echo '# -*-octave-*- Put Emacs into octave-mode'; \
echo "# Simulation parameters for system $1 ($1_logic.txt)"; \
echo "# Generated by MTT on" `date`.; \
cat $MTTPATH/trans/rcs_header.sh; \
echo ;\
)> $1_logic.txt
#SUMMARY logic Dynamic switch logic (tex)
#SUMMARY logic Dynamic switch logic (view)
$1_logic.tex: $1_logic.txt
txt2tex $1 logic txt
#SUMMARY switch Dynamic switch information (txt)
$1_switch.txt: $1_struc.txt
struc2switch_txt $1
$1_switchopen.m: $1_switch.txt $1_sympars.txt $1_logic.txt
switch_txt2m $1
#SUMMARY sympars sympar + dynamic switch information (txt)
$1_sympars.txt: $1_sympar.txt $1_switch.txt
echo Creating $1_sympars.txt
cat $1_sympar.txt $1_switch.txt > $1_sympars.txt
#SUMMARY simp simplification information (r)
|
|
<
<
<
<
<
<
<
<
<
|
|
|
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
|
sympar_txt2c $1
#SUMMARY sympar symbolic parameters (tex)
# txt to tex (LaTeX) sympar conversion
$1_sympar.tex: $1_sympar.txt
sympar_txt2tex $1
#SUMMARY logic Dynamic switch logic (tex)
#SUMMARY logic Dynamic switch logic (view)
$1_logic.tex: $1_logic.txt
txt2tex $1 logic txt
#SUMMARY switch Dynamic switch information (txt)
$1_switch.txt: $1_struc.txt
struc2switch_txt $1
#$1_switchopen.m: $1_switch.txt $1_sympars.txt $1_logic.txt
# switch_txt2m $1
#SUMMARY sympars sympar + dynamic switch information (txt)
$1_sympars.txt: $1_sympar.txt $1_switch.txt
echo Creating $1_sympars.txt
cat $1_sympar.txt $1_switch.txt > $1_sympars.txt
#SUMMARY simp simplification information (r)
|
︙ | | | ︙ | |
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
|
mtt_update $1 numpar update
else
mtt_update $1 numpar
endif
#SUMMARY state numerical state declaration -- default (txt)
$1_state.txt : FORCE
mtt -q $1 sympar txt
ifeq ($target,$1_state.txt)
mtt_update $1 state update
else
mtt_update $1 state
endif
# Dummy target
FORCE:
#SUMMARY numpar numerical parameter declaration (m)
$1_numpar.m: $1_numpar.txt $1_sympars.txt
mtt_txt2m $1 numpar
#SUMMARY numpar numerical parameter declaration (c)
#SUMMARY numpar numerical parameter declaration (view)
$1_numpar.c: $1_numpar.txt $1_sympar.c
txt2c $1 numpar
#SUMMARY input numerical input declaration -- default (txt)
ifeq ($steadystate_computation,yes)
$1_input.txt:
mtt -q $mtt_switches $1 ss r
mtt -q $mtt_switches $1 struc txt
mtt -q $mtt_switches $1 switch txt
struc2input_txt2txt -ss $1
#$1_state.txt:
# mtt -q $mtt_switches $1 ss r
# mtt -q $mtt_switches $1 struc txt
# struc2state_txt2txt -ss $1
else
$1_input.txt:
mtt -q $mtt_switches $1 struc txt
mtt -q $mtt_switches $1 switch txt
struc2input_txt2txt $1
#$1_state.txt:
# mtt -q $mtt_switches $1 struc txt
# struc2state_txt2txt $1
endif
#ifeq ($switches,0)
#$1_input.txt:
# mtt $mtt_switches $1 struc txt;
# mtt $mtt_switches $1 ss r;
# struc2input_txt2txt $1
#endif
#ifeq ($switches,1)
#$1_input.txt:
# mtt $mtt_switches -q -u $1 struc txt;
# mtt $mtt_switches $1 ss r;
# mtt $mtt_switches -q -u $1 switch txt;
# struc2input_txt2txt -s $1
#endif
#SUMMARY input numerical input declaration (m)
$1_input.m: $1_input.txt $1_sympars.txt
mtt_txt2m $1 input
#SUMMARY state state declaration -- default (txt)
#$1_state.txt:
# mtt $mtt_switches $1 struc txt;
# mtt $mtt_switches $1 ss r;
# struc2state_txt2txt $1
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
|
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
|
mtt_update $1 numpar update
else
mtt_update $1 numpar
endif
#SUMMARY state numerical state declaration -- default (txt)
$1_state.txt : FORCE
mtt -q $1 struc txt
mtt -q $1 sympar txt
ifeq ($target,$1_state.txt)
mtt_update $1 state update
else
mtt_update $1 state
endif
#SUMMARY state numerical state declaration -- default (txt)
$1_input.txt : FORCE
mtt -q $1 struc txt
mtt -q $1 sympar txt
ifeq ($target,$1_input.txt)
mtt_update $1 input update
else
mtt_update $1 input
endif
#SUMMARY logic Dynamic switch logic (txt)
$1_logic.txt : FORCE
mtt -q $1 struc txt
mtt -q $1 sympar txt
ifeq ($target,$1_logic.txt)
mtt_update $1 logic update
else
mtt_update $1 logic
endif
# Dummy target
FORCE:
#SUMMARY numpar numerical parameter declaration (m)
$1_numpar.m: $1_numpar.txt $1_sympars.txt
mtt_txt2m $1 numpar
#SUMMARY numpar numerical parameter declaration (c)
#SUMMARY numpar numerical parameter declaration (view)
$1_numpar.c: $1_numpar.txt $1_sympar.c
txt2c $1 numpar
#SUMMARY input numerical input declaration -- default (txt)
#'ifeq ($steadystate_computation,yes)
#$1_input.txt:
# mtt -q $mtt_switches $1 ss r
# mtt -q $mtt_switches $1 struc txt
# mtt -q $mtt_switches $1 switch txt
# struc2input_txt2txt -ss $1
#$1_state.txt:
# mtt -q $mtt_switches $1 ss r
# mtt -q $mtt_switches $1 struc txt
# struc2state_txt2txt -ss $1
#else
#$1_input.txt:
# mtt -q $mtt_switches $1 struc txt
# mtt -q $mtt_switches $1 switch txt
# struc2input_txt2txt $1
#$1_state.txt:
# mtt -q $mtt_switches $1 struc txt
# struc2state_txt2txt $1
#endif
#ifeq ($switches,0)
#$1_input.txt:
# mtt $mtt_switches $1 struc txt;
# mtt $mtt_switches $1 ss r;
# struc2input_txt2txt $1
#endif
#ifeq ($switches,1)
#$1_input.txt:
# mtt $mtt_switches -q -u $1 struc txt;
# mtt $mtt_switches $1 ss r;
# mtt $mtt_switches -q -u $1 switch txt;
# struc2input_txt2txt -s $1
#endif
#SUMMARY input numerical input declaration (m)
$1_input.m: $1_input.txt $1_sympars.txt
mtt_txt2m $1 input
#SUMMARY input numerical input declaration (m)
$1_logic.m: $1_logic.txt $1_switch.txt
mtt_txt2m $1 logic
#SUMMARY state state declaration -- default (txt)
#$1_state.txt:
# mtt $mtt_switches $1 struc txt;
# mtt $mtt_switches $1 ss r;
# struc2state_txt2txt $1
|
︙ | | | ︙ | |
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
|
$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r
ode_r2tex $1; latex_tidy $1_ode.tex
# The main simulation programme
ifeq ($integration_method,implicit)
$1_ode2odes.m : $1_def.r $1_sympars.txt $1_smxa.$m $1_smxax.$m\
$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
$1_csex.$m $1_cseo.$m $1_switchopen.m
make_ode2odes $1 $integration_method
endif
ifeq ($integration_method,euler)
$1_ode2odes.m : $1_def.r $1_sympars.txt\
$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
$1_ode.$m $1_odeo.$m $1_switchopen.m
make_ode2odes $1 $integration_method
endif
#Conversion of m to p to c
#SUMMARY ode ordinary differential equations (c)
#SUMMARY ode ordinary differential equations (p)
|
|
|
|
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
|
$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r
ode_r2tex $1; latex_tidy $1_ode.tex
# The main simulation programme
ifeq ($integration_method,implicit)
$1_ode2odes.m : $1_def.r $1_sympars.txt $1_smxa.$m $1_smxax.$m\
$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
$1_csex.$m $1_cseo.$m $1_logic.m
make_ode2odes $1 $integration_method
endif
ifeq ($integration_method,euler)
$1_ode2odes.m : $1_def.r $1_sympars.txt\
$1_simpar.m $1_numpar.m $1_state.m $1_input.m \
$1_ode.$m $1_odeo.$m $1_logic.m
make_ode2odes $1 $integration_method
endif
#Conversion of m to p to c
#SUMMARY ode ordinary differential equations (c)
#SUMMARY ode ordinary differential equations (p)
|
︙ | | | ︙ | |
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
|
mtt_m2p $1_cseo.m
$1_smx.p : $1_def.r $1_smx.m
mtt_m2p $1_smx.m
$1_smxa.p : $1_def.r $1_smxa.m
mtt_m2p $1_smxa.m
$1_smxax.p : $1_def.r $1_smxax.m
mtt_m2p $1_smxax.m
$1_switchopen.p : $1_def.r $1_switchopen.m
mtt_m2p $1_switchopen.m
ifeq ($integration_method,implicit)
$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smxa.p $1_smxax.p\
$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
$1_csex.p $1_cseo.p $1_switchopen.p
mtt_m2p $1_ode2odes.m $integration_method $stdin
endif
ifeq ($integration_method,euler)
$1_ode2odes.p : $1_ode2odes.m $1_def.r\
$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
$1_ode.p $1_odeo.p $1_switchopen.p
mtt_m2p $1_ode2odes.m $integration_method $stdin
endif
$1_ode2odes.c: $1_ode2odes.p
mtt_p2c $info_switch $1 ode2odes
#SUMMARY sim Octave simulation function (m)
|
|
|
|
|
|
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
|
mtt_m2p $1_cseo.m
$1_smx.p : $1_def.r $1_smx.m
mtt_m2p $1_smx.m
$1_smxa.p : $1_def.r $1_smxa.m
mtt_m2p $1_smxa.m
$1_smxax.p : $1_def.r $1_smxax.m
mtt_m2p $1_smxax.m
$1_logic.p : $1_def.r $1_logic.m
mtt_m2p $1_logic.m
ifeq ($integration_method,implicit)
$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smxa.p $1_smxax.p\
$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
$1_csex.p $1_cseo.p $1_logic.p
mtt_m2p $1_ode2odes.m $integration_method $stdin
endif
ifeq ($integration_method,euler)
$1_ode2odes.p : $1_ode2odes.m $1_def.r\
$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
$1_ode.p $1_odeo.p $1_logic.p
mtt_m2p $1_ode2odes.m $integration_method $stdin
endif
$1_ode2odes.c: $1_ode2odes.p
mtt_p2c $info_switch $1 ode2odes
#SUMMARY sim Octave simulation function (m)
|
︙ | | | ︙ | |
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
|
m2dat $1_sro
1_odes.c: $1_ode.c $1_def.r $1_sympar.r
ode2odes_r2c $1
$1_sms.c: $1_sm.c $1_def.r $1_sympar.r
sm2sms_r2c $1
ifeq ($computation,octave)
$1_odes.dat2: $1_ode2odes.m $1_ode.m $1_odeo.m $1_numpar.m $1_switchopen.m \
$1_def.m $1_input.m $1_state.m $1_simpar.m
time octave_ode2odes $1
endif
ifeq ($computation,c)
$1_ode2odes.out: $1_ode2odes.c
echo Creating $1_odes.out
|
|
|
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
|
m2dat $1_sro
1_odes.c: $1_ode.c $1_def.r $1_sympar.r
ode2odes_r2c $1
$1_sms.c: $1_sm.c $1_def.r $1_sympar.r
sm2sms_r2c $1
ifeq ($computation,octave)
$1_odes.dat2: $1_ode2odes.m $1_ode.m $1_odeo.m $1_numpar.m $1_logic.m \
$1_def.m $1_input.m $1_state.m $1_simpar.m
time octave_ode2odes $1
endif
ifeq ($computation,c)
$1_ode2odes.out: $1_ode2odes.c
echo Creating $1_odes.out
|
︙ | | | ︙ | |