Online Tutorial - Simple calculations


Objectives Learning the calculating methods in Stratum 2000.
button8.gif (188 bytes)
Fast creation of the new project
For example, You need to calculate expressions y=2*x+2 for x from -10 to 10.
Start Stratum 2000 and on the instrumental panel press "Fast creation of a new project". The worker field named "Scheme:..." is open.
Scheme is known as a set of information the linked objects. So it maps the researched system structure. Object is a prototype of an object from the real world, model, or template. We divide system into some elements to deal easily with them. That's why it is useful to split complex systems. The splitting of the system into units should be made so that it would be possible to compound these units in other combination in another system. And to make that the main amount of links remain inside elements. It permits to achieve the greatest integrity of elements, which can be used later as complete objects. But mind 2 extremes! It is much more easily to test elementary objects, but much more difficult to set them into one system - because of links amount. The objects, which are too large, are also inconvenient - it's difficult to create something new of their combinations or to update the system without changing components.
The scheme creation and editing The Drawing toolbar is applied to operation with scheme elements.

objbar.gif (7160 bytes)

Press the new object creation button    on  the toolbar. The Class properties dialogue  is open. For the first time you do not have to fill in everything, but only the most important.

Class name.
In the line "Class name" type for example linear_func.

Class text.
Click the left mouse button (click) on the tab "text" then click the  text field. In the first line type:
X:= X+1
then press ENTER. In the next line type:
Y:=~X*2+2

Pay attention to characters := "to assign" and ~ "Tilde"!
The first line will change X value: -10, -9,..., 8, 9, 10,... to one every step until the project is not stopped (by the Stop button).
The second line will change Y value depended on a current X value. Values of X and Y will be calculated at every step.

Click the Compile button. The message OK will appear, else you have misprinted. Check the text and correct the error. Then press OK on the dialogue box bottom, it will disappear and class picture, containing your expressions, will arise on the project worker field.

Initial value. For correct calculating the initial value of X is needed. Click the right mouse button (right-click) on the class icon, click "Class properties" and then click tab "Variables". You will have the list of variables. Click cell on "Data" column and the X line intersection.Type there -11. Now press the OK button. You are ready for calculating.

Calculation For calculation of the scheme the Control toolbar is used.

ctr_bar.gif (3975 bytes)

Press the Step button. System does one step and stops after it. The system calculates all the expressions of the scheme at every step. After a step the system can be frozen in a pause state for any long time. Check this step results. Right-click the object icon. Put the mouse pointer at the line "Object variables". The object variables list and their current values is open. At the time X=-10 and Y=-18. If the Step button is pressed next time then Y value will be calculated for X=-9. By repeating the actions you can check the correct values of X and Y.

scheme0.gif (16332 bytes)

Test the Start, Pause and Stop buttons. To repeat experiment  press the Stop button at first . The values of all variables will be set by default. Press the Start button to calculate the scheme continuously and the Pause button to stop it.

Let us stop the calculations after 20 steps (X = 10) automatically. It is really difficult to stop the system after the exact step number in the Run mode. This is caused by high calculating speed of simple models. You can use Stop the command to stop system in Run time. The syntax is as follows: Stop(Flag). The system will pause if Flag value is more than zero. Add the following line in the Linear_func class text:
Stop(~X>9)

Then press the Start button. The scheme will do 20 steps and pause. Open "Object properties" dialog box for Linear_func object. On the variables tab you can see the X value that equals 10.

Test also different functions and analyze changes of variables.


Back : Index : Forward

Trademarks & Copyright © 1998 Stratum Modeling Group.  Last modified on 6-January-1999.