[go: up one dir, main page]

Menu

[r5]: / docs / eqc-4.html  Maximize  Restore  History

Download this file

537 lines (505 with data), 27.3 kB

  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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.66">
<TITLE>The EQC Handbook: Reference</TITLE>
<LINK HREF="eqc-5.html" REL=next>
<LINK HREF="eqc-3.html" REL=previous>
<LINK HREF="eqc.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="eqc-5.html">Next</A>
<A HREF="eqc-3.html">Previous</A>
<A HREF="eqc.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4.</A> <A HREF="eqc.html#toc4">Reference</A></H2>
<H2><A NAME="ss4.1">4.1</A> <A HREF="eqc.html#toc4.1">Basic syntax</A>
</H2>
<P>There are two categories of keywords recognized by EQC: Keywords in the Latex file, and keywords inside
equation statements. The syntax used to describe the keywords is:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
keyword [optarg1] [optarg2] ... {argument1} {argument2} ...
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Arguments in square brackets are optional.</P>
<P>The following abbreviations for the different types of arguments are used:</P>
<P>
<DL>
<DT><B>exp</B><DD>
<P>A mathematical expression like x + sin(y).</P>
<DT><B>equation: exp = exp</B><DD>
<P>An equation created by equating two mathematical expressions.</P>
<DT><B>equation: exp &amp; = &amp; exp</B><DD>
<P>Same as before, but inside an equation array. Other positions of the <CODE>&amp;</CODE> are possible
as well.</P>
<DT><B>equation: "label"</B><DD>
<P>EQC optionally accepts an equation label in any place where an equation is required. Labels
must be enclosed in double quotes. The special equation label <CODE>"prev'</CODE> references the
last equation that was registered with EQC.</P>
<DT><B>eqlist: equation OR equation ; equation ; equation ...</B><DD>
<P>Either a single equation or a list of equations separated by colons.</P>
<DT><B>unitlist: unit ; unit ; unit ...</B><DD>
<P>A list of physical unit names like \mm; \N, separated by colons.</P>
<DT><B>explist: exp ; exp ; exp ...</B><DD>
<P>A list of expressions like x; y; z^2, separated by colons.</P>
<DT><B>simplifications: simplification ; simplification ; simplification ...</B><DD>
<P>A list of strings describing simplifications to be performed on an equation.</P>
<DT><B>vector: start : end : step </B><DD>
<P>A vector beginning at <CODE>start</CODE> and ending at <CODE>end</CODE>, with steps of
<CODE>step</CODE>. If <CODE>end - start</CODE> is not a multiple of <CODE>step</CODE>, the
last element of the vector will be smaller than <CODE>end</CODE>. If you don't care about the size
of the step, give a value of 0: EQC will make the vector have the number of elements defined
by the option <CODE>vecautosize</CODE> (default 20).</P>
<DT><B>matrix: {element1; element2; ... elementN} OR {{element11; element12; ... element1N}; { ... }; {elementM1; ... elementMN}}</B><DD>
<P>A vector or a matrix of arbitrary expressions. The brackets are important, but not the type of bracket. A matrix can be used
anywhere an expression is allowed.</P>
</DL>
</P>
<P>Numbers can have the imaginary unit <CODE>i</CODE>, which on the other hand means that you cannot use
<CODE>i</CODE> as a variable name.</P>
<H2><A NAME="ss4.2">4.2</A> <A HREF="eqc.html#toc4.2">Keywords in the Latex file</A>
</H2>
<H3>Keywords for manipulating equations</H3>
<P>All these keywords take several optional arguments. The asterisk form suppresses printing the
equation. A label may be given to the equation in square brackets. In addition, all the options listed
for the keyword <CODE>eqcoptions</CODE> can be used and will then apply for this equation only. Note that
if only an equation label and no further option is provided the square brackets, the key <CODE>label =</CODE>
can be omitted, and the label does not need to be quoted (<CODE>""</CODE>).
<DL>
<DT><B>\constant [*] {equation}</B><DD>
<P>Registers a constant with EQC. Constants are not erased by
<CODE>\clearequations</CODE>. This makes it possible to specify general constants only once in
the file and reuse them for several different calculations. The value assigned to this constant
is automatically used when calculating the value of variables. The asterix form suppresses printing of
the constant equation in the Latex output file.</P>
<DT><B>\eq [*] [[label]] {equation}</B><DD>
<P>Registers an equation with EQC. Only equations that have been
registered are used to calculate the values of variables. The asterix form suppresses printing of
the equation in the Latex output file. The equation can be assigned an optional label which may be used
to reference it later on in the file. The Latex <CODE>\ref{}</CODE> command will also work with this label.
Note that here the label may not be surrounded by quotes!
For the special case of the equation label starting with <CODE>lib:</CODE>, the equation will
not be erased by <CODE>\clearequations</CODE>. This is useful for building a library of generic
equations, as for example in the file <CODE>substitutions.tex</CODE>.</P>
<DT><B>\deleq{label}</B><DD>
<P>Removes an equation such that it has no influence on future searches
for variable values. Note that since LaTeX does not support removing labels, the label itself
will be not be re-usable!</P>
<DT><B>\eqadd [*] [[label]] {equation}{expr}</B><DD>
<P>Adds an expression to the equation. A label may be
assigned to the result. The resulting equation is only registered with the EQC if it has been assigned a
label. The reason for this is that the equation is usually redundant in terms of using it for calculating
the value of variables. The asterix form suppresses printing of the resulting equation.</P>
<DT><B>\eqdiv [*] [[label]] {equation}{exp}</B><DD>
<P>Divides the equation by an expression. The asterix
suppresses Latex output, the label enables the equation to be referenced later and causes it to be
registered with the EQC.</P>
<DT><B>\eqmul [*] [[label]] {equation}{exp}</B><DD>
<P>Multiplies the equation with an expression. The asterix
suppresses Latex output, the label enables the equation to be referenced later and causes it to be
registered with the EQC.</P>
<DT><B>\eqpow [*] [[label]] {equation}{exp}</B><DD>
<P>Raises both sides of the equation to the
power of an expression. <EM>Beware:</EM> This ignores alternative results, as in the case of
<CODE>\eqpow{x^2}{1/2}</CODE>, which might evaluate to <CODE>+x</CODE> or <CODE>-x</CODE>. Only use this
function if you are sure that you want the first possible result!</P>
<DT><B>\eqfunc [*] [[label]] {equation}{exp}</B><DD>
<P>Applies the expression, which must be a
valid function name (without parameters), to both sides of the equation.</P>
<DT><B>\eqsub [*] [[label]] {equation}{exp}</B><DD>
<P>Subtracts an expression from the equation. The asterix
suppresses Latex output, the label enables the equation to be referenced later and causes it to be
registered with the EQC.</P>
<DT><B>\eqrev [*] [[label]] {equation}</B><DD>
<P>Swaps left hand side and right hand side of the equation. The asterix
suppresses Latex output, the label enables the equation to be referenced later and causes it to be
registered with the EQC.</P>
<DT><B>\eqsubst [*] [[label]] {equation}{eqlist}</B><DD>
<P>Substitutes expressions inside an equation. The
<CODE>eqlist</CODE> argument is a list of equations separated by ';'. Any occurences of the left hand side of
these equations is replaced by the right hand side. The asterix
suppresses Latex output, the label enables the equation to be referenced later and causes it to be
registered with the EQC.</P>
<DT><B>\eqsimpf [*] [[label]] {equation}{simplifications}</B><DD>
<P>Simplifies both sides of the equation
according to the simplifications given in a list. Possible values are:
<DL>
<DT><B>expand</B><DD>
<P>Fully expands all expressions, including function arguments.</P>
<DT><B>expandf</B><DD>
<P>Only expand function definition, not arguments.</P>
<DT><B>eval</B><DD>
<P>Numerically evaluate the equation as far as possible.</P>
<DT><B>normal</B><DD>
<P>Normalize the equation (see description of GiNaC normal() method).</P>
<DT><B>collect-common</B><DD>
<P>Collect common factors (see description of GiNaC
collect_common_factors() method).</P>
<DT><B>unsafe</B><DD>
<P>Does unsafe simplifications, for example
<UL>
<LI> <CODE>\sqrt{x^2} => x</CODE></LI>
<LI> <CODE>\arctan\tan{x} => x</CODE>. Note that the opposite <CODE>\tan\arctan{x}</CODE> is
not an unsafe evaluation and is thus done automatically (by GiNaC).</LI>
</UL>
</P>
<DT><B>diff></B><DD>
<P>Evaluates differential function <CODE>\diff</CODE>.</P>
<DT><B>sum</B><DD>
<P>Evaluates sum functions <CODE>\sum</CODE>.</P>
<DT><B>gather-sqrt</B><DD>
<P>Gathers single square roots under one root symbol.</P>
<DT><B>integrate</B><DD>
<P>Symbolically integrates any integrals in the expression (if possible)</P>
</DL>
</P>
<DT><B>\eqsolve [*] [[label]] {equation}{exp}{exp}</B><DD>
<P>Solves the equation for a given variable.
The last argument indicates which solution is requested (in case there are several solutions, like
for a quadratic equation). The function returns an assignment for the variable.</P>
</DL>
</P>
<H3>Keywords for manipulating expressions</H3>
<P>
<DL>
<DT><B>\lhs {equation}</B><DD>
<P>Returns the left hand side of the equation.</P>
<DT><B>\rhs {equation}</B><DD>
<P>Returns the right hand side of the equation.</P>
<DT><B>\val [[int]] [[unitlist]] {exp}</B><DD>
<P>EQC replaces this keyword with the value of the specified expression (which
usually is, but need not be, a variable). EQC tries to derive the value from the given equations
in the form of a physical quantity. If this is not successful, a symbolic expression will be printed instead. Any
floating point numbers will be printed with an optional precision. If the quantity should be expressed in other units
than those set by <CODE>\preferredunits</CODE>, a list of units can be passed as an optional parameter.</P>
<DT><B>\valwith [[int]] [[unitlist]] {exp} {exp}
An additional list of assignments can be given to find the value. All the assignments given are registered as new
equations and then the value is searched for. This is the same as doing </B><DD>
<P>
<BLOCKQUOTE><CODE>
<PRE>
\eq*[eq:temp_1]{assignment_1}%
...
\eq*[eq:temp_n]{assignment_n}%
\val{exp}
\deleq{"eq:temp_1"; ... "eq:temp_n}%
</PRE>
</CODE></BLOCKQUOTE>
</P>
<DT><B>\quantity [[int]] {exp}</B><DD>
<P>Same as val, but an error is printed if the value of the variable is no
quantity. Any floating point numbers will be printed with an optional precision.</P>
<DT><B>\numval [[int]] {exp}</B><DD>
<P>Same as val, but an error is printed if the value of the variable is no
number. Any floating point numbers will be printed with an optional precision.</P>
<DT><B>\units [[int]] {exp}</B><DD>
<P>Same as val, but an error is printed if the value of the variable is no
unit or a multiplication of several units and/or powers of units. Any floating point numbers will be printed with
an optional precision.</P>
<DT><B>\eqeval{equation}{equation}</B><DD>
<P>Evaluates the first equation to a matrix of
values. The second equation needs to have the form <CODE>sym = vector</CODE>. The symbol
is treated as the independent variable, and the equation is evaluated for all values of the symbol
given in the vector. The result is a 2x2 matrix, with the values of the independant variable in the
first column and the evaluation results in the second column. For example:
<CODE>\eqeval{y = x^2}{x = 1:5:1}</CODE> would become <CODE>(1; 4; 9; 16; 25)</CODE></P>
<DT><B>\eqevalp{x-equation}{y-equation}{equation}</B><DD>
<P>Evaluate a function given in parameter form
to a matrix of values. Example (the evolvent function):
<CODE>\eqevalp{x = R (\cos t + t \sin t)}{y = R(sin t - t \cos t)}{t = 0:90\degree:5\degree}</CODE></P>
<DT><B>\numer{exp}</B><DD>
<P>Returns the numerator of the expression.</P>
<DT><B>\denom{exp}</B><DD>
<P>Returns the denominator of the expression.</P>
<DT><B>\diff{exp;var;num}</B><DD>
<P>Creates a differential of the expression with respect to <CODE>var</CODE> to
the degree of <CODE>num</CODE>. It can be evaluated using <CODE>\eqsimpf{exp}{diff}</CODE></P>
<DT><B>\sum{equation;exp;exp}</B><DD>
<P>The sum function. The first equation is the lower bound, the second the upper
bound, the third the expression to sum up. Example: <CODE>\sum{n=1;3;n}</CODE>. Note that the bounds must become integer values when the
function is evaluated with <CODE>\eqsimpf{exp}{sum}</CODE>. </P>
<DT><B>\tseries{exp}{equation}{exp}</B><DD>
<P>Creates a Taylor series for the first expression. The second
parameter must have the form <CODE>sym = number</CODE>. The series is created for the dependant variable
<CODE>sym</CODE> around <CODE>number</CODE>. The third parameter must be an integer defining the degree of
the series expansion.</P>
<DT><B>\ceil{exp}{digits}</B><DD>
<P>Return the numeric value of the expression, rounded up to the nearest integer
with the given number of digits after the decimal point.</P>
<DT><B>\floor{exp}{digits}</B><DD>
<P>Return the numeric value of the expression, rounded down to the nearest integer
with the given number of digits after the decimal point.</P>
</DL>
</P>
<H3>Keywords for defining new units and functions</H3>
<P>
<DL>
<DT><B>\defunit [*] [latexname] {macro}{exp}</B><DD>
<P>Defines a new unit. The <CODE>macro</CODE> is the name of the
unit, this must begin with a backslash because a Latex macro will be created with this name for
referencing the unit later on. The expression defines the unit in terms of units already known to the EQC.
If this expression contains data types apart from units, powers of units, numerics, or constants already
known to EQC, a warning is issued, but the unit definition is created anyway.</P>
<P>To suppress the generation of the Latex command for this unit, use the asterix form. If you wish the
Latex macro to output something other than the expression, supply this as an optional argument. It
will be printed in the mathrm font.</P>
<DT><B>\function [[hints]] {name} {explist}</B><DD>
<P>Registers a user-defined function with EQC. The function has
the arguments given in the explist. Example: <CODE>\function{f}{x;y}</CODE>. The function may be
used in equations and expressions with or without arguments. The following hints are possible:
<DL>
<DT><B>lib</B><DD>
<P>This is a library function. It will not be erased by
<CODE>\clearequations</CODE>.</P>
<DT><B>trig</B><DD>
<P>This is a trigonometric function. It will be printed as sin²x
instead of (sin(x))² (for example).</P>
<DT><B>nobracket</B><DD>
<P>This functions needs no brackets when printed (for example, the
<CODE>sqrt()</CODE> function).</P>
<DT><B>expand</B><DD>
<P>The function will be expanded immediately (provided it has been given
a definition). This is useful for example with <CODE>square()</CODE> und <CODE>cubic()</CODE></P>
</DL>
</P>
<DT><B>\deffunc [*] {name}{exp}</B><DD>
<P>Define an expression which will be used to evaluate the function,
for example, <CODE>\deffunc{f}{ax^2+bx+c}</CODE>. Without the asterix, this command will produce
output like <CODE>f(x) = ax^2 + bx + c</CODE>.</P>
</DL>
</P>
<H3>Keywords for printing results</H3>
<P>
<DL>
<DT><B>\printeq {equation}</B><DD>
<P>Prints the equation (this will usually be an equation label)</P>
<DT><B>\printvector{exp}</B><DD>
<P>Prints a vector in the format required by pstricks.sty.</P>
<DT><B>\eqwrite\filename{equation}{label}</B><DD>
<P>Write an equation to a file. The equation has the
label as given. This is useful to create a file of equations, which can then be included into
another document and reused there. A typical usage would be
<PRE>
\printoptions{eqparse}%Turn off pretty-printing of equations
\newwrite\eqfile%
\immediate\openout\eqfile filename.tex%
\eqwrite\eqfile{\printeq{"eq:example"}}{eq:example}%
\immediate\closeout\eqfile%
\printoptions{eqnoparse}%
</PRE>
This file could then be reused as follows:
<PRE>
\input filename.tex
Equation \eqcref{"eq:example"} in 'whatever original file it came from' states
\begin{equation}
\printeq{"eq:example"}
\end{equation}
</PRE>
</P>
</DL>
</P>
<H3>Output formatting</H3>
<P>All options are handled by the common keyword <CODE>\eqcoptions</CODE>. It takes a list of key-value pairs
<DL>
<DT><B>label = <CODE>string</CODE> Specifies a label for the equation, the label must be enclosed in quotes (<CODE>""</CODE>).</B><DD>
<DT><B>precision = integer</B><DD>
<P>Specifies what precision is to be used for printing floating point numbers. The
precision is the absolute number of digits printed, more digits are rounded away. The precisions is 4
by default.</P>
<DT><B>fixeddigits = true|false</B><DD>
<P>Specifies whether floating point numbers should be
printed with a fixed number of digits after the decimal marker or with a fixed number of digits in total. The
default is fixed_digits.</P>
<DT><B>lowsclimit = exp</B><DD>
<P>Defines the low limit beyond which
floating point numbers are printed as <CODE>mantissa * 10^exponent</CODE>.</P>
<DT><B>highsclimit = exp</B><DD>
<P>Defines the high limit beyond which
floating point numbers are printed as <CODE>mantissa * 10^exponent</CODE>.</P>
<DT><B>units = unitlist</B><DD>
<P>Specifies a list of units separated by ';' preferred for printing
physical quantities.
If no such list is specified, the SI base units are used. This usually makes for ugly output, for example,
when printing forces the unit Newton. A useful list of preferred units for mechanical engineering might be
<CODE>{\mm; \N; \Nm; \Nosqmm}</CODE>. The order in which the preferred units are specified is important! Simple
units should be specified first, more complex ones later on. The reason is that the complex units usually
imply the simpler ones, for example, <CODE>\N</CODE> implies <CODE>\mm</CODE> because 1 <CODE>\N</CODE> equals
1 <CODE>kg m/s^2</CODE>.</P>
<DT><B>eqchain = true|false</B><DD>
<P>Omit the left hand side in chains of equations, in cases where only
the rhs changed from one line to the next.</P>
<DT><B>eqraw = true|false</B><DD>
<P>Raw formatting of <CODE>\eq</CODE> statements means that
the equations are printed exactly as you typed them in. This of course only works until
you manipulate the equation with <CODE>\eqadd</CODE> etc. The other options is to have EQC format
your equations.</P>
<DT><B>eqparse = true|false</B><DD>
<P>Turns of some pretty-printing features that make the LaTeX output of EQC
difficult to re-parse. For example, cos^2(x) is printed as (cos(x))^2.</P>
<DT><B>eqalign = type</B><DD>
<P>Change the LaTeX alignment type of an equation. Values
for <CODE>type</CODE> are 'onlyleft' (alignment will be <CODE>&amp;=</CODE>, for ams math), 'both' (<CODE>&amp;=&amp;</CODE>, for eqnarray environment), 'none'.
If no alignment type is specified, EQC automatically formats depending on the environment.</P>
<DT><B>eqsplit = exp</B><DD>
<P>Split the equation after the nth operand. The count starts at the left hand side of
the equation. Operands are those parts of the equation that are separated either by addition/subtraction or multiplication symbols.
At the given position, <CODE>\\\notag</CODE> or <CODE>\\\nonumber</CODE> are printed, depending on
the environment</P>
<DT><B>eqsplittext = string </B><DD>
<P>The text to interject after the split (in quotes <CODE>""</CODE>). By default,
this tries to align the second part of the equation to the right of the equals sign.</P>
<DT><B>difftype = string</B><DD>
<P>Set the format for displaying derivatives. Possible values are <CODE>dfdt</CODE> for <CODE>df/dx</CODE> display
(this is also the default), <CODE>dot</CODE> to display one or two dots for the first and second derivative (usually used only for
derivatives respective to the time <CODE>t</CODE>, and <CODE>line</CODE> to display apostrophes (e.g. <CODE>f''(x)</CODE>).</P>
<DT><B>path = string</B><DD>
<P>Set the path for the EQC-specific data files (default
<CODE>"/usr/share/texmf/tex/latex/eqc/"</CODE> on Unix systems). </P>
<DT><B>lang = "english"|"german"</B><DD>
<P>Changes the language which EQC expects the input file to use. At the moment,
this only has an effect on parsing floating point numbers, i.e., the decimal separator is set to ',' for
<CODE>"german"</CODE> and to '.' for <CODE>"english"</CODE> or any other language.</P>
</DL>
</P>
<H3>Other EQC options</H3>
<P>Further key-value pairs to <CODE>\eqcoptions</CODE> are:
<DL>
<DT><B>vecautosize = integer</B><DD>
<P>Specifies the size of a vector when no step count is given (i.e., the count is zero,
<CODE>x = 10:20:0</CODE>. In this case, the vector will have the number of elements as given with this option (default 20).</P>
</DL>
</P>
<H3>Miscellaneous</H3>
<P>
<DL>
<DT><B>\clearequations</B><DD>
<P>Clears the list of equations and variables. Constants are not cleared.
Functions are cleared except for those declared in the file mathconstants.tex.</P>
<DT><B>\input filename</B><DD>
<P>Includes the specified file. There is no difference to the Latex <CODE>\include</CODE>
command. All include files are written to one output .eqc file. The extension .tex need not be given.</P>
<DT><B>\dumpeq</B><DD>
<P>Write a list of all equations known to the compiler into the output file. The
list is sorted by variable name (for assignments) and includes the equation label and number.
This list is very useful in larger projects where it is difficult to remember the label of a specific
equation and where it was defined. Note: This command requires AMS maths to be loaded and sets
<CODE>allowdisplaybreaks[1]</CODE>!</P>
<DT><B>\usepackage[language]{eqc}</B><DD>
<P>This command must be used in the Latex preamble to include some
EQC-specific commands. For the meaning of the <CODE>language</CODE> parameter, see <CODE>\eqlang</CODE>.</P>
</DL>
</P>
<H2><A NAME="ss4.3">4.3</A> <A HREF="eqc.html#toc4.3">Keywords inside equations</A>
</H2>
<P>EQC does not parse all of the possible Latex mathematical keywords. The following keywords and tokens are recognized:</P>
<P>
<DL>
<DT><B>Basic mathematics</B><DD>
<P>Apart from the basic addition, subtraction, multiplication and division symbols, EQC interprets the
'^' and '_' symbols in the same way as Latex does. Note that the '*' multiplication symbol may be omitted,
just as in Latex.</P>
<DT><B>Mathematical functions</B><DD>
<P>The functions listed below are recognized. All of these are defined in the
file mathconstants.tex, which needs to be included. Further functions may be defined at
runtime with the <CODE>\function</CODE> and <CODE>\deffunc</CODE> keywords.
<UL>
<LI>\arccos Arcus cosine.</LI>
<LI>\arcosh Hyperbolic arcus cosine.</LI>
<LI>\arcsin Arcus sine.</LI>
<LI>\arsinh Hyperbolic arcus sine.</LI>
<LI>\arctan Arcus tangens</LI>
<LI>\artanh Hyperbolic arcus tangens.</LI>
<LI>\cos Cosine.</LI>
<LI>\cosh Hyperbolic cosine.</LI>
<LI>\cot Cotangens</LI>
<LI>\coth Hyperbolic cotangens</LI>
<LI>\csc Cosecans</LI>
<LI>\cubic Cubic function (x^3)</LI>
<LI>\exp Exponential function (e^x).</LI>
<LI>\ln Natural logarithm.</LI>
<LI>\log Decimal logarithm</LI>
<LI>\sec Secans</LI>
<LI>\sin Sine.</LI>
<LI>\sinh Hyperbolic sine.</LI>
<LI>\square Square function (x^2)</LI>
<LI>\sqrt Square root</LI>
<LI>\tan Tangens.</LI>
<LI>\tanh Hyperbolic tangens.</LI>
<LI>! Factorial function</LI>
</UL>
</P>
<DT><B>Brackets</B><DD>
<P>All the standard Latex brackets are recognized: <CODE>{, \lbrace, (, [, \lbrack, \lfloor, \lceil, \langle</CODE> and
of course the corresponding right brackets. The brackets may be modified in their size by <CODE>\left, \bigl,
\Bigl, \biggl, \Biggl</CODE> and <CODE>\right</CODE> etc. EQC checks for bracket mismatches and issues a warning. Note
that EQC does not preserve your bracket types, but creates its own brackets and bracket sizes in the Latex output.</P>
<DT><B>Division</B><DD>
<P>The Latex keywords <CODE>\over</CODE> and <CODE>\frac</CODE> are recognized.</P>
<DT><B>Access to equations</B><DD>
<P>Equations may be accessed using the <CODE>\lhs</CODE> and <CODE>\rhs</CODE> keywords. This will provide
the left hand side resp. the left hand side of the equation. An equation label may be given
instead of an equation.</P>
<DT><B>Variable evaluation</B><DD>
<P>Variable evaluation with the keywords <CODE>\val</CODE>, <CODE>quantity</CODE>, <CODE>\numval</CODE> and <CODE>\units</CODE>
can take place inside equations. For details on how this works, see the corresponding keywords in the
description above.
Constants
EQC has the following built-in constants:
<UL>
<LI>\pi 3.14159...</LI>
<LI>\e 2.71828...</LI>
<LI>\Euler 0.57721...</LI>
</UL>
<DT><B>Numbers</B><DD>
EQC recognizes integers and floating point numbers. The latter may not be in scientific notation as of yet.
Whether the decimal separator is a comma or a dot is determined by the <CODE>\eqlang</CODE> keyword, or by
the language parameter to <CODE>\usepackage[language}{eqc}</CODE>.
<DT><B>Vectors</B><DD>
A vector can be created with the syntax <CODE>begin:end:step</CODE>. For example, <CODE>x = 1:3:1</CODE>
will create a vector with three rows, containing the number 1, 2 and 3.
<DT><B>Integrals</B><DD>
A symbolic integral can be created with the syntax <CODE>\integral(x=a; b; f(x))</CODE> where x is the integration
variable, a the lower and b the upper bound, and f a function in the integration variable. Note that if f(x) does
not explicitly mention x, then the result will not be what you expected.
<DT><B>Variables</B><DD>
Any letter that is not part of a keyword is assumed to be a variable. Variable names are registered
automatically on their first appearance. Any occurence of the same letter is taken to mean the same variable,
until a <CODE>\clearequations</CODE> command is read. Any Latex macros that are not known to EQC are also
interpreted as variable names, e.g., <CODE>\phi</CODE>.
<DT><B>Physical units</B><DD>
Physical units are identified by their Latex macro name, e.g., <CODE>\mm</CODE>. Any units other than the
base SI units need to be defined with <CODE>\defunit</CODE> (include the file <CODE>units.tex</CODE> to get
the most common physical unit definitions).
<DT><B>Percentages</B><DD>
To express percentages in an equation, use the <CODE>\percent</CODE> keyword.</P>
</DL>
</P>
<H2><A NAME="ss4.4">4.4</A> <A HREF="eqc.html#toc4.4">Command line arguments</A>
</H2>
<P>
<DL>
<DT><B>-d --debug LEVEL</B><DD>
<P>Produce debugging and informational output at level LEVEL</P>
<DT><B>-p --path PATH</B><DD>
<P>Path to EQC specific files (eqc.sty etc.)</P>
<DT><B>-v --verbose</B><DD>
<P>Produce verbose output (same as -d1)</P>
<DT><B>-q --quiet</B><DD>
<P>Don't produce any output (same as -d-1)</P>
<DT><B>-s --silent</B><DD>
<P>Don't produce any output (same as -d-1)</P>
<DT><B>-V --version</B><DD>
<P>Print program version</P>
<DT><B>-? --help --usage</B><DD>
<P>Produce informational output</P>
</DL>
Note that as of version 1.2.0, command line arguments are not yet supported on Windows.</P>
<HR>
<A HREF="eqc-5.html">Next</A>
<A HREF="eqc-3.html">Previous</A>
<A HREF="eqc.html#toc4">Contents</A>
</BODY>
</HTML>