VFGEN
  • Home
  • Download
  • Support
  • User's Guide
  • §   Vector Field File
  • §   ADOL-C
  • §   AUTO
  • §   Check
  • §   CVODE
  • §   DDE23
  • §   DDE-BIFTOOL
  • §   DDE_SOLVER
  • §   Delay2ODE
  • §   DSTool
  • §   EVF
  • §   GSL
  • §   Help
  • §   Javascript
  • §   LaTeX
  • §   LSODA
  • §   MATCONT
  • §   MATLAB
  • §   Octave
  • §   PDDE-CONT
  • §   PyDSTool
  • §   PyGSL
  • §   R
  • §   RADAU5
  • §   Scilab
  • §   SciPy
  • §   Taylor
  • §   XPP

Javascript

Javascript is a programming language that is understood by many web browsers.

The VFGEN Javascript Command

The javascript command generates Javascript code that can be used to implement a Taylor method solver for the vector field.

A javascript file called [name].js is created by the command

$ vfgen javascript vector_field_file.vf
where [name] is the name of the vector field given in the vector field file. The javascript file contains functions that compute the vector field, and higher order derivatives of the vector field, and a function that evaluates an approximate solution based on the Taylor expansion. See the taylor command for more background; the javascript command is basically the same, but it generates javascript code instead of C code.

The javascript command does not handle delay equations.

Options

demo If the option demo=yes is given, two additional files are created:
  • [name].html is an HTML file that creates a user interface for the Taylor method solver. It includes a graphical display of the solution, and several controls and input fields for controlling the solver. The HTML file must be viewed with a browser that supports the canvas object.
  • [name]_solverdemo.js contains javascript functions used in the HTML file. Included in this file is a Taylor method solver for the vector field.
Default: demo=no
order This option specifies the highest order retained in the Taylor series. The order must be a positive integer.
Default: order=5

Example

A vector field file for the Lorenz equations is lorenz.vf.
The files created by

$ vfgen javascript:order=7,demo=yes lorenz.vf

are
  • lorenz.js
  • lorenz_solverdemo.js
  • lorenz.html
Clicking on lorenz.html will bring you to the HTML/Javascript solver that was generated by VFGEN. Right-click on the link to download the HTML file, or following the link and use the View Source command in your browser (for example, View→Page Source in Firefox or View→View Source in Safari).

Copyright © 2005-2014 Warren Weckesser