Bessel function accuracy

From a side-by-side comparison with results generated by both Maple and MatLab, I realized that although the output of the VI "evaluation of Bessel J function" is a double-precision array, the accuracy is only up to single precision. Is there any simple way to increase the accuracy to double precision?

Hi George,
I just tested out the Bessel Function Jv(x) evaluated at J0(0) and you are absolutely right! In LabVIEW 6.1, it does seem that the function is only accurate up to a single precision.
The Bessel Function Jv(x) VI has been corrected in LabVIEW 7. The function returns 1.0000000000000000 as expected. I would suggest upgrading to LabVIEW 7. If you do not have a newer copy of LabVIEW and would need to purchase an upgrade, talk to the Customer Service Representative (CSR) for your area or contact any CSR at (888)280-7645 regarding this issue and they might be able to help you out.
I have attached screenshots of the output of the Beseel Function Jv(x).vi for both LabVIEW 6.1 and 7.0 for your interest.
Thanks again.
Kileen C.
Applications Engineer
National Instruments
Attachments:
bessel_LV61.GIF ‏20 KB
bessel_LV70.GIF ‏20 KB

Similar Messages

  • Bessel function best fit

    Hi all,
    Quite new to LabVIEW. I am capturing diffraction images that are described by Bessel J functions. The maxima of the diffraction correspond to the maxima of the Bessel J functions ( or zeros of 1st derivative).  I wish to fit the diffraction image intensities to a Bessel J function , pixel value -> best fit to x in J(x). Has anyone previously done this before? I know the order n of the Bessel function but not necessarilly the pixel where x=0.
    Similarly, I hope to fit the diffraction image of a pinhole which is an Airy Disk to use as calibration ie pixel -> m^-1.
    Any help or suggestions would be gratefully accepted.
    Regards,
    Leeser 

    Leeser,
    Considering you are relatively new to labVIEW, your program was very well structured and seems to approach the problem in the right manner. As you correctly guessed right from the beginning, no-one it seems has attempted fitting a Bessel function to their data. The 'best-fit' VI's found in the 'Fitting Pallette' are more generally concerned with parametric, powers and exponential type functions, rather than more complex differentials such as the Bessel. In cases similar to yours, it seems that people haave tried adopting the Levenberg-Marquardt algorithm which is a Non-Linear Fitting VI found in the Fitting Pallette. This is the Lev-Mar VI which Kristie Elam reccomended you using for the Airy disc. This function allows one to define the equation with which they wish to fit their data, but due to the complexity of the Bessel function, this may be quite tricky.
    I have been working on an example VI which provides the basic structure of what you need to implement in to your program. The Bestfit VI converts a picture using the IMAQ functions and then plots the converted data. You can manipulate the row control to choose which row of pixels you wish to analyse. The VI then calls the Lev-Mar Best Fit function which in itself calls the Bessel Formulae VI which is a template for the Bessel Formulae that the Lev-Mar function will use in its best-fit approximation. It is within this VI that you will need to enter the neccessary formulae to produce your theoretical Bessel function. The Lev-Mar Bestfit function can then use this data to plot a Least Squares Best Fit approximation against your spectrum.
    Aswell as the Bestfit and Bessel Formulae VI's, I have attached a Gaussian Example VI which gives a complete example of a Bestfit approximation using this method. Furthermore, I have attached a couple of VI's that I found which I hope may help you to develop the Bessel formulae. These include a table of Bessel roots, which you may be able to use to produce a table of the derivative roots, those found on your schematic.
    I really hope this information and the files I have attached will be of use to you, I'm just sorry there isn't a direct tool with which you can produce the bestfit approximation. Keep me posted on your progress as I've been working on this for a few days now and would like to see how it goes!
    With regards to the Airy disc, I would keep on with the files that you received from Kristie Elam, hopefully using the same method with both the Bessel functions and Airy disc might make things easier for you.
    I hope this informtaion is of use to you, best wishes and good luck!
    Rob
    Rob L
    NI Applications Engineer
    UK & Ireland
    It only takes a click to rate this message ;-)
    Attachments:
    Bessel Bestfit.zip ‏98 KB

  • Complex Bessel functions in LV 2009?

    Can anyone please clarify whether the Bessel functions in LV 2009 operate on complex inputs and give complex outputs? The "Help" text mentions only real outputs.
    A quick test on the Bessel function Jv of zeroth order seems to indicate that it accepts a complex input but delivers a real output. Does it just ignore the imaginary part of the input?
    Any input much appreciated, thanks!
    Peter
    Solved!
    Go to Solution.

    Hello Peter,
    LabVIEW MathScript can support real-order Bessel functions with complex inputs.  Reference the help for the bessel_j function, in particular.
    Grant M.
    Senior Software Engineer | LabVIEW MathScript | National Instruments

  • Reverse Geocode function accuracy...

    Hello everyone
    I have Oracle 10g R2 on windows.
    The setup is as follows: a GPs device sends data ( longitude/latitude )to a table (LOG) and I need to reverse code the coordinates. in another table (GEOCOD4)
    I have addresses associated with lat/long coordinate pairs.
    There is a spatial index associated with the geocod4 table...
    I am having a problem with the accuracy of this spatial query:
    SELECT /*+ordered*/
    address
    into vaddrs
    FROM geocod4 c
    WHERE sdo_nn (c.location, SDO_GEOMETRY(2001, 8307,
    SDO_POINT_TYPE (plat,plong,NULL), NULL, NULL), 'sdo_num_res=1')= 'TRUE';
    I sometimes get addresses that do not correspond to the points actual position...
    Any ideas as to why? is the query wrongly formulated?
    Thanks in advance.

    Bump....

  • Accuracy of the get timestamp function accuracy +/- 16 ms??

      I'm using the "Get Timestamp Function" in my vi to mark time in my file roughly every 30 seconds.  The problem I am seeing is that it seems sometimes it is 16 ms off.  Sooner rather than later.  Do I need to mix this with the get time in seconds function?  I would like consistant values in my file.
    Thanks,
    Chris
    Message Edited by caunchman on 12-09-2008 03:28 PM
    Attachments:
    Cont Acq&Graph Voltage - Write Data to Spreadsheet File (CSV).zip ‏74 KB

    Hi Chris,
    this function is based on Windows timing functions and those only update each 16ms... So you cannot use this function to measure time in higher resolution than 16ms!
    Some more thoughts:
    - You have a deviation of 16ms after your mentioned 30s interval: that's an error of only ~0.05%. How accurate is the timing of your PC? How accurate (in terms of exact timing) are other processing steps of your program?
    - Maybe Wiebes vi may help you...
    Message Edited by GerdW on 12-09-2008 10:42 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Reference of the Bessel Equation

    I need to know where the Bessel equation (theoretical, cited in the Help file) was taken from.

    Hello Yossi Zana �
    It appears you are looking for the specific mathematic equation used in one of the Bessel VIs. I recommend you open the sub-VIs of the particular Bessel function you are interested in by double clicking on the VI. One of the sub-VIs will call a dll which contains the theoretical equation used.
    You can also review the LabVIEW Analysis Concepts pdf file found in Help >> Search the LabVIEW Bookshelf and selecting the link to this file under the Concepts and Techniques Header.
    If you would like me to further investigate a Bessel equation, please let me know which Bessel VI you are interested in. Have a great day!
    Becky B.
    Applications Engineer
    National Instruments
    Becky Linton
    National Instruments
    Field Engineer
    Office: 734-464-2463
    Cell: 248-709-2822
    Email: [email protected]

  • Same code gives different results in Matlab Script in Labview and Matlab

    I am implemeting a Matlab code into a LabVIEW application using Matlab script. When I import the exactly same code to the Matlab Script in LabVIEW it gives a different result than it is in Matlab. This code is a simulation code including first kind bessel functions. Using LabVIEW 7.1 and Matlab R14 service pack 3.

    Labview 8.5
    Matlab R2009b
    Attached are the graphs produced by matlab script in labview and in matlab.
    The minimum of graph produced by matlab code is below 1 and that in labview is above 1.
    Thanks a lot for your reply.
    Sorry, I haven't quantified the "sometimes" yet. 
    Attachments:
    matlabsResult.jpg ‏29 KB
    LV.png ‏84 KB

  • Double imprecision?

    is there imprecision with double data types? last night I was doing a topcoder.com competition (which is over now) where the 500 point problem involved double variables which you had to multiply divide. even in the question it said: "Watch out for double imprecision. The expected number of sales per month, without rounding, is exactly 36091." when I tried that porblem, mine would get all the results right but would get 36091.0001 or something like that. where can I find more information on this?

    Hi Rahde,
    I think you mean "double precision". The term is a holdover from FORTRAN where doubles had twice as many bytes as floats. You can represent larger (and smaller) numbers with doubles.
    If you write a function like a zeroth-order Bessel function of the first kind J0 with floats, the values will degrade quickly for large arguments. Doubles will represent the function faithfully longer.
    People who do scientific computing will usually write their code using doubles.
    A Google search using "double precision" will turn up a lot. This isn't bad:
    http://systems.webopedia.com/TERM/D/double_precision.html
    HTH - MOD

  • No PS9.0_SDE & SIL Mapping to load Historical PS E-Perfor data into OBIEE

    Hi Folks,
    we have the latest BI environment OBIEE 10.1.3.4.1 and using PeopleSoft 9.0 as the source.
    The Peoplesoft 9.0 has new set of E-Performance tables when compared to older Peoplesoft tables.
    so when the systems were upgraded from Peoplesoft 8.2 to 9.0, the historic E-Performance data is not there in the new PS 9.0 E-Performance table.
    when this PS9.0 is processed into OBIEE, the OBA Warehouse contains only New e-perf data and NO Historic data.
    i went through all the mappings and did not find any mapping related to load the Historic data. the SDE_PSFT_90_ADOPTER contains mappings only related to new Peoplesoft tables. is there any mapping related to this? or a new customized mapping has to be created.?
    New Peoplesoft9.0 table: PS_EP_APPR and PS_REVW_RATING_TBL
    OLD PeopleSoft table: PS_Employee_review
    and in OBAW, the table that is populated using the new table is w_wrkfc_Evt_f (NRMLSD_PERF_RATING column) and Performance Band Code
    your suggestions are appreciated
    thank you

    Had a similar issue at my current client. If you check the PSoft upgrade docs, Oracle actually had no upgrade path for the PS_EMPLOYEE_REVIEW table as the effective date logic for this table is ambiguous. Here is an excerpt:
    The existing Employee Review family (PS_EMPLOYEE_REVIEW) stores both the Commercial and Federal reviews/appraisals. After analyzing the key structure and functionality of the Employee Review structures, it was realized that there is no way to upgrade this data into the new ePerformance (PS_EP_APPR) key structure with any certainty of functional accuracy. This is because the keys to PS_EMPLOYEE_REVIEW are:The fact that PS_EMPLOYEE_REVIEW is effective-dated, and its FROM/THRU dates attributes are both optional, make it almost impossible to translate into PS_EP_APPR's required Period dates. Even the fundamental question of “What does a new effective-date mean?” is ambiguous
    I also checked the OBIA 7.9.6 mappings, the PS_EMPLOYEE_REVIEW table is not brought in. Only the PS_EP_APPR table is used as a source for the SDEs. I even checked the PSoft 8.8 mappings, and cound not find it there either. We had to customnize the existing ETLs to extract from the PS_EMPLOYEE_REVIEW table.
    Ahsan

  • Lev-mar fitting in diadem

    Hi,
    I'm completely new to DIAdem.  I'm surprised that - from what I can see - there's no Levenberg-Marquardt (or equivalent) fitting routine for parametric fitting to nonlinear functions.  Is this right?  How can I give DIAdem this functionality?  Is Xmath an option for accomplishing this task?
    Nick
    "You keep using that word. I do not think it means what you think it means." - Inigo Montoya

    Hi Nick,
    It is possible to call LV DLLs from a GPI-DLL, you just need to have the LV runtime engine on that computer and also put one other file in the Windows System directory-- but I forget now which it was.  I did this 4 or 5 years ago with a Bessel Function from LabVIEW.  The GPI-DLL framework is extensive, and it's easy to get lost in it, but if you can run the GPI-DLL wizard, the boiler-plate code is super easy to create.  And if you can find the right callback function, you only need to add about 10 lines of code to call an external LV DLL.  Don't rely on the heap for memory, though, or you will limit the array size you can process-- use MAlloc just like you would in a normal C++ program.
    I don't think I remember anything else,
    Brad Turpin
    Product Support Engineer
    National Instruments

  • Expected (wrong?) results from Express VI - a bug?

    Using a Lab-Vierw supplied example made with express VIs fro signal egneration and ifltering.
    MOdified the express VI so that instead of using a Butterworth lowpass it would use a Bessel with
    variable order (variable # of poles).
    Unexpecte result: when choose corbner freq = 1 KHz and drive with 1 KHz signal, I should get
    output = 0.71 times input since at the corne freq, the output shuld be 3 dB down.
    And I do get that result with a BUtterworth (all orders tried) or with a Bessel, if the Bessel is 1st order.
    But for Bessel of order 2 or more, the attentiation is greater than expected, greater than it should be.
    Bessel with Fc = 1000 Hz:
    8 pole: Out/In = 0.18 when f=1000; Out/in=0.71 when f=500 Hz.
    4 pole: Out/In = 0.39 when f=1000; Out/In = 0.71 when f=645 Hz.
    2 pole: Out/In = 0.57 when f=1000; Out/In = 0.71 when f=790 Hz.
    1 pole: Out/In = 0.71 when f=1000 as expected.
    Is this a bug or is there another explanation?

    The KB that I posted does show the transfer functions for the LabVIEW implementation of the Bessel functions.  As WCR points out this does change what the cutoff frequency is actually referring to when using higher order Bessel filters.  The LabVIEW help should reflect what the actual definition of the cutoff frequency for each filter, but it does not.  I also checked the Chebyshev filter VIs and it does not refer to the ripple dB when specifying what the cutoff frequency is for that type of filter. 
    So, does the LabVIEW implementation of the higher order Bessel functions give results that might not be expected?  Yes.  Should the help files be updated to reflect this?  Probably. 
    One thing that I did want to point out is that you can view the transfer functions used for the different types of filters using the Filter Express VI.  If you open the configuration page and select the Transfer function as the View Mode, it will show how the transfer function looks for each filter.  If you select Butterworth, you can increase the order and see it lock on the -3 dB point.  If you select Bessel, you can increase the order and watch the curve shift to the left, decreasing the dB values at the cutoff frequency. 
    Andy F.
    National Instruments

  • Grapher and 3D Quicktime Movie Bug?

    Grapher (in the Utilities folder) is a great program for visualizing math functions. However, when I try to make a quicktime animation of a 3D function graph, it only generates the first frame of the animation, and the video is blank for the rest.
    Try animating a 3D example, for instance. Is anyone able to get this functionality to work?
    The animation does work for 2D graphs.
    I tried it again on a new user account with the same results.
    Any Grapher expert/developer read these forums?

    sunspeck,
    Terrific investigation you did. I am amazed you tried the window size out! I too am using Bessel functions for rocket engine work.
    I tried to repeat what you did, and only once did I get an animation out, with only 4 frames in it. This I could not do before.
    I tried to "play" the sequence first, to see if loading those in memory would help. That seemed to help a bit, but I only had some of my frames in a few of the tries. I also quit and restarted the program repeatedly. The window itself was smaller than the in-window controls would fit, and still no luck again.
    I don't know if this would help an Apple developer on this, but I did notice that in the latest version (Leopard?), the frames are not stored in memory like before, so the animation never speeds up after going though them all. This is a difference from a version a while back, which played them fast (with shading).
    This is quite the bug!

  • Compiling Problem Java Project Exception

    It's my java code that include nativfe methot.I compile it javac Bessel.java
    And I wanted to jni.h file javah -jni Bessel but I had an exception
    C:\Documents and Settings\TTG\Desktop>javac Bessel.java
    C:\Documents and Settings\TTG\Desktop>javah -jni Bessel
    error: cannot access Bessel
    class file for Bessel not found
    javadoc: error - Class Bessel not found.
    Error: No classes were specified on the command line. Try -help.
    ***** What must I do *******
    public class Bessel
    // Declaration of the Native (C) function
    private native double s17acc(double x);
    static
    // The runtime system executes a class's static
    // initializer when it loads the class.
    System.loadLibrary("nagCJavaInterface");
    // The main program
    public static void main(String[] args)
    double x, y;
    int i;
    /* Check that we've been given an argument */
    if (args.length != 1)
    System.out.println("Usage: java Bessel x");
    System.out.println(" Computes Y0 Bessel function of argument x");
    System.exit(1);
    // Create an object of class Bessel
    Bessel bess = new Bessel();
    /* Convert the command line argument to a double */
    x = new Double(args[0]).doubleValue();
    System.out.println();
    System.out.println("Calls of NAG Y0 Bessel function routine s17acc");
    for (i = 0; i < 10; i++)
    /* Call method s17acc of object bess */
    y = bess.s17acc(x);
    System.out.println("Y0(" + x + ") is " + y);
    /* Increase x and repeat */
    x = x + 0.25;
    }

    C:\Documents and Settings\TTG\Desktop>javac Bessel.java
    C:\Documents and Settings\TTG\Desktop>javah -jni Bessel
    error: cannot access BesselMy guess would be that you set the env var CLASSPATH and that you did it wrong.

  • OBIEE+ w/ Peoplesoft, Peoplsoft Organizational Hierarchies tree into OBAW

    Hello,
    the environment is OBIEE+ BI Apps w/ PeopleSoft HCM as source
    with Prebuilt informatica mappings, to import Organizational Hierarchy tree from Peoplesoft HCM into OBAW tables, the DAC has task parameters to be set.
    as per BI Apps documentation, we have to set a parameter in DAC and also can set multiple parameters here i.e. SETID~TREENAME in DAC with comma separated.
    my doubt is, if i give multiple parameters(Mulitple tree names) in DAC Task, how is that Hierarchy data from multiple trees loaded into the DW and how is it presented while reporting.
    i didnt find any information on this in BI Appds documentation or in google.
    my requirement would be to configure a Organization Hierarchy tree which will contain Organization Name>Division name, Division number>Sub division name, sub division number> department name, department number> location name, location number etc
    please help
    thank you
    kumr

    Had a similar issue at my current client. If you check the PSoft upgrade docs, Oracle actually had no upgrade path for the PS_EMPLOYEE_REVIEW table as the effective date logic for this table is ambiguous. Here is an excerpt:
    The existing Employee Review family (PS_EMPLOYEE_REVIEW) stores both the Commercial and Federal reviews/appraisals. After analyzing the key structure and functionality of the Employee Review structures, it was realized that there is no way to upgrade this data into the new ePerformance (PS_EP_APPR) key structure with any certainty of functional accuracy. This is because the keys to PS_EMPLOYEE_REVIEW are:The fact that PS_EMPLOYEE_REVIEW is effective-dated, and its FROM/THRU dates attributes are both optional, make it almost impossible to translate into PS_EP_APPR's required Period dates. Even the fundamental question of “What does a new effective-date mean?” is ambiguous
    I also checked the OBIA 7.9.6 mappings, the PS_EMPLOYEE_REVIEW table is not brought in. Only the PS_EP_APPR table is used as a source for the SDEs. I even checked the PSoft 8.8 mappings, and cound not find it there either. We had to customnize the existing ETLs to extract from the PS_EMPLOYEE_REVIEW table.
    Ahsan

  • Quantifying absorbance in LabView from amplitude.

    I am currently trying to develop a way to convert amplitude to absorbance, and to be honest I am not sure if this can be done using LabView.  Can this even be done?

    Hi,
    LabVIEW can do almost any math operation (spherical bessel functions, etc...).  So, as long as you can develop an algorythm that is: absorbance as a function of amplitude (Y = Absorbance(amplitude)) you will be fine. 
    I assume that amplitude is a acquired signals value.  Just work the algorythm, and then push the acquired data through your analysis routine before displaying on a graph, writing to a file, or whatever your use case is.
    Let me know if you have any questions.
    J

Maybe you are looking for

  • Flickr doesn't work in this version - How can I Downgrade to a version that flikr works?

    Many of the buttons on the Site Flickr don't work in this version - How do is Downgrade Firefox to an earlier version so I can use flickr. - The buttons work fine with the same account on other browsers. They worked fine in the earlier version. I tra

  • Suggestion for a photo gallery upload solution...

    Hi All i want to add a section to a site that allow users to register and then upload photos to a gallery. i needs to allow for a little bit of styling and have file size upload limits, ect. can anyone suggest / recomend either an DW extension or oth

  • Breaking line in column header

    Hi,everybody How can I break the line in column header for two lines? Regards, Michael

  • Error when posting to Web Gallery

    I am getting an error that says "request to the server failed" whn attempting to use the web gallery option? Message was edited by: tropaz

  • Inactive/Hidden ical

    I can see the icon for ical but it is grey (inactive), therefore when I click on it, it doesn't open. I have searched for ical, found it in applications, clicked on it - nothing! So i dragged a copy from library to desktop and restarted - no joy. The