WebMathematica-based tools for discrete-time nonlinear control systems

. The package NLControl, developed in the Institute of Cybernetics at Tallinn University of Technology within the Mathematica environment, has been made partially available over the internet using webMathematica tools. The package consists of functions that assist the solution of different modelling, analysis, and synthesis problems for nonlinear control systems, described either by state or by input-output equations. This paper focuses on describing the webMathematica-based tools for discrete-time nonlinear control systems.


INTRODUCTION
The most popular approach in nonlinear control theory is based on differential geometry (Nijmeijer and van der Schaft, 1990;Isidori, 1995).However, by the end of the 1980s its limits became known, meaning that geometric tools were not able to provide the most natural framework when studying problems like (dynamic) feedback linearization, realization, and inversion.The introduction of differential algebraic methods (Fliess, 1990) offered additional tools for investigating these and many other problems.Today, the algebraic point of view has gained popularity and the related approach based on the vector spaces of differential one-forms over suitable fields of nonlinear functions has been introduced (Conte et al., 2007).The tools based on differential one-forms and the related methods based on the theory of the skew polynomial rings are complementary to the differential geometric methods, but what is more important, these tools are characterized by their inherent simplicity and strong similarity to their linear counterparts.The latter makes these tools a better choice in teaching engineering courses in nonlinear control and in practical applications.
Since the solutions of nonlinear control problems require a huge amount of symbolic computations, additional assistance is provided by the nonlinear control system software package NLControl (Kotta and Tõnso, 1999;Kotta and Tõnso, 2003), developed in the Institute of Cybernetics at Tallinn University of Technology.The package is based on algebraic methods of differential one-forms and skew polynomials, and is developed within the (symbolic) software system Mathematica.This package provides basic tools for modelling, analysis, and synthesis both for discrete-and continuous-time nonlinear systems.The reason for developing our own package is that nonlinear control systems, unlike their linear counterparts, practically miss the support of professional software products.For example, both the Matlab Control System Toolbox and Mathematica Control System Professional Suite are applicable only to linear systems.Some custommade packages based on symbolic computations for nonlinear control systems have been developed but their distribution is extremely limited and none of them implements the methods based on algebraic tools (see, for example, de Jager, 1995;Rothfuß and Zeitz, 1997;Rodrigues-Millan, 2001;Kaddouri et al., 2006).
The functions from the package NLControl cannot be used outside the Mathematica environment.The main purpose of this paper is to introduce and describe a webMathematica-based application developed by us, which allows the most important functions from NLControl to be made available via the world-wideweb, in such a way that no other software except for an internet browser needs to be installed in a computer to use these tools.This allows these tools to be applied in graduate courses as well as making them available to a wider control community and to engineers.The other web-based tool for a nonlinear control system is described by Ondera and Huba (2006).The authors are not aware of any other web implementations related to symbolic methods for nonlinear control systems.However, there exist numerous applications of webMathematica in control education (see, for example, Kujan et al., 2005), but practically all these tools are dedicated to linear systems.The second purpose of the paper is to compare our tools with those described by Ondera and Huba (2006).Because of space limitations, in this paper we focus only on the discrete-time case.Differences between continuous-and discrete-time cases are only briefly commented upon at the end of the paper.
The paper is organized as follows.Section 2 gives a short overview of the algebraic approach based on differential forms.Section 3 gives an overview of those aspects of webMathematica necessary for our application, including technical details about webMathematica server technology.Section 4 describes functions, implemented in our webMathematica website together with numerous examples.Section 5 presents a brief description of the NLControl package and the structure of the website.Additionally, in Section 5, we make a comparison with the other web-based tools for nonlinear control systems and comment briefly upon the specifics as well as differences of the continuous-time case from the discrete-time case.The next section concludes the paper and after that we have an Appendix, containing source code examples with explanations.

ALGEBRAIC TOOLS BASED ON DIFFERENTIAL FORMS
Nonlinear control systems can be, in general, described in many different ways.In this paper we consider three of them: state equations, input-output (i/o) equations, and polynomial representation.First, the system can be described by the state equations where Alternatively, the control system may be described by the set of higher-order i/o difference equations relating the inputs u j , j = 1 . . ., m, the outputs y i , i = 1, . . ., p, and a finite number of their forward time shifts, where ϕ = [ϕ 1 , ..., ϕ p ] T is a real analytic function, s ik , n is , and n i are the integer-valued structural parameters of the system, satisfying the conditions s ik < n i , n is < min(n i , n s ), and n 1 + ... + n p = n.To use the algebraic tools based on differential forms, as well as the Mathematica functions in the package NLControl, the submersivity assumption has to be satisfied for discrete-time systems; see Assumptions 1 and 2 below, for systems described by equations ( 1) and (2), respectively.
Assumption 1: System (1) is submersive if the function f satisfies generically (i.e.everywhere except on a set of measure zero) the condition Assumption 2: System (2) is submersive if the function ϕ satisfies generically the condition Below we will give a short overview of the algebraic approach based on differential one-forms.We will use the notations from Aranda-Bricaire et al. (1996).One can associate with system (1) the field K of meromorphic functions in a finite number of independent system variables {x(0), u(t),t ≥ 0}.The forwardshift operator δ : (Aranda-Bricaire et al., 1996), and up to an isomorphism, there exists a unique difference field (K * , δ * ), called the inversive closure of (K , δ ), such that K ⊂ K * , δ * : K * → K * is an automorphism and the restriction of δ * to K equals δ .Aranda-Bricaire et al. (1996) give an explicit construction of (K * , δ * ).In what follows we use the same symbol for K and K * .Sometimes the abridged notation ϕ + (•) = δ ϕ(•) for ϕ ∈ K is used.
Over the field K one can define a vector space E := span K {dϕ | ϕ ∈ K } spanned by the differentials of the elements of K .The elements of E are called differential one-forms.The forward-shift operator δ : K → K induces a forward-shift operator δ : E → E by where ∧ denotes the wedge product.The subspace of one-forms in E is called completely integrable if it admits the basis which consists only of closed one-forms.The relative degree r of a one-form ω in X := span K {dx} is defined by r = min{k ∈ IN | ω(k) ⊂ X }.The relative degree is the number of times one has to apply the forward-shift operator to make the one-form explicitly dependent on the input.
The difference field K and the shift operator δ induce a ring of left polynomials in the shift operator δ , denoted by K [δ ] (Kotta and Tõnso, 2004).A left polynomial p(δ ) ∈ K [δ ] is written as where a i ∈ K , for 0 ≤ i ≤ k.Each polynomial p(δ ) ∈ K [δ ] is a mapping of E into itself.An element a ∈ K does not commute with the shift operator δ , i.e. a • δ = δ • a.Since the multiplication of δ and an element a ∈ K is not commutative and can be defined by the following rule the ring K [δ ] thus defined is a non-commutative skew polynomial ring and is proved to be a (left) Ore ring.That is, the polynomials from K [δ ] satisfy the left Ore condition: for all non-zero a, b Input-output equations (2) may be alternatively represented as (Kotta and Tõnso, 2004) where P(δ ) and Q(δ ) are p × p and p × m-dimensional matrices, respectively, whose elements p i j , q i j ∈ K [δ ]: and dy(t) = [dy 1 (t), . . ., dy p (t)] T , du(t) = [du 1 (t), . . ., du m (t)] T .Equation ( 4) is obtained from (2) by applying the differential operation to it and using the notations dy s (t + j) = δ j dy s (t), du k (t + r) = δ r du k (t).

WEBMATHEMATICA
In this section we will give a short overview of webMathematica technology (see Wolfram Research, Inc., webMathematica documentation; http://documents.wolfram.com/webmathematica)and features related to our website.In the webMathematica server the Mathematica kernel is running, which is taking requests inserted by users from the webpage, calculating the results and sending them back to the webpage.Our website (or user interface) uses standard web graphical user interface elements, such as text fields and check boxes.WebMathematica allows a site to deliver HTML pages to which Mathematica commands have been added, and uses the request/response standard, followed by web servers.In our website request is entered into text fields and response can be in HTML, image or Mathematica notebook form.The request/response process is the following: 1.The browser sends a request to the webMathematica server.The request includes variables and their symbolic values entered from the webpage.2. The webMathematica's kernel manager acquires the Mathematica kernel.Variables and symbolic values are sent to this kernel.3. The Mathematica kernel is initialized with input (request) parameters, it carries out the calculations, and returns the result to the server.4. The response is sent to the browser.5.The webMathematica server returns the result to the browser.
Requests are sent to the server with webMathematica webpages that are based on two standard Java technologies: Java Servlet and JavaServer Pages (JSP).Servlets are special Java programs that run in a Java-enabled web server, which is typically called a 'servlet container'.JavaServer Pages use a special library of tags that work with Mathematica.This library of tags is called the MSP Taglib.In our site we use also JavaScript and Java.We use JavaScript for opening and closing windows and communicating between windows and Java for calculating random inputs to generate examples.
There are many different combinations of hardware and operating systems that support webMathematica components.Before one starts to install webMathematica, one has to install Java and a servlet container.We are using the Linux operating system and Tomcat as a web container.

IMPLEMENTED FUNCTIONS
To date, we have implemented 13 different functions for discrete-time nonlinear control systems from the NLControl package into the webMathematica website.There are seven pages for systems described by state equations and six pages for systems described by i/o equations.Most of the chosen functions are based on subspaces H k (Aranda-Bricaire et al., 1996;Kotta et al., 2001) and solve different modelling, analysis, and synthesis problems.
Note that the tools of NLControl are not designed for approximate calculations.Therefore, all real (floating-point) numbers are transformed into rational numbers.Before printing the result, the rational numbers are transformed back to real numbers (keeping the accuracy of the input) for a better overview.The user interface is interconnected with the help system, which provides a detailed explanation describing the applied methods behind the functions together with numerous typical examples.
User input data (i.e.system equations, input, output, and state variables) validation has been implemented in the user interface.The result of the function (together with the applied equations) can be given either in an HTML table, gif picture or pure Mathematica output form.
The implemented functions can be divided into several subgroups.First, there are assistant functions that do not solve any control problems.They either check submersivity assumption (Submersivity) or perform the basic operations with Ore polynomials (OrePolynomials) or compute the sequence of H k subspaces in two different ways (SequenceHk and SequenceHOre), which is a necessary building block of the majority of other functions.The functions of the second group perform the transformations between different system descriptions (Realization, ClassicStateToIO, IOToPolynomials, Reduction and NormalForm).The functions of the third group check the system properties (Accessibility and ObservabilityFiltration).Finally, the last group consists by now of only one function FeedbackLinearization.

Assistant functions
Some of the assistant functions have been made available on the website to allow deeper study of the control system.Access to assistant functions may be useful if the primary function, supposed to solve a control problem, fails for some reason.Assistant functions allow one to inquire the reasons for failure and sometimes even to solve the problem.
Submersivity.The function Submersivity has to return True for the other functions to be applicable.The function Submersivity returns True if equation ( 1) satisfies Assumption 1.If the result is False, then the other Mathematica functions cannot be used, since they may yield wrong results.The typical problems one may encounter in case of non-submersive systems are discussed in Aranda-Bricaire and Kotta (2004).However, note that the submersivity assumption is not restrictive, since it is always satisfied for accessible (controllable) systems.
For checking the Submersivity assumption the system has to be given in the state space form with the list of state and input variables.At the moment, there does not exist any submersivity assumption test for i/o systems of the form (2).
Example 1.Consider the bioreactor model, where cells are being grown through the consumption of a substrate (Kazantzis and Kravaris, 2001): Submersivity returns True, meaning that the system is submersive.
Ore polynomials.In order to implement functions based on the polynomial methods, for example Reduction and SequenceHOre, one needs basic tools for working with Ore polynomials (Ore, 1933).In Mathematica, unlike Maple, there are no built-in packages dedicated to Ore polynomials.An important point to emphasize is that the basic operations with Ore polynomials have to be performed modulo system equations (2).Whenever the expression y i (t + n i ) appears in computations, it should always be replaced by ϕ i (•) from equations (2).The higher-order time-shifts y i (t + α i ), α i > n i require repeated replacements, for example y i (t + n i + 1) should be at first substituted by δ ϕ i (•) and then each y i (t + n i ) in the result given by ϕ i (•).Variables at negative time-instances should be treated in a similar manner, considering that not all of them are independent variables.In order to find expressions for substituting dependent variables, at first one has to choose p variables from the list {u j (t), y i (t), j = 1, . . ., m}, i = 1, . . ., p such that Assumption 2 is satisfied for the chosen variables.Denote the selected variables by z i (t), i = 1, . . ., p and solve system (2) for z i (t).After applying the backward-shift operator to the solution the required number of times, it allows replacing variables z i (t), t < 0.
The function Ore polynomials operates with polynomials from the Ore ring and completes left and right division, finds left and right greatest common divisor, left and right common multiple, etc.
Example 2. Consider the polynomials A = δ 2 + u(t) and B = y(t + 1)δ + 3. Then the operation of left division A = B * Q + R returns the result: .
SequenceHk.The subspace H k (for k ≥ 0) contains the one-forms with a relative degree equal to at least k and is defined by Computing the sequence of subspaces H k is necessary for several purposes.First, we need this sequence for checking realizability property and for finding the classical state space realization of the i/o equation (Realization).Second, it is also necessary for checking if the system is accessible or not and in case it is not, to find the non-accessible subspace and decompose the system into accessible and non-accessible subsystems (Accessibility).Moreover, this sequence is necessary to check if the system is static state feedback linearizable and for finding the state coordinate transformation (FeedbackLinearization). Finally, this sequence is also necessary to check if the i/o equations are irreducible or not and if not, to find the reduced model (Reduction), and to transform the state equations into the so-called normal form (NormalForm).
The function SequenceHk computes the first N elements in the sequence of subspaces H k , associated either to state equations (1) or to i/o equations ( 2), where N is a positive integer, specified by the user.Example 3.This example demonstrates the advantage of the polynomial method for computing the sequence H k : The function SequenceHk returns It is possible to show, proceeding from the definition (5), that in case of the single-input single-output (SISO) system the number of basis one-forms decreases by 1 at every step.Since H 3 in the above example contains four basis one-forms, H 4 should contain three basis one-forms, instead of being {0}, as returned by the function SequenceHk.The error occurs since the algorithm used to compute the sequence H k requires the solution of a complicated system of nonlinear equations, containing square roots in the above case.Mathematica fails to solve the system, thus correct basis one-forms for H 4 cannot be found.Within NLControl the function SequenceHk in this case displays an error message.Unfortunately, the webMathematica version of this function does not display the error message yet.
In such cases an alternative algorithm, which does not require solving a system of equations, may be useful.The alternative algorithm is based on Ore polynomials and at present is available only for SISO systems.
SequenceHOre.In the SISO case, if the system is described by equation (4), i.e. by p(δ )dy(t) = q(δ )du(t), the subspaces H k can be computed directly from polynomials p(δ ) and q(δ ) in ( 7).The polynomial method allows computing only the first s + 2 elements of the sequence H k , which is exactly the number of elements the application of the function Realization requires.However, at the moment, the default method used by the function Realization is SequenceHk.The reason for this is that SequenceHk is applicable also in the multi-input multi-output (MIMO) case, unlike SequenceHOre.Our further goal is to make the use of the SequenceHOre method also available within Realization.This method is more direct and in the discrete-time case, also noticeably faster.
The Mathematica block sent to the server looks almost the same as in the case of SequenceHk.
Example 4. In the case of the previous example with the polynomial method the function SequenceHOre returns du(t + 1) .

Transformations between different system descriptions
In this subsection the functions allowing transformation of one system description into another are described.First, ClassicStateToIO finds i/o equations (2) from state equations (1).Second, the function Realization checks if i/o equations (2) can be transformed into the state space form, and finds the state equations, if possible.The function IOToPolynomials calculates the matrices P(δ ) and Q(δ ) in (4), given i/o equations (2).The function Reduction checks if the i/o equations (2) can be reduced and finds the minimal equivalent system description.Finally, the function NormalForm transforms the state equations into the so-called normal form, which is a key factor in applying the inversion-based control methods.
Reduction.The function Reduction determines whether the system described by i/o equations ( 2) is irreducible or not, and if not, finds the reduced set of i/o equations.A nonlinear control system described by equations ( 2) is irreducible iff the greatest common left divisor G L (δ ) of polynomial matrices P(δ ) and Q(δ ) in ( 4) is a unimodular matrix (i.e. a polynomial matrix with a polynomial inverse) (Kotta and Tõnso, 2004).In case of the non-unimodular G L (δ ), equation ( 4) may be rewritten as G L (δ )[ P(δ )dy(t) − Q(δ )du(t)] = 0 and the reduced system equations can be found by integrating the one-forms in the brackets, perhaps after multiplying by the integrating factors.
After 30 seconds the time-out notice is given.
Realization.The realization problem is to construct state equations (1) of the order n = n 1 + ... + n p from the set of i/o equations (2), if possible.Note that unlike in the linear case, the state-space realization does not exist for every nonlinear i/o model (2).The necessary and sufficient realizability conditions require that the subspaces H k , associated with i/o equation ( 2), for 1 ≤ k ≤ s + 2 are completely integrable.The state coordinates can be found by integrating the basis one-forms of H s+2 .
The function Realization determines whether i/o equations ( 2) can be transformed into the state-space form and in case of the positive answer finds the state equations.

The function IOToPolynomials returns
Normal form.Recall that H 2 is the subspace of the one-forms whose relative degrees are greater than or equal to two, which implies that their time-shifts do not depend on control.Integrability of H 2 is a necessary and sufficient condition for transforming equations (1) by state coordinate transformation into the so-called normal form (Kotta, 2000): where the dynamics of unobservable states η does not depend on control.Note that the state coordinates can be found by integrating the bases of one-forms of H 2 .
Classic state to IO.The function ClassicStateToIO finds i/o equations (2) from state equations (1).
Example 10.Consider the state equations The function ClassicStateToIO returns

Checking the system properties
In this subsection the functions Accessibility and ObservabilityFiltration are described that allow checking the accessibility (controllability) and observability properties of the system, respectively.
Accessibility.Accessibility is the structural property of the nonlinear system which in the linear case reduces to the controllability property.System (1) is said to be accessible if there does not exist any nonzero autonomous variable for (1) in K .Note that the autonomous variable of the system is a variable, not influenced by control, and therefore, cannot be changed by the controller.The necessary and sufficient condition for accessibility is H ∞ = {0} (Aranda-Bricaire et al., 1996).
Accessibility returns True if the nonlinear system is accessible and False otherwise.If the system is not accessible, it can be decomposed into accessible and non-accessible subsystems.Note that H ∞ is a non-accessible subspace, and because of its complete integrability, it has an integrable basis H ∞ = span K {dζ 1 , ..., dζ r } (Aranda-Bricaire et al., 1996).Since H ∞ is invariant under applying the forward shift operator, The accessible subspace X a := X /H ∞ such that X a ⊕ H ∞ = X has also an integrable basis span K {dζ r+1 , ..., dζ n }.Therefore, we have For applying the function Accessibility the system has to be given in the state space form.
Example 11.Consider a system Accessibility decomposition divides system (11) into a non-accessible subsystem and an accessible subsystem where Observability filtration.(Kotta, 2005) System ( 1) is said to be observable if where T .Define the difference vector spaces Y k , Y , and U for system (1) as follows: To define the observable subspace, introduce the sequence of subspaces, called the observability filtration where The subspace X ∩ (Y + U ) is called the observable space of system (1) and can be computed as the limit O ∞ of the observability filtration (13), O ∞ = X ∩ (Y + U ).The following statements are equivalent: (i) the system is observable, (ii) the condition ( 12) is satisfied, and (iii) O ∞ = X .In order to decompose system (1) into the observable and unobservable subsystems, O ∞ has to be integrable.Note that in the continuous-time case O ∞ is always integrable (Conte et al., 2007), but this is not necessarily true for discrete-time systems.If the observable space O ∞ is integrable, it admits an exact basis {dζ 1 , . . ., dζ r }.Complete the set {dζ 1 , . . ., dζ r } to a basis {dζ 1 , . . ., dζ r , dζ r+1 , . . ., dζ n } of X .Then, in the coordinates ζ , system (1) reads as Example 12. Consider the nonlinear control system To check whether the system is observable or not, the observability filtration can be computed: Note that O ∞ = O 2 = X , and therefore, the system is not observable.

Feedback linearization
System (1) is said to be static state feedback linearizable if there exist a state diffeomorphism and a regular static state feedback of the form such that in the new coordinates the compensated system equations are in the form xi1 (t + 1) = xi2 (t), . . .
For linearizability conditions we need to define an integer k * for the sequence H k .There exists an integer k * ≤ n such that, for 0 The necessary and sufficient conditions for feedback linearizability are 1.
Not every accessible system can be linearized by static state feedback.The function Linearization checks whether this is possible and in the case of an affirmative answer finds the state coordinate change, the feedback, and the linear closed-loop equations.
Example 13.Consider the discrete-time nonlinear control system given in Baheti et al. (1980): The function Linearization returns the feedback linearized equations together with the new state coordinates

About the NLControl package
This section gives a short overview of the NLControl package from the point of view of programming.
In order to keep the paper focused, only the part of the package available on the webMathematica site is described here.The NLControl package source code is divided into separate files (see Fig. 1).Using separate files requires division of the code into pieces of reasonable size, which gives a better overview of the package.It also simplifies cooperation between different programmers.When working with Mathematica, only the files which are required for computations will be loaded into memory.For instance, when the user starts the NLControl package and enters the task requiring computing the sequence H k for a discretetime system, only the files Core, Ore polynomials, and Sequences are loaded.When using NLControl via webMathematica, all package files have to be loaded at once due to technical restrictions.
In order to make computations in Mathematica with equations of the form (1), a special object has been created in the NLControl package -StateSpace [ f , Xt, Ut, t, h, Y t, Shift ].In this object f = { f 1 , f 2 , ...} is a list of state transition functions, Xt = {x 1 (t), x 2 (t), ...} is a list of state variables, Ut = {u 1 (t), u 2 (t), ...} is a list of input variables, t is time, h = {h 1 , h 2 , ...} is a list of output functions, Y t = {y 1 (t), y 2 (t), ...} is a list of output variables, and Shift indicates that one handles the discretetime system.Object IO[eqs, Ut, Y t, t, Shift ] is used for representing i/o equations (2).In above, eqs = {y 1 (t + n 1 ) == ϕ 1 , y 2 (t + n 2 ) == ϕ 2 , ...} is a list of equations where ϕ i comes from (2); Ut, Y t, and t are as above.As conventional for Mathematica, instead of the lists of input and output variables a single variable may be entered in case of the SISO system.However, StateSpace and IO always embrace the single variable with curly brackets.This guarantees that the SISO and MIMO systems have the same data structure and consequently, the same programs can handle them.Most of the assistant functions or low-level functions require separate programs for discrete-and continuous-time systems.The higher level functions (Linearization, Accessibility, Observability and transformations between different system descriptions) can share the same source code for discrete-and continuous-time systems.
Below we comment briefly on the NLControl package files, represented as blocks in Fig. 1.
Core The basic objects like StateSpace and IO are defined here.The file also contains functions for testing submersivity property and computing forward-and backward-shift operators on K and E .Quite a large part of the Core file occupies the code for printing objects StateSpace and IO in the traditional form.
Ore polynomials The object for Ore polynomial OreP[a k , . . ., a 0 ] is introduced here.The file also includes all functions to make operations with Ore polynomials.
Web contains additional formatting functions necessary to print the system equations and Ore polynomials on the website in the user-friendly form.
Sequences contains functions for computing the sequence H k .
Integration contains functions which allow checking integrability and integrating the system of oneforms.

Structure of the website
The NLControl website is a project under development; we are adding new functions and reorganizing old pages.The structure of the website is very simple.For every function there is one jsp file which allows entry of the input data using HTML forms and the other jsp file which shows the result generated by webMathematica.These two files are similar for all functions, with some modifications.The simplicity of the file structure is also its weakness, since it yields a large number of almost identical files.Moreover, if one has to make some minor changes, one may need to edit all these files.Our future aim is to reorganize the site in a more sophisticated way, such that it would be easier to administer, for example add new functions, update Mathematica code blocks or change the layout.

Comparison with other web-based tools
Besides the fact that the problems handled are different and the tools described by Ondera and Huba (2006) are dedicated solely to the exact static state feedback linearization problem in the continuous-time case, there are other points to be mentioned.As far as the linearization problem is concerned, the web-tools in Ondera and Huba (2006) allow more than our function Linearization, namely the user may additionally submit the desired closed-loop poles of a pole-placement controller and to perform a simulation of the resulting closed-loop system.
There is also a difference in the chosen technology.The web-tools in Ondera and Huba (2006) are based on Matlab and its Symbolic Math Toolbox.This toolbox is a Maple 8 symbolic kernel that was bought from Maplesoft and implemented into Matlab by the MathWorks.The different platform also implies a different internet implementation.In Ondera and Huba (2006) tools are web-accessible via the Matlab Web Server that is based on the CGI technology, whereas webMathematica is Java-and JavaScript-based.Both webtools relieve users from installing Mathematica or Matlab on their computers and help to make programs available to everyone without seeing the program code.

Specifics of the continuous-time case
Although in this paper only the functions for the discrete-time case are discussed, the website provides the same functionality also for continuous-time nonlinear systems.The functions corresponding to the continuous-time case use the same naming convention as the discrete-time ones and are distinguished from them by the function argument.The objects containing the control system, that is StateSpace and IO, have a special argument to indicate the time domain of the system: it is Shift for discrete-time systems and TimeDerivative for continuous-time systems.However, the web interface user should be careful to select the correct functions from the menu.
The most important difference between discrete-and continuous-time cases is in the submersivity assumption, which needs to be tested in the discrete-time case, but is inherently satisfied in the latter case.The second important difference is in the decomposition of the system into observable and unobservable subspaces.Whereas in the continuous-time case this can always be done, in the discrete-time case one has first to check whether the observable subspace is integrable, which is the necessary condition to perform the decomposition.As for the operations with Ore polynomials, the main difference comes from a different commutation rule, employed in the continuous-time case compared to that of (3) in the discrete-time case.However, both commutation rules, ( 14) and (3), yield the Ore polynomial ring.

CONCLUSION
The paper describes how the symbolic computation package NLControl, developed within the Mathematica environment, has been made available over the internet using webMathematica programming features.The website has been tested on Microsoft Internet Explorer and Mozilla Firefox web browsers.Our future goal is to implement more NLControl functions into the webMathematica website, and improve the documentation and example library.Especially, we want to include functions that allow output feedback linearization and/or decoupling, construct the transfer function from i/o equations (2) or from state equations (1), find the discrete-time model from the continuous-time system equations, and solve the model-matching problem.

APPENDIX
Below the source code of the Mathematica blocks, which generate the result to the webpage of the function Realization, is given.The first block deals with the data entered by the user and the second block performs the actual realization procedure.Variables $$eqs, $$Ut, and $$Yt store the data entered by the user on the input data page into the text fields, $$outputformat and $$argumentt carry the information about user's formatting preferences.The function MSPToExpression turns the string obtained from the text field into the Mathematica expression.If this process fails with the i/o equations, that is if the value of the variable correctdata is not True, an error message is printed and no more computations are made.However, the failure in the interpretation of the lists of input and output variables does not stop the work of the program; in this case all the variables in the i/o equations starting with u and depending on argument t (e.g.u[t], u1[t+1], ua[t+2],...) are considered as input variables and analogously those starting with y are considered as output variables.The i/o equations are assigned to variable data and then printed to the webpage using the special formatting command iWebForm.Note that DetectVariables and iWebForm are defined in the NLControl package and are not Mathematica built-in functions.In the case of complicated systems performing the function Realization may often lead to very long calculations, therefore TimeConstrained interrupts the computations when the time limit 28 seconds is exceeded.The second argument of the Realization function tells Mathematica that the state variables should be denoted as x1, x2, . . . .The outcome of the realization is assigned to the variable result.After that, according to the value of result, the corresponding message is printed and in case the result contains the correct state equations, the equations formatted with iWebForm, are also included.