# New Scientific Features in 2012

Contents

The goal of this page is to summarize the new scientific features of Scilab and its environment during the year 2012.

In brief, the following is a list of the new or updated scientific features in 2012 :

- 6th of March 2012: libsvm, v1.2.2
- 27th of March 2012: SciFreeFEM v1.2
- 4th of May 2012 : Mathieu functions v3.0.2 (Update)
- 22nd of May 2012 : Nan toolbox v1.3.2 (Update)

## 6th of March 2012: libsvm, v1.2.2

The libsvm toolbox provides a simple interface to LIBSVM, a library for support vector machines (http://www.csie.ntu.edu.tw/~cjlin/libsvm). It is very easy to use as the usage and the way of specifying parameters are the same as that of LIBSVM.

This tool provides also a simple interface to LIBLINEAR, a library for large-scale regularized linear classification (http://www.csie.ntu.edu.tw/~cjlin/liblinear). It is very easy to use as the usage and the way of specifying parameters are the same as that of LIBLINEAR.

The libsvm v1.2.2 toolbox is an update of the libsvm v1.0 toolbox, first distributed at 7th of November 2011.

This interface was initially written by Jun-Cheng Chen, Kuan-Jen Peng, Chih-Yuan Yang and Chih-Huai Cheng from Department of Computer Science, National Taiwan University.

It was converted to Scilab 5.3 by Holger Nahrstaedt from TU Berlin.

This Toolbox is compatible with the NaN-toolbox.

The libsvm toolbox provides the following functions :

- libsvmread — reads files in LIBSVM format
- libsvmwrite — writes sparse matrix to a file in LIBSVM format
- predict — Does prediction for a calculated svm model
- svmconfmat — Confusion matrix for classification algorithms.
- svmgrid — parameter selection tool for C-SVM classification using the RBF (radial basis function) kernel
- svmgridlinear — parameter selection tool for linear classification
- svmnormalize — scale the input data for correct learning
- svmpartest — This function calculate the performance, based on Bayes theorem, of a
- svmpredict — Does prediction for a calculated svm model
- svmrocplot — plotroc draws the recevier operating characteristic(ROC) curve for an svm-model
- svmscale — scale the input data for correct learning
- svmtoy — shows the two-class classification boundary of the 2-D data
- svmtrain — trains a svm model
- train — trains a linear model

The libsvm toolbox is provided under the BSD license.

The toolbox provides the following demos :

- scaling_demo : train_demo.sce
- linear_demo : linear_demo.sce
- rbf_demo 1 : rbf_demo1.sce
- rbf_demo 2 : rbf_demo2.sce
- rbf_demo 3 : rbf_demo3.sce
- three class demo : three_class_demo.sce
- perfomance_demo : performance_demo.sce
- liblinear_perfomance_demo : liblinear_performance_demo.sce
- svm fitting demo : svm_fitting_demo.sce
- linear weight demo : linear_weight_demo.sce
- svmtoy demo : svmtoy_demo.sce
- outlier_detection : outlier_detection.sce

The libsvm toolbox is provided on ATOMS :

http://atoms.scilab.org/toolboxes/libsvm

and is developped on Scilab's Forge :

http://forge.scilab.org/index.php/p/libsvm/

To install this toolbox, we type :

atomsInstall('libsvm')

and restart Scilab.

The "linear_demo" produces the following graphics.

## 27th of March 2012: SciFreeFEM v1.2

Freefem is a user friendly software, written D. Bernardi, F. Hecht, K Ohtsuka, O. Pironneau, for solving systems of Partial Differential Equations (PDEs) in two dimensions. It was released in 1995 by the same authors together with C. Prud'homme and P. Parole as a followup of MacFEM. The current version is freefem 3.0. It is based on a finite element solver, mesh adaption was introduced later in the software after completion by M. Castro's thesis.

This version of FreeFEM is an old version, dedicated to 2D problems.

The FreeFEM toolbox for Scilab was written by Emmanuel Geay and updated by Y. Collette for Scilab 5.

The source code of the toolbox is available at :

http://code.google.com/p/scilab-mip/source/browse/#svn%2Ftrunk%2FSciFreefem

SciFreeFEM is available on ATOMS:

http://atoms.scilab.org/toolboxes/SciFreeFEM

The SciFreeFEM toolbox is provided under the CeCILL license.

To install it, we just type

atomsInstall("SciFreeFEM")

and restart Scilab.

The SciFreeFEM toolbox provides the following functions :

- defvar — define a freefem formal variable in Scilab environment
derive — FreeFem expression of the partial derivative of an expression

div — compute FreeFem formal expression of the divergence

ff_adaptmesh — build and send an adaptmesh instruction to FreeFem

ff_var — assign a value to a FreeFem variable

grad — compute FreeFem formal expression of the gradient

laplace — compute FreeFem formal expression of the laplacian

pde_varsol — form FreeFem syntax defining a variational PDE problem

- resultvisu — displays the PDE solution in pseudo color
rot — compute FreeFem formal expression of the rotational

tr — compute FreeFem formal expression of the trace

- valf — evaluate an expression

The demos/ffi_ex1.sce script, provided with the toolbox, is a demo of SciFreeFEM.

// Standard formulation problem, Equations are described in FreeFeem language. // User can enable / disable graphics by setting Graphics variable to %t or %f if ~exists('Graphics') then Graphics = %t; end if Graphics then xset('wdim',700,700); xset('colormap',hotcolormap(254)); end // Definition of the border bord = tlist(['border';'a';'b';'c';'d';'e';'f'],... list('x = t; y = 0',0,1,6,1),... list('x = 1; y = t',0,0.5,4, 1),... list('x = 1 - t; y = 0.5',0,0.5,4,1),... list('x = 0.5; y = t',0.5,1,4,1),... list('x = 1 - t; y = 1',0.5,1,4,1),... list('x = 0; y = 1 - t',0,1,6,1)); buildMesh(bord,'th'); // Mesh building [noeul,trianl] = getffResult(); // Get mesh description in Scilab erreur = 0.1; coef = 0.1^(1./5.); // Error level will be divided by 10 every 5 iterations. for i=1:4; // Define and solve the problem ff_problem('solve(u) {pde(u) laplace(u) = 1; on(a,b,c,d,e,f) u = 0;};',1); // Get the result as a Scilab variable [tFunc] = getffResult('u'); // Get the matrix of the linear problem [Mat,jlow,jhigh,SizeBloc] = getMatrix(); // Show the mesh if Graphics then clf(); xsetech([0,0,1,0.5]); meshvisu(); // Show the result xsetech([0,0.5,1,0.5]); resultvisu(noeul,trianl,tFunc); end if messagebox('Adapt mesh','Information','question',['Yes','No'],'modal')==2 then break,end erreur = erreur*coef; // Adapt error coefficient // Adapt mesh ff_adaptmesh('mesh th = adaptmesh (th,u)',verbosity = 5,... abserror = 1, nbjacoby = 2, err = erreur, nbvx = 5000, ... omega = 1.8 ,ratio = 1.8, nbsmooth = 3, splitpbedge = 1, ... maxsubdiv = 5, rescaling = 1); if (i < 4) then [noeul,trianl] = getffResult(); // Get the new mesh end end ff_problem('solve(u) {pde(u) laplace(u) = 1; on(a,b,c,d,e,f) u=0;};'); // Get mesh named 'th' and result in Scilab environment [noeul,trianl,tFunc] = getffResult('th,u'); if Graphics then clf(); xsetech([0,0,0.5,0.5]); meshvisu(100); // Show mesh xsetech([0.5,0,0.5,0.5]); meshvisu(160,[0.4 0.4 0.55 0.55]); xsetech([0,0.5,1,0.5]); resultvisu(noeul,trianl,tFunc); end ff_end(); // Destroy Fem interpretor

The previous script produces the following output.