LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with array

Hi altenbach,
 
 
I have taken some help from my tutor in developing a code for Matlab that actually plots the given unsorted data as Yaw(CP, CY) and Pitch(CP, CY). Please find enclosed Matlab file that does it. In the file, F_Phi is coefficient of Yaw (CY) and F_Alpha is coefficient of Pitch (CP). Is there any way we could employ the math used here in LabView?
 
 
Regards,
ViHAR.
0 Kudos
Message 21 of 30
(3,213 Views)

I currently don't have matlab installed, but your code works fine in mathscript (LabVIEW 8.2).

Even plain LabVIEW should not have any problems with graphind the 3D surface, as you could see in my ealier example. The only problem was with fitting because of duplicate Z values. Since the Z values are (seemingly) now unique, maybe the fitting will work too. have you tried?

0 Kudos
Message 22 of 30
(3,202 Views)
Hi altenbach,
 
 
I will try again and let you know.
 
 
Thanks,
ViHAR.
0 Kudos
Message 23 of 30
(3,195 Views)

Hi altenbach,

 

I have checked again. Tried increasing the precision of values in all arrays up to 8 digits, however, I guess I am only changing the viewing resolutionSmiley Surprised. Does the code calculate the polynomials with a similar resolution?

Also, if you compare the surface obtained by the LabView code with that of Matlab, it is quite clear that there is some error, and the X-Y pair does not have duplicate Z values Smiley Sad. I am attaching screen shots of the two surfaces obtained in Matlab.

Hope this helps in ascertaining the root of the problem.Smiley Indifferent

 

Thanks,

ViHAR.

Download All
0 Kudos
Message 24 of 30
(3,181 Views)

I am not familiar with the guts of the griddata function, but I think it is safe to assume that it does NOT fit to polynomials, but just does some local triangulation. Not sure about that, though.

Unfortunately, your data in the m file has a weird mix of spaces and tabs as seperators, but once it is cleaned up, it seems to fit quite well with a 3rd or 4th order polynomial using my old code.

See attached. There are a few outliers (e.g. phi~30) but you could change the axes for a tighter range

Message Edited by altenbach on 09-11-2007 09:20 AM

Download All
Message 25 of 30
(3,164 Views)
Hi altenbach,
 
 
Yes, I agree it does work well with a polynomial order of 3. However, I suspect a confusion with how the coefficients have been named, and especially how they have been probe to changing constantly.
 
Like I mentioned in an earlier post F_alpha (or alpha, as you call it) is nothing but Coefficient of Pitch (or CP) and F_Phi (or Phi, as you call it) is nothing but coefficient of yaw ( or CY). I know this adds to the confusion and apologise for it. But, this concept is historically diseased with people trying to use their own terminology.
 
<<F_alpha is means f(alpha), where alpha is pitch in a different terminology... so f(alpha) becomes coeff of pitch... and so on....>>
 
Now I don't want to confuse you any more, so we'd better stick with the initial terms... 'coeff. of pitch' & 'coeff. of yaw', which are the only two remaining plots ('coeff. of total pres.' and 'coeff. of dynamic pres.' have been apparently plotted in the last version of your code, so no point in mentioning them now).
 
I will try and substitute the values of the appropriate coefficients in your code to see how it plots the surface.
 
 
Thanks,
ViHAR.
0 Kudos
Message 26 of 30
(3,148 Views)
Hi again,
 
 
Further to my previous post, I tried substituting the appropriate coefficients into the code. However, just like in earlier versions, the 3-d plot apparently shows multiple z for same xy pairs (at least that is what it looks like, however it could be false if watched closely). Also, if the same set of values were plotted in Matlab, the attitude of the surface would follow the direction as indicated by the red arrow in the enclosed image. Please comment.
 
On the other hand, the surface obtained with poly order of 3 with 3DPoly_Newdata.llb as you had suggested in your post dated 09-11-2007 11:19 AM is the same as that obtained if matching axes are plotted in the last successful version 3DPolyFitFULL3D_select3.llb
 
Have I gone wrong in assessing the code?
 
 
Regards,
ViHAR.
0 Kudos
Message 27 of 30
(3,145 Views)
Well, I don't really know what you are saying. You can name the data anything you want, and it won't affect the outcome. I named it alpha short for f(alpha). You can easily change the names for the data by changing a few labels and diagram constants.
 
I plotted (and fitted) Yaw (f(alpha),f(phi)) and it look exactly like your image (except for that spike in the center):
 
 
(same for the pitch plot).
0 Kudos
Message 28 of 30
(3,133 Views)
Hi altenbach,
 
 
Okay, I have realised my mistake. Apologies again for adding to the confusion. I will need to reorganise and and discuss the Matlab routines with my team. Will get back in a few days.
 
 
Kind Regards,
ViHAR.
0 Kudos
Message 29 of 30
(3,125 Views)
Hi altenbach,
 
 
I did not have to go back to my team. Checked the values myself and found a silly error that I had made with the values. Thanks to you, that I realised it. When the data is correctly organised, I now have all four three dimensional surface plots, with their polynomial equations, just like I initially wanted.
 
It is now time to test our calibrated probe using these calibration surfaces and polynomial equations. So everything seems to be working perfectly for the time being.
 
Many thanks for your help. Wasn't possible without it!
 
 
Best Regards,
ViHAR.
0 Kudos
Message 30 of 30
(3,121 Views)