Resistance, add the following relation:In the class
Do not yet save the relation, as we will enter some data in the dataslot.
In the dataslot of the relation, enter the following:
This syntax results in the following. There are 6 parameters to be placed in the sheet. Parameter Rho, which is not case dependant, will be placed in the worksheet Resis, in the cell with name Rho. The parameter Lpp for example, is case dependant, the syntax above means:Which is the inputscript for our excelsheet.
In the dataslot of the relation, also enter:
"V_eco" "Resis.V_eco kn(10)"
Which uses the same syntax as the inputscript. For example, resistance Rt is column 17 in the sheet. All values below the cell with value Rt are stored in the telitab Resistance# as parameter Rt. Still, don´t save the relation yet.
In the dataslot of the relation, also add the following attribute:
See figure 1. Save the relation.
Add the following relation to your top goals:
Ship_calc# = UNION#(Stability_check#,"",Resistance#,"",1)
To avoid a possible manual input of Resistance#, make sure Resistance# is determined by SYL: System/Function. In the relation for Stability_check#, remove the subgoals attribute: the best ship evaluation does not include the resistance and speed.
External programs able to use scripted input usually have their own syntax. Typically, you´d like to use some sort of template script, with certain values replaced by values calculated in Quaestor. This is possible using the TEMPLATE$() function. In this case, we are dealing with a very simple program, called Froude_calc.exe. This program needs the following kind of input file:
In which, obviously, 16.00 is the value of the ship speed in knots, and 60.00 is the length of the ship in meters.
Resistance:Add the following relation as system in your class
Froude_input$ = TEMPLATE$(TEXTITEM$(1),0,V_eco,Lpp)
The dataslot containing:
You might want to check out the possibilities of the TEMPLATE$() function. Furthermore, note that V_eco is added to the knowledge base. Give the dimension kts for knots, you will be informed that this is based on the SI units m/s.
The output of the Froude_calc program is the following:
In which IER is an error check by the simple program:
TeLiTab output, we add the following relation to the class Resistance:As it is
Fn# = GET$("Froude.EPO", "Froude_calc.exe", PUT$("Froude.EPI", Froude_input$))
This syntax places the content of the string parameter Froude_input$ in the input file: Froude.EPI. EPI stands for: External Process Input. It runs the process: Froude_calc.EXE which generates the output file Froude.EPO (External Process Output) and gets the output back in a TeLiTab named Fn#. When it is not TeLiTab you receive as output, you can make TeLiTab by adding the PARSE#() function around the GET$() function to process the results. You might want to check out the GET$() and PUT$() functions.
As mentioned earlier, we don't have to include the program in the relation. An external program should be placed in the application directory of Quaestor (My documents\My Knowledge\Applic by default) or the specific Knowledgebase application directory (_KBname\Applic). Otherwise, Quaestor will ask for the program location.
To be able to select the Froude number as Top Goal for calculations, it has to be a parameter with a relation. The following relation retrieves the value for Fn from the TeLiTab Fn#.
Add the following relation to the class Resistance:
Fn = SELECT(Fn#, 1, "Fn", 1)
Make sure that both Fn# and Fn are determined by System/Equation. Check out the description of the SELECT() function.
As an alternative you could also write:
Fn = Fn#.Fn