LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining equations with 3D graph

This is what I'm trying to do but I'm not too certain whether it's doable in Labivew or not.

Basically I have a program which collects bunch data points and insert them into arrays.

The 3 sets of arrays I have are:

Water Weight
Water Ratio
Reflectivities

Basically there are 1 WW and 1 WR array for each reflectivity. (ie. for 10% reflectivity there's a 1D WW array and a 1D WR array). So really the reflectivity array is just some constant numbers used for the sake of implementing the 3D graph.

I want to plot these arrays in a 3D graph. Right now I'm using 3D parametric graph instead of 3D surface graph b/c surface graph doesn't seem to work with the restriction of 2x 1D array and 1x 2D matrix. (Unless someone has a suggestion?)

I managed to plot the data points on the parametric graph. Basically if you plot the WW and WR in 2D you get a polynomial curve. So in 3D you get a surface of bunch polynomial curves.

Now what I want to do is able to select a specific reflectivity value on this 3D surface and get an equation for this particular polynomial curve at this reflectivity. Is this doable in Labivew at all? Helps would be much much appreciated. Thanx.
Message 1 of 40
(4,601 Views)
Anything is doable in LabVIEW! 🙂

Once you select a slice, you basically have data for an XY graph. Put the x and y arrays into the general polynomial fit VI to get the polynomial coefficients. Now you just need to format the coefficients in the form of an equation. Let us know how far you get. 🙂
Message 2 of 40
(4,572 Views)
Thanx for the reply.

I've attached what I have right now. It's very very basic.

How do you slice a 3D graph data into a 2D data/array?
0 Kudos
Message 3 of 40
(4,565 Views)
OK, I made a quick polynomial fit example that formats the resulting equation (LabVIEW 7.1).
Message 4 of 40
(4,563 Views)
Darn I only have 6.1. 😞

Is using parametric graph the right way or should I look into using surface?
0 Kudos
Message 5 of 40
(4,561 Views)
Here's the 6.1 version.

I had a quick look at your VI. I think you have to draw the graph only once outside the loop, not over and over again (And wire the arrays directly, not via local variables. In the loop, select your slice and extract your two 1D arrays and fit them. Use an event structure, so it only happens when something changes. Sorry, I'm not very familiar with the 3D stuff. 😞
Message 6 of 40
(4,553 Views)
Oops I guess you misunderstood me. I got the polynomial part to work no problem (It's in another Sub-VI in the main program).

Right now I'm just not too sure how to take the data from the 3D graph and slice at specific reflectivity point to get a 2D array.

The while loop is there so I can continuously change the values (just for testing purposes).
0 Kudos
Message 7 of 40
(4,554 Views)
Hi Honeywell,

Christian got you past the hard part.

If you post a version of your Vi that has your data saved as defaults we may be of greater assistance.

I looked at your plot and the surface seems a bit unusual.

Using the parametric plot is probably OK.

When you post your VI WITH DATA please include a image(jpg) on the FP panel that illustrates what you parts you want to grab for example.

It is a very slow operation getting data from a 3-d plot (you thought drawing it was slow) so you want to work with your input data and not try to get the data from the graph.

Cursors can be added to the graph that will let you define which slice you want.

So....

Post some interesting data and someone may be able to step in and help.

Ben

PS If this is still un-answered tomorow AM, I will see what I can do.
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 40
(4,544 Views)
OK, got it. I am also not very familiar with 3D graphs.

Here's an alternative:

You could e.g. get all unique reflectivity values (assumed as Z here) into a ring (if there are not too many!), then simply extract all X and Y into 1D arrays that correspond to that Z. Then Fit. See attached simple implementation.

I placed some fake data into the arrays for testing. Z is only 1 or 5. Modify as needed.

Message Edited by altenbach on 06-10-2005 01:10 PM

0 Kudos
Message 9 of 40
(4,543 Views)
Wow thanx for the fast responses. I really appreciate it. 🙂

Ok let me explain the program a little bit. Basically "Read Grid" moves a computerized linear stage system so the program can collect data at different parts of the sample. The sample is placed on a plate which holds 8 different reflectivity backings (2%-99%) and an empty slot. The sample is wetted and dries up as time goes by. The program collects the sample weight and the measurement data, does some calculation to spit out WW and WR. Since there are 9 different reflectivities I have each WW and WR saved in arrays (so 18 arrays in total).

When the program is done one can analyze the data by clicking "Fit Data." Basically this sub-vi plots the 9 sets of data, does polynomial fits to each and finds the polynomial constants for each reflectivity.

Now it's necessary to be able to predict polynomial constants within the 2%-99% range (for example, say we want 13%). This is why I need to be able to plot a 3D surface/parametric graph, select the reflectivity value I want, and find out the polynomial constants for that specific reflectivity value. Basically you would have a surface that looks something like this:

http://www.leeds.ac.uk/iss/documentation/beg/beg28/beg2802.gif

So yeah the VI I attached previously doesn't have the right surface look.

Here's the screenshot for Read Grid.vi while it's running. Note, the data are kinda nonesense right now:

http://photobucket.com/albums/y218/Tawcan/?action=view&current=screenshot.jpg

Here's the screenshot for plotting 2D graph and finding polynomial constants:

http://photobucket.com/albums/y218/Tawcan/?action=view&current=screenshot1.jpg

I've attached a sample data text file so you would have an idea.
0 Kudos
Message 10 of 40
(4,533 Views)