Recent Changes - Search:

Information Foreword What is EJS? Demos/Examples Credits Links Webcasts Installation Download & Install EJS Workspaces Running EJS Conditions of Use Documentation EJS Console EJS Interface Description Panel Model Panel View Panel Deployment Elements Reference User Feedback English | Spanish | View Edit History Print PDF ## The model evolution As a generic example, let us name our model variables as `x1,x2,…,xn`. (In an actual model it is of course always advisable to give them more descriptive names.) The system developes from the current state of the variables `x1,x2,…,xn`, to a new state, `x*1,x*2,…,x*n`. Almost always the simulation will model development over time, in which case time is one of the variables of the system of equations. In EJS two ways are available to implement evolution from state to state: direct mathematical expressions and differential equations. An animation of a harmonic oscillator can be created by specifying (in code that complies with Java syntax) the following expression, which has the x-coordinate as a function of time. But in the actual world an oscillator will experience some form of friction. With friction the oscillation will decay, but what will the decay look like? To obtain an answer to that question the setup must be framed in the form of differential equations. In EJS the differential equations that can be entered are of the type called ‘Ordinary Differential Equation’ (ODE). On an empty evolution panel the top half says ‘Click to create a page of code’, and the bottom half says ‘Click to create a page of ODEs’. The code on a code page is not processed further, it will be inserted literally as statements in the Java code that is created. The ODE editor is for declaring differential expressions. EJS slots these expressions in the Java code that it generates for evaluating the differential equations. The slider on the left can be used to adjust the number of frames per second (FPS). This is for declaring how many times per second a new frame must be written to the screen. The slider position and the value in the number field FPS are connected. Moving the slider will reflect in the number field, and the other way round. The other numeric field is for ‘steps per display’ (SPD); how many steps the evolution steps should proceed before writing to the screen again. If the checkbox Autoplay is checked the simulation will start automatically when the program is opened.

Edit - History - Print - Recent Changes - Search
Page last modified on August 05, 2009, at 12:17 PM