LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Is MathScript what I need?

My algorithm involves the following vectory mathematics:

(1) Define two vectors.
(2) Cross product the two vectors to create a normal vector.
(3) Add three vectors.

(You get the general content of the program)


The data that MathScript will use will be continously changing, and coming from another algorithm that I programmed.

I'm sure MathScript is capable of doing this, but I'm not sure if it's the most efficient. I read that MathScript is quite slow in some conditions, and I'm not sure if this is one of them. Is there another way of doing such operations in LabView that will be quicker?

Thank you,
Alex


Message Edited by ap8888 on 07-10-2008 09:25 AM
0 Kudos
Message 1 of 5
(6,766 Views)
I've realized that an example will probably demonstrate my concern over my approach.

Say I have a scalar "r". I want to define a vector A=rcos(pi/2)i + rsin(pi/2)j

Already, it seems like using native LabView functions will be a burden to do this a bunch of times. In Mathscript, such a thing is easy!

What do you think?


Message Edited by ap8888 on 07-10-2008 11:03 AM
0 Kudos
Message 2 of 5
(6,758 Views)


ap8888 wrote:
Already, it seems like using native LabView functions will be a burden to do this a bunch of times.
Why? Seems quite trivial. You could even make it a subVI.
 
Since you mentioned "cross product" I assume you are in 3D but this is now more of a 2D problem.
 
I think you have the parenthesis mixed up, because:
 
A=rcos(pi/2)i + rsin(pi/2)j = r * j
 
Do you possibly mean
 
A=rcos(i * pi/2) + rsin(j * pi/2)
 
for example?
 
What is i and j? If this is all in 2D, you could use complex numbers.
0 Kudos
Message 3 of 5
(6,750 Views)
altenbach, i and j are meant to be unit vectors.

Actually (and I should have mentioned this), my vectors are in 3D. So a general form of my vector is:

A=[a]i + [b]j + [c]j

What I'm worried about is the creation of these arrays/vectors. My "a", "b", and "c", for example, won't just be scalars; they'll need to be taking outside variables to be calculated. But when I create an array in LabView, it seems that I can only enter scalar values.

I'm likely missing something major here...




0 Kudos
Message 4 of 5
(6,745 Views)
You can make a 3xN 2D array, for example.
 
You could also make a type definition of a cluster with three elements (a,b,c), and then make an array of those. Now you can also define subVIs for atomic operations with them. There are many possibilities.
0 Kudos
Message 5 of 5
(6,727 Views)