/[ascend]/trunk/models/force1d.a4s
ViewVC logotype

Contents of /trunk/models/force1d.a4s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download)
Fri Oct 29 20:54:12 2004 UTC (20 years, 6 months ago) by aw0a
File size: 3074 byte(s)
Setting up web subdirectory in repository
1 # This file is part of the ASCEND Modeling Library and is released
2 # under the GNU Public License as described at the end of this file.
3 #
4 # This file demonstrates the use of force1d.a4c and the use of
5 # PLOT in ASCEND
6
7 # Mass/spring/anchor/finger/hook stationary on horizontal surface.
8 #
9
10 DELETE TYPES;
11 READ FILE "force1d.a4c";
12
13 #
14 # build a test model anchor/spring/mass/finger
15 #
16 COMPILE hand OF finger_test;
17 BROWSE {hand};
18 RUN {hand.reset};
19
20 # Send the distances we want to see to the probe
21 PROBE current {hand.h1.X} {};
22 PROBE current {hand.h2.X} {};
23 PROBE current {hand.h3.X} {};
24 PROBE current {hand.s1.dx} {};
25
26 # Send the input variables to the probe
27 PROBE current {hand.m1.width} {};
28 PROBE current {hand.pinky.pull} {};
29 PROBE current {hand.s1.L0} {};
30
31 ASSIGN {hand.m1.width} 0.04 {meter};
32 SOLVE {hand} WITH QRSlv;
33
34 # now specify the spring stretch and calc pull.
35 DELETE SYSTEM;
36 ASSIGN {hand.s1.dx} 0.05 {meter};
37 ASSIGN {hand.s1.dx.fixed} TRUE {};
38 ASSIGN {hand.pinky.pull.fixed} FALSE {};
39 SOLVE {hand} WITH QRSlv;
40
41 #
42 # build a test model anchor/spring/spring/finger
43 #
44 COMPILE slinky OF spring_test;
45 BROWSE {slinky};
46 RUN {slinky.reset};
47
48 # Send the distances we want to see to the probe
49 PROBE new {slinky.h1.X} {};
50 PROBE current {slinky.h2.X} {};
51 PROBE current {slinky.h3.X} {};
52 PROBE current {slinky.s1.dx} {};
53
54 # Send the input variables to the probe
55 PROBE current {slinky.s2.L0} {};
56 PROBE current {slinky.pinky.pull} {};
57 PROBE current {slinky.s1.L0} {};
58
59 ASSIGN {slinky.s2.L0} 0.4 {meter};
60 SOLVE {slinky} WITH QRSlv;
61
62 # now specify the spring stretch and calc pull.
63 DELETE SYSTEM;
64 ASSIGN {slinky.s1.dx} 0.05 {meter};
65 ASSIGN {slinky.s1.dx.fixed} TRUE {};
66 ASSIGN {slinky.pinky.pull.fixed} FALSE {};
67 SOLVE {slinky} WITH QRSlv;
68
69 #
70 # This block does the work illustrated in howto-plot.
71 #
72
73 # do plot model
74 COMPILE pst OF plot_spring_test;
75 BROWSE {pst};
76 RUN {pst.st.reset};
77 SOLVE {pst.st} WITH QRSlv;
78 PLOT {pst.Plot_X} ;
79 SHOW LAST;
80
81 ########## force1d.a4s ends here ##########
82 #
83 # force1d.a4s
84 # by Benjamin Allan
85 # May 16, 1998
86 # Part of the ASCEND Library
87 # $Date: 1998/06/17 20:08:32 $
88 # $Revision: 1.2 $
89 # $Author: mthomas $
90 # $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/force1d.a4s,v $
91 #
92 # This file is part of the ASCEND Modeling Library.
93 #
94 # Copyright (C) 1998 Carnegie Mellon University
95 #
96 # The ASCEND Modeling Library is free software. You can redistribute
97 # it and/or modify it under the terms of the GNU General Public
98 # License as published by the Free Software Foundation---either
99 # version 2 of the License, or (at your option) any later version.
100 #
101 # The ASCEND Modeling Library is distributed in hope that it
102 # will be useful, but WITHOUT ANY WARRANTY--without even the implied
103 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
104 # See the GNU General Public License for more details.
105 #
106 # You should have received a copy of the GNU General Public License
107 # along with the program. If not, write to the Free Software
108 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
109 # the file named COPYING.

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22