LabVIEW MathScript RT Module

annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

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
Messaggio 1 di 5
7.194Visualizzazioni
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
Messaggio 2 di 5
7.186Visualizzazioni


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
Messaggio 3 di 5
7.178Visualizzazioni
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
Messaggio 4 di 5
7.173Visualizzazioni
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
Messaggio 5 di 5
7.155Visualizzazioni