GetYacasPID | obtain Yacas process number |
ShowPS | view equations graphically |
MakeFunctionPlugin | compile numerical functions into plugins |
GnuPlot | plot functions of one variable |
Version | Show version of Yacas |
Vi | Edit a file or function |
GetYacasPID() |
Requires: a Unix shell.
ShowPS(expr) |
Requires: a Unix shell, latex, dvips, gv or another Postscript viewer.
In> [ PSViewCommand := "ghostview"; \ ShowPS(x+2*Sin(x)); ] Expression exported as /tmp/yacas-tmp file-28802.tex Out> True; |
MakeFunctionPlugin("name", body) |
body -- expression, function of arguments, must evaluate to a function of some variables.
Requires: a Unix shell, a compiler named c++ with ELF .so support, Yacas headers in FindFile("")/include; current directory must be writable.
The body expression must be a CForm()-exportable function of the arguments and may contain numerical constants. Pi is allowed and will be converted to floating-point.
All arguments and the return value of the function are assumed to be double precision real numbers. The result of passing a non-numerical argument will be an unevaluated expression.
Example: In> MakeFunctionPlugin("f1", {x,y}, Sin(x/y)) Function f1(x,y) loaded from plugins.tmp/libf1_plugin_cc.so Out> True; In> f1(2,3) Out> 0.618369803069736989620253; In> f1(x,5) Out> f1(x,5); |
The function creates the following files in subdirectory plugins.tmp/ of current directory:
double f1_plugin_cc(double x, double y) { return sin(x/y); } |
After creating these files, MakeFunctionPlugin() will:
If you call MakeFunctionPlugin() repeatedly to define a function with the same name, old files will be overwritten and old libraries will be unloaded with DllUnload().
GnuPlot(x1, x2, numpoints, function) |
Most frequently encountered problem: function must evaluate to an expression that contains a variable. Test your function! If you have defined f(x) which only accepts a number but does not accept an undefined variable, GnuPlot() will fail to plot it. Use NFunction() to overcome this difficulty.
In> f(x) := Cos(( Abs(Pi/x))^1.5); Out> True; In> GnuPlot(-1, 1, 101, f(x) ); Out> True; |
In> MakeFunctionPlugin("f1", f(x)); Function f1(x) loaded from plugins.tmp /libf1_plugin_cc.so Out> True; In> GnuPlot(-1, 1, 10001, f1(x)) Out> True; |
Version() |
In> Version() Out> "1.0.48rev3"; In> LessThan(Version(), "1.0.47") Out> False; In> GreaterThan(Version(), "1.0.47") Out> True; |
The last two calls show that the LessThan and GreaterThan functions can be used for comparing version numbers. This method is only guaranteed, however, if the version is always expressed in the form d.d.dd as above.
Vi(filename); Vi(functionname); |
functionname - name of a function to find for editing
It finds the function by scanning the *.def files that have been reported to the system (using the function FindFunction). If editing a function, the command will jump directly to the first occurrence of the name of the function in the file (usually the beginning of a definition of a function).
To be really useful, you need to go to the directory containing the original files, to edit the original files.
In> Vi("yacasinit.ys") Out> True; In> Vi("Sum") Out> True; |