Versions Compared

Key

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

...

Apart from the numerical and nominal parameter type, Quaestor uses  Quaestor uses the Object type. Quaestor object 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 Workbasethe Quaestor Workbase).

1 Objects as Dynamic Function

...

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 following modeling rules apply:

...

The object PowerCalc created by evaluating the above relation is reusable and extensible: it is possible to request other goals to 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 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.

...

The first is done in the normal way. The second is done by using the New Parameter/Function menu option in the Knowledge Browser and providing the function definition:

...

In this example a pseudo intrinsic function is created to calculated the Reynolds number.

Reynolds is the Quaestor objectthe Quaestor object, Re the top goal for the calculation to be performed with in the Reynolds instance and Length, Speed and Temp are the input arguments.

Relations should be available to compute Re on the basis of Length, Speed 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, Speedand 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:Length = C0_75

Speed = SQRT(V_a^2+(0.75*Pi*V_a/J)^2) andTemp = 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.

...

When creating the relations, Quaestor may  Quaestor may ask whether parameters are of the Object type. Obviously, Decks, Deck, Bulkheads and Bulkhead are objects, Area is not an object but a value. ID$ is automatically made into a string due to the $ suffix.

...

4 Object Initiation and Access

Next to the direct use of Quaestor objects of Quaestor objects as functions, it is possible to refer and use value from these objects in expressions. This in an implicit way of using the objects because they have to be created when you want something it contains.

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

Y = X^2

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 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 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 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 as is done above.

...

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 in the solution contains the calculation with the Y=X^2 relation.

...