The computer algebra system
asir
can use servers, which support the OpenXM protocols
(Open message eXchange for Mathematics, http://www.openxm.org),
as components.
The interface functions to call these servers
are loaded by loading the file `OpenXM/rc/asirrc'.
This file is automatically loaded in "Risa/Asir(OpenXM distribution)",
which we call OpenXM/Risa/Asir in this document.
This document explains these interface functions for asir
and several mathematical and utility functions
written in the user languages of Risa/Asir.
These mathematical and utilitiy functions are outcome
of the Asir-contrib project.
As to technical details on the OpenXM protocols,
see `openxm-en.tex' at
`$(OpenXM_HOME)/doc/OpenXM-specs'.
Enjoy mathematics on your computer.
List of contributors:
See OpenXM/Copyright for the copyright notice.
With loading `OpenXM/rc/asirrc', we can use most functions
in Asir/Contrib.
The OpenXM/Risa/Asir reads this file, which is specified by
the ASIR_CONFIG environmental variable, when it starts.
The file `names.rr' is the top level file of the Asir/Contrib.
Most other files are loaded from `names.rr'.
Some packages are not loaded from `names.rr' and they must be
loaded individually.
A sample of `asirrc' to use Asir/Contrib.
load("gr")$
load("primdec")$
load("katsura")$
load("bfct")$
load("names.rr")$
load("oxrfc103.rr")$
User_asirrc=which(getenv("HOME")+"/.asirrc")$
if (type(User_asirrc)!=0) {
if (!ctrl("quiet_mode")) print("Loading ~/.asirrc")$
load(User_asirrc)$
}else{ }$
end$
Not yet written.
Not yet written.
A part of Asir-contrib works on Windows. The following functions and components work on windows; the outer component sm1 and functions in asir-contrib which do not call outer components. In the cygwin environement, the outer components sm1, phc work. The other outer components do not work.
The following functions do not work on Windows. Some of them work in the cygwin environment of Windows.
gnuplot.*
om.*
mathematica.*
phc.*
print_dvi_form
print_gif_form
print_open_math_xml_form
print_png_form
print_xdvi_form
print_xv_form
tigers_xv_form
base_cancelExample:
base_cancel([(x-1)/(x^2-1), (x-1)/(x^3-1)]);
base_chooseExample:
base_choose([1,2,3],2);
base_flattenExample:
base_flatten([[1,2,3],4]);
base_intersectionExample:
base_intersection([1,2,3],[2,3,5,[6,5]]);
base_memberqExample:
base_memberq(2,[1,2,3]);
base_permutationExample:
base_permutation([1,2,3,4]);
base_positionExample:
base_position("cat",["dog","cat","monkey"]);
base_pruneExample:
base_prune("cat",["dog","cat","monkey"]);
base_replaceExample:
base_replace(x^2+y^2,[[x,a+1],[y,b]]);
x is replaced by a+1 and y is replaced by b in x^2+y^2.
base_replace_nExample:
base_replace_n(x^2+y^2,[[x,1/2],[y,2.0+3*@i]]);
x is replaced by 1/2 and y is replaced by 2.0+3*@i in x^2+y^2.
base_set_minusExample:
base_set_minus([1,2,3],[3,4,5]);
base_set_unionExample:
base_set_union([1,2,3],[3,4,5]);
base_subsetqExample:
base_subsetq([1,2],[1,2,3,4,5]);
base_subsets_of_sizeExample:
base_subsets_of_size(2,[3,5,3,2]);
number_absExample:
number_abs(-3);@end example
number_ceiling
Example:
number_abs(1.5);@end example
number_factor
Example:
number_factor(20);@end example
number_floor
Example:
number_floor(1.5);@end example
number_imaginary_part
Example:
number_imaginary_part(1+2*@i);@end example
number_is_integer
Example:
number_is_integer(2/3);@end example
number_real_part
Example:
number_real_part(1+2*@i);@end exampleCalculus (Standard Mathematical Functions)
Series (Standard Mathematical Functions)
Special Functions (Standard Mathematical Functions)
Not yet written
Matrix (Standard Mathematical Functions)
matrix_cloneExample:
matrix_clone(matrix_list_to_matrix([[1,1],[0,1]]));
matrix_detExample:
poly_factor(matrix_det([[1,x,x^2],[1,y,y^2],[1,z,z^2]]));
matrix_diagonal_matrixExample:
matrix_diagonal_matrix([1,2,3]);
References:
matrix_list_to_matrix
matrix_eigenavaluesExample:
matrix_eigenvalues([[x,1],[0,y]]);
matrix_identity_matrixExample:
matrix_identity_matrix(5);
References:
matrix_diagonal_matrix
matrix_imageExample:
matrix_image([[1,2,3],[2,4,6],[1,0,0]]);
References:
matrix_kernel
matrix_inner_productExample:
matrix_inner_product([1,2],[x,y]);
matrix_inverseExample:
matrix_inverse([[1,2],[0,1]]);
matrix_kernelExample:
matrix_kernel([[1,1,1,1],[0,1,3,4]]);
matrix_list_to_matrixExample:
print_xdvi_form(matrix_list_to_matrix([[1,1],[0,2]]));
References:
matrix_matrix_to_list
matrix_matrix_to_listReferences:
matrix_list_to_matrix
matrix_rankExample:
matrix_rank([[1,1,1,1],[0,1,3,4]]);
matrix_solve_linearExample:
matrix_solve_linear([[1,2],[0,1]],[x,y],[1,2]);
matrix_submatrixExample:
matrix_submatrix([[0,1],[2,3],[4,5]],[1,2]);
matrix_transposeReferences:
matrix_list_to_matrix
Not yet written.
print_dvi_formExample:
print_dvi_form(x^2-1);
References:
print_xdvi_form,print_tex_form
print_emExample:
print_em(x^2-1);
print_gif_formExample:
print_gif_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
References:
print_tex_form
print_input_formExample:
print_input_form(quote(x^3-1));
print_open_math_tfb_formDescription:
It is experimental. You need to load taka_print_tfb.rr to call it.
Example:
print_open_math_tfb_form(quote(f(x,1/(y+1))+2));
print_open_math_xml_formExample:
print_open_math_xml_form(x^3-1);
References:
www.openmath.org
print_outputExample:
print_output("Hello"|file="test.txt");
References:
glib_tops,(,)
print_ox_rfc100_xml_formExample:
print_ox_rfc100_xml_form(x^3-1);
References:
www.openxm.org
print_png_formExample:
print_png_form(x^3-1);
References:
print_tex_form
print_terminal_formprint_tex_formDescription:
The global variable Print_tex_form_fraction_format takes the values "auto", "frac", or "/". The global variable Print_tex_form_no_automatic_subscript takes the values 0 or 1. BUG; A large input S cannot be translated.
Example:
print_tex_form(x*dx+1 | table=[["dx","\\partial_x"]]);
The optional variable table is used to give a translation table of asir symbols and tex symbols.
References:
print_xdvi_form
print_tfb_formExample:
print_tfb_form(x+1);
print_xdvi_formExample 0:
print_xdvi_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
Example 1:
print_xdvi_form(print_tex_form(1/2));
References:
print_tex_form,print_dvi_form
print_xv_formExample 0:
print_xv_form(newmat(2,2,[[x^2,x],[y^2-1,x/(x-1)]]));
Example 1:
print_xv_form(x+y | format="png");
If the optional variable format="png" is set, png format will be used to generate an input for xv.
References:
print_tex_form,print_gif_form
poly_degreeDescription:
The weight is given by the optional variable weight w. It returns
Example:
poly_degree(x^2+y^2-4 |weight=[100,1],v=[x,y]);
poly_elimination_idealDescription:
If grobner_basis is "yes", I is assumed to be a Grobner basis. The optional variable v is a list of variables which defines the ring of polynomials.
Example 0:
poly_elimination_ideal([x^2+y^2-4,x*y-1],[x]);
Example 1:
A = poly_grobner_basis([x^2+y^2-4,x*y-1]|order=2,v=[y,x]);
poly_elimination_ideal(A,[x]|grobner_basis="yes");
References:
gr,hgr,gr_mod,dp_*
poly_expandReferences:
poly_sort
poly_factorExample:
poly_factor(x^10-y^10);
poly_gcdExample:
poly_gcd(x^10-y^10,x^25-y^25);
poly_grobner_basisDescription:
The optional variable v is a list of variables which defines the ring of polynomials.
Example:
A = poly_grobner_basis([x^2+y^2-4,x*y-1]|order=2,v=[y,x]);
poly_hilbert_polynomialDescription:
The optional variable v is a list of variables.
Example:
poly_hilbert_polynomial([x1*y1,x1*y2,x2*y1,x2*y2]|s=k,v=[x1,x2,y1,y2]);
poly_initialDescription:
The optional variable v is a list of variables. This function computes
Example:
poly_initial([x^2+y^2-4,x*y-1]|order=0,v=[x,y]);
poly_initial_coefficientsDescription:
The optional variable v is a list of variables. The order is specified by the optional variable order
Example:
poly_initial_coefficients([x^2+y^2-4,x*y-1]|order=0,v=[x,y]);
poly_initial_termDescription:
The weight is given by the optional variable weight w. It returns
Example:
poly_initial_term( x^2+y^2-4 |weight=[100,1],v=[x,y]);
poly_solve_linearExample:
poly_solve_linear([2*x+3*y-z-2, x+y+z-1], [x,y,z]);
poly_sortExample:
poly_sort((x-y-a)^3 | v=[x,y], w=[-1,-1])
returns a series expansion in terms of x and y.
The library glib provides a simple interface like old BASIC to the graphic primitive (draw_obj) of Risa/Asir.
glib_clearglib_flushglib_lineExample:
glib_line(0,0,5,3/2 | color=0xff00ff);
glib_line(0,0,10,0 | shape=arrow);
glib_openglib_plotExample 0:
glib_plot([[0,1],[0.1,0.9],[0.2,0.7],[0.3,0.5],[0.4,0.8]]);
Example 1:
glib_plot(tan(x));
glib_printExample:
glib_print(100,100,"Hello Worlds" | color=0xff0000);
glib_ps_formExample 0:
glib_ps_form(quote( glib_line(0,0,100,100) ));
Example 1:
glib_ps_form(quote([glib_line(0,0,100,100),glib_line(100,0,0,100)]));
References:
glib_tops
glib_putpixelExample:
glib_putpixel(1,2 | color=0xffff00);
glib_remove_lastglib_set_pixel_sizeglib_topsReferences:
print_output
glib_windowExample:
glib_window(-1,-1,10,10);
ox_check_errors2[219] P=sm1.start(); 0 [220] sm1.sm1(P," 0 get "); 0 [221] ox_check_errors2(P); [error([7,4294967295,executeString: Usage:get])] Error on the server of the process number = 1 To clean the stack of the ox server, type in ox_pops(P,N) (P: process number, N: the number of data you need to pop) out of the debug mode. If you like to automatically clean data on the server stack, set XM_debug=0;
OXshell is a system to execute system commands from ox servers. As to details, see the files OpenXM/src/kan96xx/Doc/oxshell.oxw and OpenXM/doc/Papers/rims-2003-12-16-ja.tex.
oxshell.get_valueExample:
oxshell.set_value("abc","Hello world!");
oxshell.oxshell(["cp", "stringIn://abc", "stringOut://result"]);
oxshell.get_value("result");
References:
oxshell.oxshell,oxshell.set_value
oxshell.oxshellExample:
oxshell.oxshell(["ls"]);
References:
ox_shell,oxshell.set_value,oxshell.get_value
oxshell.set_valueExample:
oxshell.set_value("abc","Hello world!");
oxshell.oxshell(["cat", "stringIn://abc"]);
References:
oxshell.oxshell,oxshell.get_value
Utility functions provide some usuful functions to access to the system and to process strings.
util_filterExample:
util_filter("sort","cat\ndog\ncentipede\n");
util_find_and_replaceutil_find_substrutil_indexExample:
util_index(x_2_3)
References:
util_v
util_load_file_as_a_stringutil_partutil_read_file_as_a_stringutil_remove_crutil_timingExample:
util_timing( quote( fctr(x^50-y^50) ));
util_vExample:
util_v("x",[1,3]);
References:
util_index
util_write_string_to_a_fileThis section introduces other manuals in the asir-contrib project.
This section also describes functions that have not yet been classifed. These will be moved to independent sections in a future.
../ok_diff-html/ok_diff-en.html
../ok_dmodule-html/ok_dmodule-en.html
../plucker-html/plucker-en.html
../gnuplot-html/gnuplot-en.html
../mathematica-html/mathematica-en.html
../mk_graph-html/mk_graph-en.html
../noro_mwl-html/noro_mwl-en.html
../nn_ndbf-html/nn_ndbf-en.html
todo_parametrize/todo_parametrize_toc
With loading the file todo_parametrize/todo_parametrize.rr
the function paramerize is installed.
The function finds a parametric expression of a given rational curve.
As to details, see
See section `' in A package for algebraic curves (in Japanese).
[1205] load("todo_parametrize/todo_parametrize.rr");
1
[1425] parametrize(y^2-x^3);
[155*t^2+20*t+1,720*t^4+1044*t^3+580*t^2,155*t^4+20*t^3+t^2,(-x)/(y)]
[1426] parametrize(y^2+x^3);
[-t,1,t^3,(-x)/(y)]
With loading the file taji_alc.rr
functions for algebraic local cohomology groups in one variable are imported.
import("taji_alc.rr");
taji_alc.laurent_expansion(x,(x-1)^3);
Links to manuals and papers related to files and commands in asir-contrib are at OpenXM documents.
Jump to: b - g - m - n - o - p - u
@vfill @eject
This document was generated on 13 February 2010 using texi2html 1.56k.