Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Quaestor employs a powerful ‘parameter’ concept that; , i.e. a parameter can be a numerical attribute like length, mass and cost, but also nominal (string) values can be dealt with such as color, client name , contents or contents of program output files.

Apart from the numerical and nominal parameter type, Quaestor uses the Object type. A Quaestor object is a parameter which has a set of parameters with values as value, either static (only data, e.g. a speed-power curve or a list of components) or dynamic, i.e. a computational model (input and output) fulfilling the role of function or subroutine in an assembled model (a Solution in the Quaestor Workbase).

...

In a Relation, PowerCalc can be used as if it were an intrinsic function like SIN(), SELECT() etc. as in the following example:
Power = PowerCalc(@Power, @Method:"Savitsky", @Speed:Vdes, L, B, T, D)


In this example PowerCalc represents the object (container) of a computational model that will compute Power on the basis of the values of Method="Savitsky"Speed=Vdes and the actual values of L, B, T and D. The @ character indicates that the parameter should exist in the PowerCalc object, the first parameter after the opening bracket (@Power) is the top goal of the PowerCalc object, @Speed:Vdes means that Speed in PowerCalc should get the value of Vdes. Values of L, B, T and D are required but not unique to this object and therefore requested as normal parameters and should be available "above" or outside the object. See also Quaestor syntax for more detail.

...

The object PowerCalc created by evaluating the above relation is reusable and extensible: it is possible to request other goals to goals from the same object instance, for example the rotation rateRevs:
N = PowerCalc(@Revs, @Method:"Savitsky", @Speed:Vdes, L, B, T, D)


If this relation is evaluate evaluated later than the earlier one, and Revs is not yet computed, Revs is added as top goal to the object after which the object attempts to add the necessary relations to its model and will compute its value.

If another relation is evaluated that evaluates Power with other input, the calculation in PowerCalc is redone. Only the last results in the object are maintained in the solution. Use the @MULTICASE attribute to force the object to save all its values. Realize that this might require more memory and will let your project files grow significantly.

The table below lists the return type for every Left side, Goal type, List/Table and Return type combination, along with an example. So if the left side is a String the return type is a Telitab, when the left side is a value the return type is a pointer to an object, except when the goal type is a list of values, then  the return type is a value. Assigning a pointer to a value parameter is useless as it can not be used. It only makes sense in a function call. Then it is used implicitly. However the expression editor does not support this yet. At the moment it is possible to define an expression that will assign a pointer to a value parameter. This will be solved in a future release. However, the case when the left side is a value and the goal type is a table of values can only be detected run-time, and can therefore not be prevented in the expression editor.

Left

side

Goal

type

List /

Table


Return type


Expression


Goal

 


Input

 
ValueValueListValueY = DataObject(@Y, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))Y = X^2 Xmax = 3Xmin = 3
ValueValueTablePointer to DataObjectY = DataObject(@Y, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))Y = X^2 Xmax = 3Xmin = 1
ValueStringListPointer to DataObjectY1 = DataObject(@D$, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))D$ = STR$(2*X^2) Xmax = 3Xmin = 3
ValueStringTablePointer to DataObjectY1 = DataObject(@D$, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))D$ = STR$(2*X^2) Xmax = 4Xmin = 3
ValueTelitabListPointer to DataObjecty2 = DataObject(@C#)C# = TELITAB#(0,A,B) A = 1B = 1
ValueTelitabTablePointer to DataObjecty2 = DataObject(@C#)C# = TELITAB#(0,A,B) A = 1(1)10B = 2(2)20
ValueObjectListPointer to ChildObjecty3 = DataObject(@ChildObject, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))ChildObject(@Y, X)Y = X^2Xmax = 3Xmin = 3
ValueObjectTablePointer to DataObjecty3 = DataObject(@ChildObject, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))ChildObject(@Y, X)Y = X^2Xmax = 4Xmin = 3
StringValueListTelitabY$ = DataObject(@Y, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))Y = X^2 Xmax = 3Xmin = 3
StringValueTableTelitabY$ = DataObject(@Y, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))Y = X^2 Xmax = 3Xmin = 1
StringStringListTelitabY1$ = DataObject(@D$, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))D$ = STR$(2*X^2) Xmax = 3Xmin = 3
StringStringTableTelitabY1$ = DataObject(@D$, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))D$ = STR$(2*X^2) Xmax = 4Xmin = 3
StringTelitabListTelitaby2$ = DataObject(@C#)C# = TELITAB#(0,A,B) A = 1B = 1
StringTelitabTableTelitaby2$ = DataObject(@C#)C# = TELITAB#(0,A,B) A = 1(1)10B = 2(2)20
StringObjectListTelitaby3$ = DataObject(@ChildObject, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))ChildObject(@Y, X)Y = X^2Xmax = 3Xmin = 3
StringObjectTableTelitaby3$ = DataObject(@ChildObject, @X:STR$(Xmin)+"(0.1)"+STR$(Xmax))ChildObject(@Y, X)Y = X^2Xmax = 4Xmin = 3

2 Object as Pseudo-Intrinsic Functions

...

Relations should be available to compute Re on the basis of LengthSpeed and Temp, as in Re=Speed*Length/Nu and Nu=f(Temp). This form of function definition will present theReynolds() function in the expression editor as if it were a Quaestor intrinsic function like SIN() or SELECT(). Any values or parameter can be used to fill in on the locations of Length, Speed and Temp, as in the following example:
RN75=Reynolds(C0_75,SQRT(V_a^2+(0.75*Pi*V_a/J)^2),CurTemp)


RN75 represents the Reynolds number of the propeller blade section at 0.75R in which: and
Length = C0_75

Speed = SQRT(V_a^2+(0.75*Pi*V_a/J)^2)and
Temp = CurTemp

Please note that the above could also be written in the first method as follows:

RN75 = Reynolds(@Re, @Length:C0_75, @Speed:SQRT(V_a^2+(0.75*Pi*V_a/J)^2), @Temp:CurTemp)


This example shows that the pseudo intrinsic way of defining functions is an elegant way to use Quaestor objects, in particular since the functions that are defined in this manner are presented in the Quaestor/Functions overview in the browser.

...

By introducing the following list of relations in a new knowledge base, a miniature configurator is obtained:

Relation 1:
Ship(@Decks,@Bulkheads)

Relation 2:
Decks(@Deck)

Relation 3:
Deck(@Area, @ID$)

  and put "@ASKORDER:Nr" in the data slot of Deck on a new line


Relation 4:
Bulkheads(@Bulkhead)

Relation 5:
Bulkhead(@Area, @ID$)

   put"@ASKORDER:Nr"in    putin the data slot of Bulkhead on a new line


Relation 6:
Area = L*B

  put @LOCAL attribute   put  attribute in the data slots of L and B


Relation 7:
ID$ = CUROBJECT$(1)

Do not forget to provide the parameters dimensions in the Frame viewer, top right.

...

Simply create a new knowledge base with the following relations:
QuadraticCurve(@Y,@X:"0(1)20")
Y = X^2

Couple the QuadraticCurve object Couple the QuadraticCurve object to the relation Y = X^2 through the Constraint Connect menu option in the Knowledge browser:

...

This makes that Y = X^2 is only valid within an instance of QuadraticCurveof QuadraticCurve.

Enter the next relation:
Y = DQUAD(@QuadraticCurve, 2, @X, @Y, X)

Select Y as top goal and enter a value 3.5 for X. You will see that the QuadraticCurve object the QuadraticCurve object is created in the solution and you will get a result of 12.25.

Enter an additional relation that selects the third Y value from the QuadraticCurve objectthe QuadraticCurve object:
Y_3 = QuadraticCurve.Y.3

Select Y_3 as top goal will yield a result of 4.0.

...

Introduce into an empty Quaestor the relations:
Y = DQUAD(@QuadraticCurve, 2, @X, @Y, X)
Y = X^2

Connect this relation to the QuadraticCurve object the QuadraticCurve object as is done above.

X must be provided with the @LOCAL attribute the @LOCAL attribute in its dataset, since it is to be used both in the solution top level and in the QuadraticCurve levelthe QuadraticCurve level.

QuadraticCurve must QuadraticCurve must be provided with the OBJ attribute the OBJ attribute in the Determined By property:

In this case QuadraticCurve is case QuadraticCurve is introduced in the model by the first relation. And the OBJ attribute the OBJ attribute makes it into a non-computable object which will create the X and Y values through the @X and @Y arguments the X and Y values through the @X and @Y arguments in the relation (the @ stands the @ stands for parameter presence in the object).

If you ask for Y and give respectively X=6 for Y and give respectively X=6 (in the solution level) and Xand X=1(1)10 10 (in the QuadraticCurve level) you will get the obvious result of 36of 36.

Alternative 2:

Yet another way to create objects is illustrated by the following relations:
    Z=QuadraticValue.Y
    Y=X^2

Ask Z and give X=3 and you will get 9 as result. The QuadraticValue object Ask Z and give X=3 and you will get 9 as result. The QuadraticValue object in the solution contains the calculation with the Ythe Y=X^2 relationX^2 relation.

See the Quaestor syntax for all the specific syntax for objects.