1STOPT Programming Mode
1STOPT Quick mode Intuitive, simple, clear, easy to master, can solve most of the optimization problems, but for some complex problems, such as the objective function or constraint function can not use a simple expression to express the calculation, but through the complex logic judgment, cyclic operation, etc. to represent the calculation, fast mode is powerless, The 1STOPT programming mode can be used to solve this problem. 1STOPT directly supports basic and Pascal two languages. Theoretically speaking, the programming pattern can solve the problem in all shortcut modes.
Main keywords for programming mode:
1) StartProgram: Defines the starting line y "StartProgram [basic]" of the programming mode to represent the use of Pascal in Basic language y "StartProgram [Pascal]" or "StartProgram"
2) Endprogram: The terminating lines that define the programming pattern are written in the standard delphi/pascal or basic language between "StartProgram" and "Endprogram".
3) Objectiveresult: Define the objective function, only once.
4) Constrainedresult: Defines a constraint function and can have multiple.
An example of constrained function optimization
1STOPT Quick Mode Code:
Parameter x (4) =[-100,100];
Minfunction 10*x1+9*x2+8*x3+7*x4*sin (x1+x2+x3);
(3*x2+2*x4*cos (x1+x2+x3+x4)) ^2<=90;
x1+x2>=-30;
x3+x4>=30;
3*x1+2*x3<=120;
1STOPT Programming mode Basic code:
Parameter x (4) =[-100,100];
Minimum;
StartProgram [Basic];
Sub Mainmodel
objectiveresult = 10*x1+9*x2+8*x3+7*x4*sin (x1+x2+x3)
Constrainedresult = (3*x2+2*x4*cos (x1 +x2+x3+x4)) ^2<=90
constrainedresult = x1+x2>=-30
constrainedresult = x3+x4>=30
Constrainedresult = 3*x1+2*x3<=120 End
Sub
Endprogram;
1STOPT Programming Mode Pascal code:
Parameter x (4) =[-100,100];
Minimum;
StartProgram [Pascal];
Procedure Mainmodel;
Begin
Objectiveresult: = 10*x1+9*x2+8*x3+7*x4*sin (x1+x2+x3);
Constrainedresult: = Sqr (3*x2+2*x4*cos (x1+x2+x3+x4)) <=90;
Constrainedresult: = x1+x2>=-30;
Constrainedresult: = x3+x4>=30;
Constrainedresult: = 3*x1+2*x3<=120;
End;
Endprogram;