You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Tutoril 1
Getting strted

 

Lerning gols

  1. Getting fmilir with Questor interfce.
  2. Adding functions nd constrints.
  3. Providing references nd properties for prmeters.
  4. Creting multiple cse solution.

Prior knowledge

  • Interfce

1    Objective

As mentioned erlier these tutorils re focussing on providing the bsic skills of knowledge engineering. In this first tutoril, the min dimensions of ship will be systemticlly vried. The knowledge used is Archimedes’ Lw in combintion with design requirements, which re the following:

The ship should hve

  • displcement of t lest 2000 t, but less thn 3000 t;
  • drft of 6 m.

Our objective is to generte dtset of systemticlly vried ships tht meet the design criteri.

2    Before we strt

Before strting with your knowledge engineering, plese mke sure you re ctully using the knowledge engineering user level nd you hve Questor configured in the most convenient lyout.

To check/chnge your user level go to the generl tb of  Tools>Options. You cn chnge your User level. If you re not ble to chnge it to Knowledge Engineer (level 3), you do not hve KE rights. Plese contct your ICT deprtment or Qnowledge for the proper license.

Furhtermore, for editing ll kinds of properties it is convenient to use the . Therefore in the  Apperence tb of Tools>Options select "Use clssic frme viewer".

3    Creting prmeters

When Questor is strted, n empty knowledge bse is utomticlly creted. 

 In the Knowledge browser, minimize the Questor node, nd expnd the NewQkb node (figure 1).

Figure 1    Expnding the Newqkb node

When the knowledgebse node is expnded, the clsses within the knowledgebse re visible. Clsses re used to orgnise your prmeters, nd put them in prcticble structure. The Top Gols/Undefined clss is prt of the knowledge bse by defult. Here, the gol prmeters of your clcultion (Top Gols) cn be stored, s well s other prmeters tht don't belong to other clsses (Undefined).

We'll crete new clss nmed Min Dimensions, in which the following ship prmeters re to be stored.

  •     Lpp: Length between perpendiculrs

  •     B: Moulded bredth

  •     T: Drught from keel to Construction Wter Line

     In the Knowledge browser  Top Gols/Undefined nd select new Clss (Ctrl+N). Provide the clss with the nme Min Dimensions. Note tht the input box will lredy contin the word "Gols". To mke new clss, delete Gols nd write your clss nme (in this cse Min Dimensions). Sub clsses cn be defined by dding the min clss with sub clsses seprted by points: Gols.Sub gol

Figure 2    Creting new clss in the knowledge bse 

The clss is now shown in the knowledgebse tree, nd we cn dd the prmeters Lpp, B nd T.

 Select the clss Min Dimensions.  in the right-hnd side of the knowledge browser, nd select New Prmeter/Function(Ctrl+I), see figure 3. Note tht the lst prmeter in focus will be shown in the input field (most probbly ). Delete this prmeter, type Lpp nd click the Vlue button. Repet these ctions for the prmeters B nd T.

 

Figure 3    By right clicking in the right-hnd side of the knowledge browser, prmeters cn be dded 

The dded prmeters ll pper like this:

 

The red cross is sign tht the prmeter is not yet fully defined for the system.
In Questor, vlid prmeter hs:

  • A unique nme;
  • A dimension (or ssigned dimensionless);
  • A wy to be determined: input from the user or defined by reltion.

The first requirement is lredy stisfied, so let's ssign dimensions to the prmeters.

 Select the Lpp in the . In the , chnge the ? sign to m, the dimension for Lpp (meters). A list of possible dimensions is utomticlly shown when you type.

In the lrger re of the ,  reference cn be ssigned to the prmeter. A proper reference is importnt, s users of the knowledgebse my not be certin of the exct mening of the prmeter. Plese lso red  for more detils.

 Provide Lpp with the reference Length of the ship (figure 4).

 

Figure 4   In the , dimension nd reference cn be ssigned to the prmeter

NOTE: The dimension of prmeter cn lso be ssigned in the  window. Just scroll down to the Dimension row, nd chnge the vlue.

  Assign dimension nd reference to the other prmeters B nd T, just s described bove. Of course, the bredth nd depth of the ship re defined in meters.

Now only the lst requirement for vlid prmeters hs yet to be fulfilled:

  •  A wy to be determined: input from the user or defined by reltion.

This qulifiction cn be provided in the Slots ∓ Properties window.

 Select the prmeter LPP. In the Slots ∓ Properties window, scroll down to the Determined by row. Chnge the vlue to VR: User only, s the prmeter LPP is input (insted of defined by reltion), see figure 5.

 

Figure 5    Let Questor know how prmeter should be determined     

Notice tht the sttus of LPP hs chnged to

to show tht Questor knows enough bout this prmeter to use it in computtionl model.

 Mke sure tht B nd T re determined by VR (Vlue Requested):User only too.

Note tht bove you hve explicitly dded Lpp, B nd T s prmeters to the knowledge bse. 
You re lso ble to implicitly dd prmeter by creting reltions tht contin new prmeters. Questor will utomticlly dd these new prmeters to your knowledge bse (so implicitly). You will see this next.

4    Creting reltions

In order to define the loding cpcity of the ship, it’s importnt to know the kind of wter (Slt or Fresh) the ship will sil in. Therefore, we will dd some reltions nd constrints, nd mke sure the user cn select the wtertype.

We'll dd two reltions, one for slt wter nd one for fresh wter.

  Select Top Gols/Undefined in the knowledge browser,  in the right hnd side nd select New Reltion (Ctrl+N). In the upper prt of the new window, delete ny proposl (Questor my hve filled in the lst selected prmeter), nd enter

Rho = 1025

(belonging to slt wter), nd press Sve (figure 6).

 Figure 6   Entering reltion 

Note tht when you enter reltion, Questor provides s much help s possible by mens of the Help Checker. This checker shows wht to expect (in this cse Vlue or n Expression, ).  After sving reltion, the Help Checker will check the syntx for possible errors, nd shows wrning messge when something is wrong.

Becuse of entering the reltion, the prmeter Rho hs utomticlly been creted. Furthermore, note nd relise tht the prmeter is creted in the Clss in focus when sving the reltion. For Rho to be vlid prmeter, dimension should be ssigned.

  Provide reference for rho nd ssign it the dimension kg/m^3. Rho is now vlid prmeter. Furthermore, mke sure rho is determined by SYS: System/Eqution, s reltion is used to determine rho.

The following might seem bit unconventionl: second reltion is given for Rho. This is nice exmple of how questor works: In clcultion, Questor cn find numerous clcultion pths nd utomticlly chooses the most ppropite one bsed on constrints nd vilble dt. An infinite number of reltions cn be ssigned to one prticulr prmeter.   

  Add the following reltion (belonging to fresh wter) in similr wy s described bove

Rho = 998

5    Creting constrints

The two reltions for the density of the wter re only vlid for their corresponding wtertype. Therefore,  constrint is dded to ech reltion. A constrint is simply restriction for the vlidity of the reltion.

  Double click Top Gols/Undefined in the knowledge browser: ll reltions in tht clss re shown (this will work for ny clss). One cn lwys edit reltion by selecting it nd pressing F2 (or  nd select edit). This is lso useful method to find out which reltion you ctully selected.

Now  the reltion Rho = 1025 nd select Constrint->Add New. In the upper prt of the new window enter the following constrint:

Wtertype$= "SW"

nd press Sve (figure 7).

 

Figure 7   Adding constrint to reltion

The constrint is now dded, nd prmeter nmed Wtertype$ hs been creted. The $ t the end of the prmeter nme mkes sure Questor recognizes it s  String vlue, nd the dimension Str is utomticlly ssigned (see lso Questor syntx. We hve to ssign  determined by vlue to mke it vlid prmeter.

  Mke sure Wtertype$ is determined by VR: User Only, s the user should provide the informtion concerning the wter type.

We repet the process for the other reltion: 

  Add the constrint: Wtertype$ = "FW" to the reltion Rho=998. Note tht the expression editor ssist you with the presenttion of existing prmeters nd intrinsic function. When you press enter while n existing prmeter or function is blue, this prmeter or function is plced in the expression editor.

Both reltions re now connected to the corresponding wtertype by mens of the vlue of the string Wtertype$. Note if Rho is needed in the clcultion progress, Qustor will note tht the wtertype is needed nd will sk the user for this vlue (becuse it is ssigned User Only).

TIP: By selecting prmeter in the knowledge bse nd then double clicking the box below the knowledge bse tree, the reltions defining tht prticulr prmeter re visible (figure 8).
Moreover, when you select reltion in the knowledge bse, nd double click tht box, the prmeters tht cn be clculted by the selected reltion re shown.
When single clicking the box, ll connections to the prmeter or reltion re shown. See lso informtion on the .

 Figure 8   When selecting prmeter nd double clicking the box indicted by the blue rrow, ll reltions defining tht prmeter re shown.

6    Creting dropdown menu

Becuse there re only two possible vlues for Wtertype$ (SW or FW), it's esy to integrte dropdown box. 

   Select Wtertype$ in the knowledge browser, nd dd the following text s reference text in the frme viewer (figure 9):

Wtertype: 

SW<eq>Sltwter 

FW<eq>Freshwter

 

Figure 9   A dropdown box is creted by entering this informtion in the reference slot of the frme viewer

The use of dropdown box will be cler in lter stge of this tutoril, when clcultions re mde. Note tht you cn dd the  ttribute to the dt slot of the Wtertype$ prmeter (see  for dt slot)  in order to mnipulted tht only "Sltwter" nd "Freshwter" re shown (so without SW nd FW).

7    Creting reltion for the displcement

On the bsis of the erlier defined prmeters nd the block coefficient Cb , the displcement of the ship cn be clculted.

   Add the following reltion to the clss Min Dimensions:

DISP= Cb*Lpp*B*T*Rho/1000

which defines the displcement of the ship in tons

Note tht two new prmeters re creted: the block coefficient Cb nd the displcement DISP. In order to keep the knowledgebse meningful, it is necessry to provide references, dimensions nd determined by vlues for these prmeters.

  Provide references, dimensions nd determined by vlues for Cb nd DISP. Cb hs no dimension (-), DISP should be in tons (t). Just press ok if Questor notes tht tons is no bse dimension (kg), it is just to inform you. We covered this by dividing DISP by 1000. The determined by vlues should be VR: User Only for Cb, nd SYS: System/Eqution for DISP, s the block coefficient is input nd the displcement is determined by reltion.

8    Creting solution

Let's perform our first Questor clcultion. A solution is lwys determined by one or more Top Gols. A top gol is prmeter (or object) tht is your finl clcultion trget, in this tutoril it's the displcement of the ship. 

   Select the clss Min Dimensions in the knowledge browser. Double click the prmeter DISP.

Note tht the  sign of DISP chnged to , indicting tht it's top gol for the clcultion.

Clcultions nd solutions re mnged in the workbse. Here, solutions cn be creted, redone (with different dt), exmined nd deleted. 

  In the workbse, click the  button when you use clssic buttons or the "Crete Solution" button when you use the  to strt the clcultion with top gol DISP.

The clcultion progress is strted, nd Questor first collects ll input dt (figure 10).

 

 Figure 10   Input dt for the clcultion

Entering dt is esy: just type vlue for ech selected prmeter nd press enter to switch to the next one.

  Enter the following dt for our first clcultion:

        B= 10   Cb= 0.55   Lpp= 60   T= 6   Wtertype$= SW (Slt Wter)

Note tht the input of Wtertype$ consists of dropdownbox, which we creted in (4), see figure 11. 

 

 Figure 11   Wtertype$ cn be selected in dropdownbox

After providing the dt you hve to press the  button or "Accept input &mp; Continue" button to continue. The ctul clcultion is strted now, nd the right-hnd side of the workbse shows the sitution of figure 13. During the clcultion, the box indicted with the blue rrow shows the sttus of the clcultion.

Becuse this is very simple exmple, the finl stte is lost immeditely shown.

Figure 13   Sttus of the clcultion nd solution

The top gol (DISP) is shown, together with ll prmeters tht were used for the clcultion. With these input vlues, the displcement of the ship is bout 2030 tons.

9    Multiple cse solutions

So fr, we creted one solution, which is shown in the workbse (figure 14).

 Figure 14   All solutions re shown in the workbse 

As mentioned in the objective, we'd like to crete dtset of systemticlly vried ships. We could of course perform severl clcultions with different input dt by hnd, but it's much esier to use the bility of Questor to crete multiple cse solutions. To keep the complexity of this exmple within reson, we will only vry the bredth nd length of the vessel. Plese note tht due to some importnt conceptul resons the ltest Questor relese cn only perform clcultions on rnges of prmeters when you lrede hve creted solution.

   In the workbse, select the solution you hve lredy creted (clled the sme s the top-gol prmeter DISP). Restrt the solution by pressing the  or "Redo Solution" button in the workbse. Questor will present the previous input, chnge the following input:

B= 9(0.5)11 m    Lpp= 55(2)69 m

In this wy, B nd Lpp re defined by rnge, given the strt vlue, step size nd end vlue. For exmple, Lpp is defined from 55 to 69 meter, with steps of 2 meter.

Questor will sk if it should crete cse mtrix for Lpp (figure 15), click yes (n explntion will follow).

 

Figure 15    Questor sks if cse mtrix should be creted 

You will see tht the single vlue input is still in the list nd the multi cse vlues re in the tble prt of the . Press the button or "Accept input &mp; Continue" button to continue.

The new solution is now creted. The fixed vlues re gin shown in the right hnd side of the workbse. The vrying prmeters (B nd Lpp) nd the corresponding solution for DISP re shown in the lower prt. Ech row is different cse, identified by  cse number(#1, #2, etc.), see figure 16.

Figure 16    Multiple cse solutions re shown in the workbse, ech row is different cse 

Wht does the Cse mtrix question men?  Note tht the vritions of B do not correspond to the vritions of Lpp: there re 5 vlues for B nd 8 vlues for Lpp. If we would hve nswered No to the Cse mtrix question, five vritions of B would hve been mde, ech one with the corresponding vlue of Lpp (the lst 3 Lpp vlues would be omitted). In tht wy, there would be only five cses. As we nswered yes to the question, ll possible combintions re considered, which results in 5*8=40 cses. You cn esily notice the difference by creting new solution with the sme input vlues, but now nswer no to the cse mtrix question.

NOTE: Rnges cn be defined in multiple wys: 

  • Individul vlues cn be seprted by comm’s: 9, 10, 11 or, when in the Modeller tb of Tools>Options you hve selected "Use ";" insted of "," in rnge input", the seprtion is by mens of semi colon (;);
  • You cn define rnge with begin, n end nd number of steps (intervls): 9(&mp;2)11;
  • You cn define rnge with begin, n end nd step size: 9(1)11;
  • You cn define rnge with begin, n end nd step size, including the lst element when this is smller thn the whole mount of steps: 9(#1)11.5;

10    Mnge solutions


Our multiple cse solution tble is sorted by the bredth of the ship, s shown in figure 16. Suppose we'd like prmeter Lpp the leding prmeter in this tble.

    In the knowledge browser, select the prmeter Lpp. In the Slots &mp; Properties window, scroll down to the row Output to, nd select HEADER (figure 17). Now, refresh the tble of the multiple cse solution by clicking nother solution, nd then gin the multiple cse solution. The tble is now leded by Lpp.

 Figure 17   By selecting Output to HEADER, the prmeter will 'led' the multiple cse solution tble

A lot of cses in our solution don't meet the design criteri: displcement between 2000 nd 3000 ton. We could hve fixed this by dding constrint to DISP, but nother wy is to use  filter in the solution tble.

   In the workbse, select the lst (multiple cse) DISP solution, nd click the   or "Filter" button. The filter window shows. For DISP, select Rnge s filter, fill in 2000 for Lower bound nd 3000 for upper bound (figure 18). Click the Applybutton.

 

 Figure 18   With filter, cses tht do not fulfill the filter conditions cn be mde invisible

Now, only the cses for which 2000<DISP<3000 re shown in the tble. Our objective hs been completed:  we build dtset of systemticlly vried ships tht meet the design criteri.

11    Check

You cn verify your results by compring it to < style="text-decortion: none;">[Tutoril 1 Finished] 

Continue to tutoril 2 >>

  • No labels