1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Defining the Equations of Motion</TITLE>
<META NAME="description" CONTENT="Defining the Equations of Motion">
<META NAME="keywords" CONTENT="userman">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="userman.css">
<LINK REL="next" HREF="node54.html">
<LINK REL="previous" HREF="node52.html">
<LINK REL="up" HREF="node52.html">
<LINK REL="next" HREF="node54.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1203"
HREF="node54.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/lib/latex2html/icons.gif/next_motif.gif"></A>
<A NAME="tex2html1200"
HREF="node52.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/lib/latex2html/icons.gif/up_motif.gif"></A>
<A NAME="tex2html1194"
HREF="node52.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/lib/latex2html/icons.gif/previous_motif.gif"></A>
<A NAME="tex2html1202"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/lib/latex2html/icons.gif/contents_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1204"
HREF="node54.html">Defining Derivative Information</A>
<B> Up:</B> <A NAME="tex2html1201"
HREF="node52.html">Installing a New Dynamical</A>
<B> Previous:</B> <A NAME="tex2html1195"
HREF="node52.html">Installing a New Dynamical</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00621000000000000000"> </A><A NAME="def_eqns"> </A><A NAME="1944"> </A>
<BR>
Defining the Equations of Motion
</H2>
We shall use as an example a two-dimensional mapping
<!-- MATH: $f=f_{\alpha,\gamma}$ -->
62#62defined by
<A NAME="bball"> </A>
<BR>
63#63
<BR>
These equations are a model for the dynamics of a ball bouncing<A NAME="1952"> </A> on a sinusoidally
vibrating table. The variable 64#64
is proportional to the time, but because of the sinusoidal motion
of the table, we may think of 64#64
as belonging to the circle parametrized by 65#65.
The variable <I>v</I> is proportional to the ball's velocity immediately after contact with the
table. The parameter 40#40,
<!-- MATH: $0 < \alpha \leq 1$ -->
66#66
is the coefficient
of restitution for the ball; the parameter
<!-- MATH: $\gamma > 0$ -->
67#67
is the amplitude of the
table oscillations. Essentially, the equations say that given the time of the <I>j</I>th impact
(68#68)
and the ball's velocity at that time (<I>v</I><SUB><I>j</I></SUB>), we know the time that the ball will next strike the
table (
<!-- MATH: $\phi_{j+1}$ -->
69#69), as well as the ball's velocity immediately after its next bounce (<I>v</I><SUB><I>j</I>+1</SUB>).
See [<A
HREF="node68.html#guckenheimerholmes">1</A>] for information about the
dynamics of this system.
<P>
Suppose that a user wishes to study Equation <A HREF="node53.html#bball"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]"
SRC="/usr/lib/latex2html/icons.gif/cross_ref_motif.gif"></A> numerically using DsTool.
The first task is to define the equations.
First, copy the file GENERIC.c to the file that you want
to edit. For this example, call the target file bball_def.c.
You can use any text editor to edit bball_def.c.
The beginning of the file looks like:
<PRE>
#include <model_headers.h>
/* ------------------------------------------------------------------------
function used to define the vector field or map
------------------------------------------------------------------------ */
int user_ds_func(f,x,p)
double *f,*x,*p;
{
}
</PRE>
<P>
First change the name of this function from user_ds_func() to
bball(). Then edit the function so that it properly defines the
mapping. When you are finished, the function should look like:
<PRE>
#include <model_headers.h>
/* ------------------------------------------------------------------------
function used to define the map
------------------------------------------------------------------------ */
int bball(f,x,p)
double *f,*x,*p;
{
f[0] = x[0] + x[1];
f[1] = p[0] * x[1] - p[1] * cos(x[0] + x[1]);
}
</PRE>
<P>
The mapping is now defined. We remind novice C-programmers that arrays in C are indexed
from 0. When bball() is called, the calling
routine is expected to pass in arrays f, x, and p. The input variables are
the current state of variables (x) and the current parameters (p):
x &=& {x[0], x[1]} = {_j, v_j},
<BR>
p &=& {p[0], p[1]} = {, }.
The function bball() places the new state in the array f:
f &=& { f[0], f[1] } = {_j+1, v_j+1}.
<P>
This function<A NAME="1981"> </A> <EM>must</EM> be defined in order
to begin exploration of dynamics. If the user does not wish to
input information about the system's derivative or inverse, and if
no auxiliary functions are desired, the user could proceed to Section <A HREF="node57.html#ic"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]"
SRC="/usr/lib/latex2html/icons.gif/cross_ref_motif.gif"></A>.
For the purpose of illustration, however, we encourage the reader to
continue reading.
<P>
We remark at this point that although this system is a two-dimensional mapping,
the value <I>x</I>[2] contains the current ``time.''<A NAME="1984"> </A> In general, if there are
<I>k</I> dependent variables, then x[0], 70#70,
x[k-1] contain these variables and
x[k] contains the independent variable.<A NAME="1988"> </A>
This is true both for maps and for vector fields.
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1203"
HREF="node54.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="/usr/lib/latex2html/icons.gif/next_motif.gif"></A>
<A NAME="tex2html1200"
HREF="node52.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="/usr/lib/latex2html/icons.gif/up_motif.gif"></A>
<A NAME="tex2html1194"
HREF="node52.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="/usr/lib/latex2html/icons.gif/previous_motif.gif"></A>
<A NAME="tex2html1202"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="/usr/lib/latex2html/icons.gif/contents_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1204"
HREF="node54.html">Defining Derivative Information</A>
<B> Up:</B> <A NAME="tex2html1201"
HREF="node52.html">Installing a New Dynamical</A>
<B> Previous:</B> <A NAME="tex2html1195"
HREF="node52.html">Installing a New Dynamical</A>
<!--End of Navigation Panel-->
<ADDRESS>
<I>John Lapeyre</I>
<BR><I>1998-09-04</I>
</ADDRESS>
</BODY>
</HTML>
|