Why doesn't my non-linear curve fit finish?

I am working with an experiment that gives me X- and Y- data that I need to fit to a theoretical model (somewhat involved). I use to do this in matlab using the "lsqcurvefit", which works fine,
but for varous reasons I need to do this in LabView instead.
So, first thing I did was to make a vi which is my theoretical model. I throw in my X-data and get the Y data out of it.
This vi works fine of it's own, but now I want to do my fitting by calling the model-vi from the Nonlinear curve fit.vi. I enter the same initial parameters, termination conditions, upper- and lower boundaries as in the matlab code, but no matter what, after some 100 function calls, the curve fit interrupts and tells me:
"Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi
Possible reason(s):
Analysis:  The system of equations cannot be solved because the input matrix is singular."
I have tried to locate the problem at varoious levels but I get confused when I start to look into the nonlinear curve fit vi, I just lose myself in tons of block-diagrams.. Can anyone see what my problem is? I'd sure appreciate it! I added the necessary files. Main vi: langevin fit. vi, then open the data.txt.
Thanks
Attachments:
langevin fit.zip ‏94 KB

Your model function does not produce anything resembling your data. As a first step, graph the data using your initial guesses, here's how it would look.
Here' the data and your initial guess on the same graph. You need to find initial guesses so the output resembles your data.
My best guess is that your model is faulty. It is very hard to debug, because it is a mess: deeply stacked sequence structures and unneeded local variables. Also the model parameter constants should be provided via the "data variant" input instead of a global variable. You have a weird mix of datatypes. Why is half of the stuff EXT instead of DBL for no reason?
I would also highly advise NOT to color your own VIs light yellow. Don't make them look like system tools!
I am busy today, but maybe I can have a stab at it tonight. Good luck!
Message Edited by altenbach on 07-06-2009 08:59 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
langevinFit.png ‏21 KB

Similar Messages

  • How to implement Non linear Curve fitting (lsqcurvefit of matlab) in Labview

    Hi Labview Team,
    I am looking a way to implement "lsqcurvefit" command of matlab in Labview to do some curve fitting ; basically to  Solve nonlinear curve-fitting (data-fitting) problems in least-squares sense, at present I couldn't find a better way to implement it. Can you please give me some suggestion on this to how to implement this " curve-fitting: on labview.
    Thanks,
    Ankit Gupta

    You did not say you have the mathscript module. Do you? In any case, labview has a rich set of native nonlinear fitting tools. This seems like a better option.
    LabVIEW Champion . Do more with less code and in less time .

  • Why doesn't the screens come up to finish my download?

    I have been trying to download Flash Player and the screens that I need to complete the download won't come up even though I have disabled my anti virus program. Why is this happening?

    http://forums.adobe.com/thread/1195540

  • Curve fitting only part of a waveform

    I am taking some data from an Oscilloscope and I need to do a curve fit.  As you can see from the data in the attachment the data begins at 0 and ends a 10e-6.  I just want to curve fit the part from 5e-6 to 10e-6.   This is what I have tried
    1) I take the waveform and use a "Get Waveform Components".  I then take the Y data and strip off the first half of the data from the array.  Then I  use a "Build Waveform" and put in the new Y data and the dt data to make the NEW waveform.  I then put it in to the Curve Fitting Express VI.  This works well for the slope, but of course the intercept is off because the data that was at 5e-6 is now at 0.  And the data at 10e-6 is now at 5e-6 since I stripped off the first 5e-6 of data and rebuilt the waveform.   I thought I could use the "t0" value in the "Build Waveform" to set the start of the NEW waveform to be 5e-6, but it seems that the "t0" is only for a timestamp (its a calendar data). 
    2) I thought about converting the waveform in to X and Y data because it would be easy to shift the X data by just adding 5e-6 to each value in the X array.  But then it wouldn't input to the Curve Fitting Express VI. 
    3) I thought about using the "Locations" input to the Curve Fitting Express VI, but I haven't really been able to get that to work. 
    Thanks for any help. 
    Solved!
    Go to Solution.
    Attachments:
    graph.jpg ‏128 KB

    Hello,
    Check out these examples and online docs relating to curve fitting. Perhaps they will be of some use.
     5th-order Curve Fitting Using Curve Fitting Express VI
    Linear Curve Fitting a Random Waveform Graph
    Overview of Curve Fitting Models and Methods in LabVIEW
    Introduction to Curve Fitting
    Best,
    National Instruments
    Applications Engineer

  • Universe.applyOverload Method Run non-linearly slower and slower

    Universe.applyOverload Method Run non-linearly slower and slower, that is, for the 10th user and restriction we add, this method runs 1 second, however, for the 80th user and restriction we add, this method runs 8 seconds.
    Customers think it's a bug for our BOE Java SDK method, could I know why this method is non-linear, and any way to improve its running speed.
    The following is the code, for interator 80 times.
    while (iter.hasNext())
                        user = (rpt_users_t) iter.next();
                        IOverload overload = (IOverload) newObjs.add("Overload");
                        overload.setTitle(user.getBoezh().trim());
                        overload.setUniverse(universe.getID());
                        overload.setConnection(connectionID);
                        overload.getRestrictedRows().clear();
                        overload.getRestrictedRows().add("HZB0101_T","HZB0101_T.BRANCH_COMPANY_CODE='3090100' AND HZB0101_T.DEPARTMENT_CODE='"+ user.getBmdm() + "'");
                        overload.getRestrictedRows().add("BM_T","BM_T.DEPARTMENT_GROUP_CODE='" + user.getBmzdm().trim()+ "'");
                        infoStore.commit(newObjs);
                        // Commit to User
                        IInfoObject everyone = (IInfoObject) infoStore.query(
                                  "Select TOP 1 SI_ID " + " From CI_SYSTEMOBJECTS "+ " Where SI_KIND='User' " + " And SI_NAME='"+ user.getBoezh().trim() + "'").get(0);
                        int everyoneID = everyone.getID();
                        universe.applyOverload(overload, everyoneID, true);
                        //infoStore.commit(objs);
                        System.out.println(user.getBoezh() + " loading...");

    When invoking applyOverload multiple times, it's O(N^2) if you're granting rights to a User or UserGroup. 
    When granting, the applyOverload method retrieves all Overloads applied to the Universe and walks across each one,  granting the identified ones and removing rights from others.
    Sincerely,
    Ted Ueda

  • Confidence bounds for non-linear fit

    Is it possible to get the confidence bounds for the fitted coeficients when using non-linear fits?

    Hello Dahl
    Do you mean like Upper Bound and Lower Bound output terminals of NI_Gmath.lvlib::Nonlineat Curve fir intervals.vi?
    Message Edited by Eirikur on 01-09-2008 01:25 PM
    Regards,
    Eirikur Runarsson
    Platinum Applications Engineer
    NI Denmark

  • Fit non lineare basato su una funzione f(x)

    -Sto cercando di fare un fit non lineare su una curva. La funzione che utilizzo per il fit è il prodotto di una lorentziana per un polinomio del terzo ordine x un totale di 7 parametri (3 x la lorentziana e 4 x il polinomio).
    Il problema è che il fit non mi soddifsfa affatto. Sarebbe forse utile dare ai parametri un range limitato di valori (almeno x l'ampiezza della lorentziana) entro il quale variare ma non saprei proprio come fare(..e se si possa fare..)
    -Esiste un altro modo x risolvere il problema?
    -E se il numero di parametri salisse a 13 (3 lorentziane e un polinomio del terzo ordine) il calcolo del fit sarebbe ancora più difficoltoso?
    -Vorrei inoltre sapere, una volta assegnati i parametri iniziali, come il blocco proceda nelle iterazioni e cioè se continui ad incrementare il valore dei parametri fino a trovare l'ottimo o se si muova in un range che abbia come centro il valore iniziale dei parametri.
    Grazie

    Ciao Fortu,
    in questo documento puoi trovare informazioni riguardanti l'algoritmo utilizzato per determinare i coefficienti (a1, a2, ..., aM): What is the Difference Between the Two Levenberg-Marquardt VIs in LabVIEW? http://digital.ni.com/public.nsf/websearch/BACF6FDF1B40993686256CC300657BA4?OpenDocument
    Non è possibile, settare un intervallo di appartenza dei coefficienti ma si deve settare solo un valore iniziale. La precisione e la velocità del processo di fitting è fortemente determinato dalla scelta di questi valori iniziali.
    ciao buon lavoro.

  • "Linear" curve doesn't exsist in After Effects

    Hi! I can't do a simple LINEAR curve in motion in After Effects.
    Even when I select anchor of my curve and set "Make linear" i got this:
    I don't want to make "Easy Easy" curve. I want simple, linear which is going streight without any offset of motion.
    But this is impossible. I try 1 whole day and nothing. Everytime I got strange motion curves like screen above.
    But I want just have curve like that:
    How to do this? I repeat, a button like this doesn't work and causes strange curve shape lik 2nd screen above:

    Oh, for Heaven's sake.
    Here's an example in a 1280x720 comp:  the pixel in the uppermost left portion of the comp is 0,0.  The pixel in lowermost right portion of the comp is 1280,720.  The center of the comp is 640, 360.
    If you have trouble grasping this oh-so radical, 21-year-old concept, I STRONGLY recommend spending a LOT of time visiting the pages you will find here:
    Getting started with After Effects (CS4, CS5, CS5.5,  CS6, & CC)

  • Why doesn't the camera kit I bought fit into my iPad dock?

    Why doesn't the camera kit I bought fit into my iPad dock?

    Maybe you purchased the wrong item.
    iPads that have the 25 pin connector use the original Camera Connection Kit. That kit has two parts and adapter to allow you to insert SD cards and a second adapter to connect a USB cord from your camera. Here's a link to that kit:
    http://store.apple.com/us/product/MC531ZM/A/apple-ipad-camera-connection-kit?fno de=3a
    Newer iPads have the Lightning connector. You have two choices for those iPads. If you want to read SD card purchase a Lightning to SD Card Camera Reader.
    http://store.apple.com/us/product/MD822ZM/A/lightning-to-sd-card-camera-reader?f node=3a
    Or you can connect your iPad directly to your camera with a Lightning to USB Camera Adapter.
    http://store.apple.com/us/product/MD821ZM/A/lightning-to-usb-camera-adapter?fnod e=3a

  • Why doesn't my Lightning cable fit into the Ipod?

    Why doesn't my Lightning cable fit into the Ipod?

    Still wont fit. The latches that are supposed to catch aren't catching it. so i cant charge it. help

  • Linear Regression or Curve Fitting?

    Hi,
    I would like to perform linear regression operation over some data that I have collected during test. What is the difference between linear regression and curve fitting? Can I use curve fitting VIs available to perform linear regression? If no, where can I find VIs or information regarding linear regression in the LabVIEW 6i?
    Thank you for your help. It will save me many hours of search.

    there are some very good examples in the examples directory of LV. C:\Program Files\National Instruments\LabVIEW 6\examples\Analysis\regressn.llb\Regressions Demo for example. You must have a LabVIEW full development system.
    Stu

  • Why doesn't it say none when I am setting up my apple id for billing because I don't have a credit card or gift card at the moment

    why doesn't it say nome on billing when creating an Apple ID because I don't have a credit card or gift card

    Hello Lai5c,
    After reviewing your post, it sounds like you want to create a new Apple ID with no credit card attached. I would recommend that you read these articles, they may be helpful in troubleshooting your issue.
    Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method - Apple Support
    Why can’t I select None when I edit my Apple ID payment information? - Apple Support
    If you're using the store for the first time with an existing Apple ID, you must provide a payment method. After you create the account, you can change your payment information to None.
    If you're creating a new Apple ID, you might be able to create an account without entering your credit card details.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Why doesn't my pictures on my PC upload to my Ipad and Iphone.  Seems I have all my settings correct but none of my pictures are not showing up.

    Why doesn't my pictures show up on my Ipad and Iphone?  I have my pictures in the photostream upload folder but they do not seem to be uploading.
    Thanks.

    You will notice that in "My Pictures" folder you have a new folder called photostream. In photostream folder you will have another folder called "Upload" Anything you put in the "upload" folder will go to your phone and ipad. So just copy pics you want into that folder and they will go into photostream. I would not suggest moving them since I am not sure how it works on windows but there is a chance photostream might empty out the  folder after 30 days.
    On mac it automatically saves originals..

  • Why doesn't the Southwest Airlines DING app work?  I'm not getting any DING's.  Are they issuing none?  I used to get them on my mac but no more there, either

    Why doesn't the Southwest Airlines DING app work on my iPhone or iPad?  It used to work on my mac computer, but no more.  Are they shutting it down, or just not issuing many special fares? 

    Ask Southwest Airlines... it's their app.

  • How can I apply curve fitting to simple BER measurement data?

    I am collecting simple BER data from a communications receiver for modulations such as PSK, CPM, etc. The data looks good but has the usual measurement noise, which I would like to spiffy-up for customer presentations.
    I have tried virtually all of the vi's in the LV Fitting palette, with little or no success. One of the NI AE's provided me with a GP Fit approach, but it has problems when you introduce error. I have attached a vi which demonstrates this, and also shows an attempt on my part to use the Least squares vi, with various functional estimates of the erfc vi. The vi also includes sample data.
    I see MatLab (and possibly Wolfram) has a function specifically for BER smoothing, but NI doesn't, as best I can tell. I feel certain that one or more of the LV fitting vi's can be coerced into working with the correct parameters - but so far I can't find them!
    Has anyone tackled this problem with good results?
    One other thing - has anyone else noticed that the formula used by the LV erfc (complementary error function) is *not* the standard model used for BER/radio communications applications?
    Appendix B of Digital Communications by B. Sklar gives the conversion:
    Q(x) = 1/2 erfc (x/sqrt(2)), where erfc (x) is the LabView vi block.
    Thanks,
    Mark

    Hi Eric,
    Well, BER is just data measured at certain input levels to a receiver. For digital communications systems, we typically use Eb/No to specify the input signal strength, and measure the BER at that level. This is analagous to signal-to-noise ratio (SNR) measurements in the analog domain.
    The BER values tend to run from between .01 and 10E-5, or even 10E-9 for high performance systems. As a result of the wide range of BER values, it is usually plotted on a logarithmic (y-axis) scale. Values of Eb/No are in the range of a few dB, up to perhaps 15~20 dB. So the x-axis is normally 'linear', although in dB.
    I have attached the vi's again, and if you run the LS BER fit vi, you will see the data plotted. If you turn off the noise, you can see a very nice plot - the curve fit vi works fine. But if you add noise (which simulates what you would measure in a real system), and run it several times, you will see all kinds of responses - depending on the noise parameters. What I am looking for is something that gives me a nice smooth graph even with the noise turned on (which is what my real data looks like).
    Thank you,
    Mark

Maybe you are looking for

  • WorkSpace Studio as eclipse plugin

    I found a problem when my workspace studio installation is starting, and i found that the error is related to some bug on eclipse 3.2. The solution is easy. I have to replace or downgrade the version of the xulrunner library, but after doing that fir

  • Battery suddenly draining fast, phone warm/hot

    I've had the phone since December and never had an issue with battery life. It normally lasts all day with no interim charge and I use it on and off all day for Facebook, Yahoomail, texting. Starting this morning, the battery drained to nothing in le

  • Error Message when running BI Publisher

    Hi- Getting the following error message when running a custom report, report has been defined but still getting the error message in HCM 9.2 with PeopleTools 8.53 Template definition MAC_CONF_STM not found in the report definition. (235,2012) PSXP_RP

  • Strange problem with BPM

    I have BPM Blok1   Send Async step: Acknowledgement: Transport   Exception brach: CannotInsert   Deadline brach: Throw Exception CannotInsert Block2   Mapping   Send <b>BPM Monitoring</b> Mapping Workflow System Background work item created  13:33 Wo

  • Problem With Grid column

    Hi All,         I designed one Grid consist of five columns.In one of the column, i put the value 5 and i pressed the tab.Then it is showing some other value(Lik 203,125,456) instead of what i type. what is the Problem in that?? Plz let me know,urgen