×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how to write a rule for this relation ?

how to write a rule for this relation ?

how to write a rule for this relation ?

(OP)
Hi All

I have two parameters , one of the type angle 'c' , the other is length 'b', the base amount of b is 25 and for c is 360 degrees , they are related to eachother through a law

I want to write a rule to mention that :

if b > 25 then

c=360+f(b) some function of b

how do I write it in Rule base ?

thank you very much

RE: how to write a rule for this relation ?

(OP)
to complete it , is this rule correct ?

if (b > 25)
{ a=2*PI+2*PI/25*(b-25)}

since a is angle and b is length , how should I write it ? ? 2*PI or 360 ?

RE: how to write a rule for this relation ?

(OP)
but anyway with changing to 360deg also nothing happens , a doesn't change when I change b !!!

RE: how to write a rule for this relation ?


how do I write it in Rule base ?


/*Rule created by dbezaire 05/02/2014*/


let b (length)
let c (angle)

if b > 25mm
c=360deg+tanh(b/1)

/* the some function of b must return an angle! */

Win XP64
21SP7/22SP5, 3DVIA Composer 2013X, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB

RE: how to write a rule for this relation ?

(OP)
I wrote this and it did not work again :

/*Rule created by Farzad 2/4/2014*/

let b (length)
let a (angle)
if b > 25mm
a=360deg +360deg/25mm*(b-25mm)

I saw somewhere that I have to use the {} and () does it make any difference ?
I mean writing as :


let b (length)
let a (angle)
if (b > 25mm)
{a=360deg +360deg/25mm*(b-25mm)}

and still , none of them have any affect on a , sorry I change the parameter from 'c' to 'a' ,

RE: how to write a rule for this relation ?

(OP)
more clarifying that , in the line a=360deg +360deg/25mm*(b-25mm) , b should be the new amount that I enter , is it correct and does it get the parameter that I am entering for b at the moment ?

RE: how to write a rule for this relation ?

It should work for you. The {} are used to add multiple lines to the if statement. I dropped an i=3 into the code below to illustrate.

Create a length parameter called b and an angle parameter called a using the F(x) button.

copy paste this code into a rule.

/*Rule created by dbezaire 06/02/2014*/

let i_len (length)
let o_ang (angle)
let i (integer)

/* Inputs */
i_len = b

/* Evaluations */
if b > 25mm
{
o_ang = 360deg + 360deg/25mm * (b-25mm)
i = 3
/* use the bracket to add multi lines to if statement */
}

/* Oututs */
a = o_ang



A should = 432deg

Win XP64
21SP7/22SP5, 3DVIA Composer 2013X, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB

RE: how to write a rule for this relation ?

(OP)
Actually my function is a sinus , like :


y=r * sin(a/c*x)

and my parameters :

r : Length
c: Real
x : angle ( i tried both radian and degrees , no difference )
y : length
b: length , that is the guide curve of law : x axis

and my rule :

let b (length)
let a (angle)

if b > 1000mm
a=360deg +360deg/1000mm*(b-1000mm)

else if b == 1000mm
a=360deg

else if b < 1000mm
a=360deg + 360deg/1000mm*(b-1000mm)

this works for small amounts of b , there is a compromise between c and b , looks like !! when b is very big , like 1000 mm you can not select c big like 1/60 , you see that the function doesn't have actually a sinusoidal shape !!

my question is :

why ?????????????????????????????????????????

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources