Introduction to RASON
About RASON Models and the RASON Server
Rason Subscriptions
Rason Web IDE
Creating and Running a Decision Flow
Defining Your Optimization Model
Defining Your Simulation Model
Performing Sensitivity Analysis
Defining Your Stochastic Optimization Model
Defining Your Data Science Model
Defining Custom Types
Defining Custom Functions
Defining Your Decision Table
Defining Contexts
Using the REST API
REST API Quick Call Endpoints
REST API Endpoints
Decision Flow REST API Endpoints
OData Endpoints
OData Service for Decision Flows
Creating Your Own Application
Using Arrays, For, Loops and Tables
Organization Accounts

A simple 'loop()' without index sets and array assignment

[Example Model: Space1.json]

data: {
   time: { value: 10 },
direction: { dimensions: ['time'], value: 1.570796327 }
	},
variables: {
   blast: { dimensions: ['time'], value: 20, lower: 0, upper: 30, 
   finalValue: [] },

   change: { dimensions: ['time'], value: 5,  lower: -6.28, upper: 6.28, 
   finalValue: [] }
},
formulas: {
   "loop(t in 2..time)" : {
      "direction[t]": { formula: "direction[t-1] + change[t]" },
      "Vx[t]": { formula: "Vx[t-1] + COS(direction[t])*blast[t] +     
      x1grav[t-1] + x2grav[t-1]" },
...
   }
}

In this example 'time' is the constant 10. We preliminarily define the formula assignments as arrays and initialize them with values. We cannot use the index ranges in 'loop()/for()' for dimensioning the result variables because the ranges determine the desired computation formulas only. For example, in this case there is no formula for t = 1, while direction[1] must exist in the model.

Back to Examples Using Loops