Jump to content

EQUATION


Nullllll

Recommended Posts

Hi all ,

I have stepper motor program need ur help in one part of a small equation , ...

I have the equation : please look to the photo>>

I am using for loop for (i=0 ; i<N;i++)

x/N* i-10 =+10 Max

x/N*i_10=_10 Min

so if the result of the equation greater than 10 or not in range og -10 and 10 , it immedailty generate a value for x and N so it can satisfy the equation !!!! I mean if the user enter X it can calcualte Y in the range to get the correct equation , and notice (i) is the iteration of the for loop and N is the condition of for loop.

I mean the result of equation can be between +10 and _10 , I have used in LABVIEW in range in corece but it doesnot correct value of X and N if they are false ??

any help please so if the value not in range -10 to 10 it can correct it!!

Thnks

Link to comment

QUOTE(Nullllll @ Mar 14 2007, 06:49 PM)

I am using for loop for (i=0 ; i<N;i++)

x/N* i-10 =+10 Max

x/N*i_10=_10 Min

so if the result of the equation greater than 10 or not in range og -10 and 10 , it immedailty generate a value for x and N so it can satisfy the equation !!!! I mean if the user enter X it can calcualte Y in the range to get the correct equation , and notice (i) is the iteration of the for loop and N is the condition of for loop.

I mean the result of equation can be between +10 and _10 , I have used in LABVIEW in range in corece but it doesnot correct value of X and N if they are false ??

any help please so if the value not in range -10 to 10 it can correct it!!

I don't exactly understand what you're asking. It sounds like you have the equation:

(x/N) * (i-10) = y; where y has to be between -10 and +10

If y is outside the [-10, 10] range, you'd like to have LV find a value for x and N to make y in range. (ie, if y = -15, find values of x and N to make y = -10)

If this is correct, it's just algebra to determine your new value -- However, notice that you can't find values for both x and N -- This is a linear system and x and N have an infinite set of numbers that satisfy a given equation. Therefore, you'll have to hold either x or N constant.

So, for example, if you want to hold N constant, you can find x for the case y = -10 using:

x = (10*N)/(i-10)

So, have LabVIEW determine if your y is within range. If it's not, use another equation to determine a value of x (or N) which will satisify your equation.

Let me know if this isn't what you wanted.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.