Standard Library - Mathematical
JavaScript

 

Description:   The Javascript component allows the inclusion of Javascript code inside the simulation. The Javascript code to be executed is contained in Script. The Javascript is compiled into byte codes at start up. If the script is changed during the run the CompScript SimMethod must be called to recompile the code.

The input signal is accessible inside Javascript as the vector x. The output signal is accessible as the vector y. DIMA and DIMC are also accessible in the script. An example Javascript which copies the inputs to the outputs is:

int I; for(i=0;i<DIMC;i++) y[i]=x[i];

Most standard Javascript commands are available including math functions. Specific SimCreator Javascript commands are described in the SimCreator user manual.
 

Inputs:   SimRealVar SigIn[DIMA] - Input Signal (ND)
char Script[DIMB] - Script to Execute (ND)
 
Outputs:   SimRealVar SigOut[DIMC] - Output Signal (ND)
SimMethod CompScript - Compile Script
 
States:   None
 
Dimensions:   DIMA - Sets the width of the input vector
DIMB - Sets the length of the script
DIMC - Sets the width of the output vector
 
 

return to component list

Home  |  Products & Services  |  Support Downloads & Demos  |  Documents  |  News & Events  |  About Us  |   Contact

Realtime Technologies, Inc.
© Copyright 2004-2007 Realtime Technologies Inc. All rights reserved.

Realtime Technologies Inc. (RTI) specializes in real time multibody vehicle dynamics, and graphical simulation and modeling.  We offer simulation software applications, consulting, custom engineering, software, and hardware development.  Realtime Technologies’ customer base includes international, government and private entities.  RTI was founded in 1998.