POLYFLOW - Syntax of basic CLIPS command for UDF (numbers, add, function, print, etc.)

What is the syntax of basic commands in CLIPS language, used for defining UDF in POLYFLOW? In particular, how can one define a sum, an exponential? How to print the result of a UDF function for checking purpose?
Printing the contents of a variable:
(printout t "comment" ?variable crlf)
the instruction crlf stands for "carriage return" and is needed.

Defining a Bird-Carreau viscosity function of one parameter:
(deffunction BirdCarreau (?g)
(bind ?R (* 1000. (** (+ 1 (* 0.5 ?g 0.5 ?g)) -0.4)))
The independent variable (local shear rate) is named ?g, while the result is stored into the variable ?R. The three parameters of the Bird-Carreau viscosity law, eta0, tnat and n, are respectively given by 1000., 0.5 and 0.2.

Exponential function:
(deffunction exponential (?x)
(bind ?y (exp ?x))
)A few useful hints...
Instructions are always written within parantheses
Real numbers must contain a . (dot)
Extended information can be found in chapter 27 of the POLYFLOW User's manual.

Show Form
No comments yet. Be the first to add a comment!