Curve fitting function doesnt work

Hi all,
I am trying to do curve fitting, of a graphic. but curve fitting function doesnt work. i dont get any output from curve fitting.
what would u suggest me to do.
Thanks
Solved!
Go to Solution.
Attachments:
graph.jpg ‏642 KB
code.jpg ‏628 KB

You have been asked to post the code. We cannot troubleshoot pictures.
Are the X and Y arrays the same lenght? Is any value NaN? What does the error output tell you?
(Also note that in this case, it would be convenient if we don't need to wire X. have a look at this idea!)
This discussion is useless until you attach an actual VI and some data, so please do.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Lumia 1020 NFC Tab+Share function doesnt work afte...

    I was able to use NFC tab+share function with lumia Cyan.
    It means, I was able to send files to my NFC enabled PC by tabbing my phone to my PC.
    But after Lumia Denim update I cannot use this function. Devices are not responding to each other.
    I see that several users are experiencing the same problem in some other forums.
    There is no hardware problem. This problem must be solved via phone update.
    (Note: Certainly my both "NFC tab+share option and Bluetooth option is on in settings menu)
    I think there is an activation problem in device hub manager.
    In past device hub software (in settings menu) was a more detailed one including settings about nfc.
    But after Lumia denim update, this options about nfc no longer exist in device hub software (in settings menu.)
    This is a feedback from me about lumia denim update.
    Phone: Lumia 1020

    Hi, Lathander. Have you tried updating the system settings of the phone? To do this, go to Settings > swipe to applications > store > check for updates. It is also worth checking the troubleshooting steps shown here: I cannot read or write NFC tags. The link will work regardless of your location. I'd love to hear your feedback. 

  • Laptop lid closing function doesnt work correctly

    Hello,
    I use openbox and acpid is installed.
    When I close laptop screen, my laptop does not sleep nor hibernate, fans continue to work and if I put the laptop in to a laptop bag ( which I did because I thought it was working ),  the laptop becomes very hot in very short time.
    If I want to open the laptop again, screen does not open. I dont know if the system is really working or not but it doesnt open no matter what. So I'm forced to do hard reset.
    systemd-logind service logs like its working normally but it is not;
    Mar 01 20:02:11 isg00051371 systemd-logind[356]: Lid closed.
    Mar 01 20:02:11 isg00051371 systemd-logind[356]: Suspending...
    Mar 01 20:02:11 isg00051371 logger[1286]: LID closed
    -- Reboot --
    What should I do to fix this problem ?

    Both of them failed again.
    systemctl restart systemd-login made X crashed, so I started X again and used them together "sudo systemctl restart systemd-login && systemctl suspend", but same thing happened
    pm-utils made fast move and I thought it worked, but then fan started to make noise, and when I tried to open it, it failed again;
    Mar 02 00:46:34 isg00051371 sudo[601]: kerem : TTY=pts/0 ; PWD=/home/kerem ; USER=root ; COMMAND=/usr/bin/pacman -S pm-utils
    Mar 02 00:46:34 isg00051371 sudo[601]: pam_unix(sudo:session): session opened for user root by kerem(uid=0)
    Mar 02 00:46:44 isg00051371 sudo[601]: pam_unix(sudo:session): session closed for user root
    Mar 02 00:47:10 isg00051371 sudo[647]: kerem : TTY=pts/0 ; PWD=/home/kerem ; USER=root ; COMMAND=/usr/bin/pm-suspend
    Mar 02 00:47:10 isg00051371 sudo[647]: pam_unix(sudo:session): session opened for user root by kerem(uid=0)
    Mar 02 00:47:10 isg00051371 kernel: EXT4-fs (sda5): re-mounted. Opts: data=ordered,commit=0
    Mar 02 00:47:10 isg00051371 systemd-udevd[215]: error opening USB device 'descriptors' file
    Mar 02 00:47:10 isg00051371 kernel: usb 3-7: USB disconnect, device number 2
    -- Reboot --
    I find arch wiki very confusing, it's not helpful. Only helpful guide was beginner's guide, the rest is either confusing or incomplete.
    I think I'll install either Xfce or Gnome, because this is making me feel I'm going nowhere.
    Also, another thing is, I dont know if its about  disabling acpid but, now whenever I do something new, like opening a tab in firefox, clicking on search area in arch wiki, my machine acts like a new cd inserted, but instead it uses hdd, it stops for 1 second, drive starts moving, then it acts, and I'm talking about 8gb ram, i7 machine...

  • My e mail  functionality doesnt work any longer on my 3gs phone. has worked perfectly for 18 months...now i just get a blank screen when i click on the mail icon...it still tells me how many mails I have waiting on the icon...any ideas?

    my mail has been working perfectly on my 3gs iphone. I can now longer access the mail after tapping on the mail icon. All i get is a blank screen with a reload icon and a write icon at the bottom, neither of which responds when touched. The icon continues to tell me how many mails I have in my inbox and continues to update.
    Any ideas?
    am on version 4.3.4 operating system.
    Thanks

    I have tried that also, but its still doing the same thing

  • 'X' function doesnt work properly - expand/enlarge track

    Hi.
    When i click X it expands/enlarges the current track. Now when i click it it expands the track by 1. The tracks are all at 0 and clicking X enlarges them to 1. There is barely any difference in size which is not useful at all. Im not sure whats changed. The X function usually enlarges the track quite a bit so you can fully see the waveform/midi information.
    Any advice on how to sort this out would be very helpful.
    Thanks, Ben

    Can't say I've heard of that either Ben, but then again, there's many stock key commands that I've replaced, or never used...
    Since I'm not familiar with that function, I may be off base here, but every screen set in Logic has 3 storable zoom settings.
    I'm wondering if on your system, "X" was one of the three settings, that somehow got changed, and now, of course, it's not zooming in as much as it used to.
    There's also the Auto Track Zoom command, although, I'm not aware of it being resizable. Actually, that's not true, you can drag the size (width) of the track by clicking on the left bottom corner of the track lane.
    So, none of that may help, but it might point you in the right direction...

  • Constrained nonlinear curve fit can properly handle the function like ln(1+b(x-xc)/a) ?

    Hi all,
    I met some problems about using constrained nonlinear curve fitting vi. It seems to me that this vi can't properly deal with the function like ln(1+b(x-xc)/a), a,b, and xc are the parameters, and b is in the range of 0 and -1. The reason I said that is as I used the other nonlinear fitting function in the other software, like Originlab, the fitting function can work properly.
    The error message from LV occurs as 1+b(x-xc)/a is less than zero. 
    However, due to a,b are both adjustable parameters, how could this situation happen ?
    Now I attach the vi files. The attachment includes main vi, mathmatical formula, and an input XY txt file.
    I appreciate any help or suggestion from you!!
    Here is the error message
    Joy
    Solved!
    Go to Solution.
    Attachments:
    LN-fitting.vi ‏21 KB
    LN-fittingmodel.vi ‏18 KB
    Book2.txt ‏1 KB

    Thanks for reply. whitenoiz 
    Actually I have more than 100 XY data set to test my vi. Some of the data set can be fit flawlessly. And the best fit parameters obtained from my vi are exactly the same as those from other analytical software, like OriginLab. In this case, I know my vi is valid. And in this scenario, I also found 1+b(x-xc)/a is always larger than zero with the best fit parameters (a and b). However, for certain XY data set, the error message will pop up if I use LV built-in vi, but I still can obtain the best fit parameters with OriginLab. And then I realized that error message always pops up as 1+b(x-xc)/a is less than zero, which it means to me that as LV built-in vi handles this type mathematical function, this built-in vi will encounter some difficulties. 
    I will step through my code, and also focus on the Matrix Left DivisionMV.vi, try yo find where the problem is.
    Best regards,
    Joy

  • Curve fitting gives input, at the output

    Hi everybody, i am having a problem at curve fitting function,
    i take at output, what i give as input, where do i make mistake?
    at example i give 4 values, if i enter 6 values it works, but i need to do it with 4 values.
    any ideas?
    thanks
    Solved!
    Go to Solution.
    Attachments:
    curve fitting.vi ‏16 KB

    Your function is a simple quadratic polynomial, so you should use the general polynomial fit function instead. Don't overcomplicate things
    LabVIEW Champion . Do more with less code and in less time .

  • For "Nonlinear Curve Fit.vi", what does -20068 mean and how can I avoid it?

    Hey guys,
    I am trying to fit an oval in a set of 2D data points, which represents a partial oval.
    So I am trying to see if "Nonlinear curve fit.vi" would work in the situation.
    However, sometimes that math VI would give me an error -20068 and would return incorrect fitting parameter.
    I can't figure out what condition would return that error so can you tell me
    what the cause is and how I can avoid that error?
    You can run the attached LabVIEW 2013 VI and see the error.
    Attachments:
    ellipse fit data.zip ‏41 KB

    jcyth wrote:
    The model is a result of solving the ellipse equation for y, 
    (x^2)/(a^2) + (y^2)/(b^2) = 1
    So I don't really see a simple way to make the negative values less likely...
    but maybe I can use "Constrained Nonlinear Curve Fit" where I can bound the parameters then?
    This is slowly drifting away from a LabVIEW problem but any help is appreciated! 
    The solution is to re-parameterize the problem and solve for something much less pathological
    You can directly fit for the above formula by providing x&y for all points to the model and optimize the four ellipse parameters until you get an array of all ones.
    I quicky coded this in the attached example and it seem to be quite stable, even with lots of noise.
    See if this works for you.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Ellipse FittingMODCA.zip ‏40 KB
    FitEllipse.png ‏26 KB

  • Nonlinear Curve Fit VI keeps all initial parameters

    My question is about fitting a curve with nonlinear curve fit VI. The fitting function has the formula like
    A/((x/I)^p-C)+B, where fitting parameters are {A, B, C, p, I) and variable is x. I tried to use both Nonlinear Curve Fit VI and Constrained Nonlinear Curve Fit VI, but neither gives me fitting parameters other than what I input as the initial parameters. As an example I am attaching the data set file where the fist column is x and second column is y. The initial fit parameter set is {2,0,1,2,90}. It would be appreciated if someone could point out how I use either these fitting function to get the best fit.
    Attachments:
    60QR.zip ‏1 KB

    Actually my LV code is quite simple and has nearly nothing more than the nonlinear curve fit vi itself. Anyhow I am attached my code here so that you could at least run and see what my question is about. The caller VI is "Curve Fitting.vi". The subVI inside it that calls the curve fitting function has two flavors inside. What is enabled uses the contrained nonlinear curve fit vi while the other one that is currently disabled, calls the function of nonlinear curve fit vi.
    Thanks.
    Attachments:
    Curve Fitting with a Nonlinear Model.vi ‏29 KB
    Curve Fitting.vi ‏17 KB

  • Curve fitting problem: simultaneously fitting two datasets to two different model functions with shared parameters

    Hello! As stated above, I have the following problem: I have 2 sets (different systems) of measurement data (Voltages measured as functions of applied frequency). I would like to make curve fits with Levenber-Marquardt-method to both datasets (the datasets have the same x-values = frequencies), fitting the 2 datasets to their own separate model functions. However, the different model functions should have same values for the shared parameters (this prevents me from doing 2 totally separate curve fittings).
    I have LabVIEW version 7.1, if anybody could help me with the problem, I would appreciate it very much. Thank you!

    Would you like to try this:
    http://forums.ni.com/t5/LabVIEW/levenberg-Marquardt/td-p/668782
    http://zone.ni.com/reference/en-XX/help/371361G-01/gmath/nonlinear_curve_fit/
    http://digital.ni.com/public.nsf/allkb/BACF6FDF1B40993686256CC300657BA4
    With LV 7.1, I don't know if we have a such feature with that version. Please check out for the latest LV versions.
    BR,
    Make Nguyen
    NI Finland Technical Support

  • 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

  • Nonlinear curve fit

    Hi everybody,
    I am trying to fit a custom nonlinear curve to my data. I want to fit a curve to the data twice. After the first fit, I want to use the coefficient a (6.57962) in my second curve fit as my coefficient b. When I try to use this and create a custom equation by string concetanete, everything seems fine but I do not get what I expect to get. To double check I used curve fitting express VI and I added 6.57962 as a coefficient in my equation and at the end a turns to be 6.752. However, this does not happen in my second curve fit. Does anybody have any idea what might be wrong? I cannot find my mistake, could you please help me?
    Thank you very much
    Attachments:
    Read.vi ‏129 KB
    read.png ‏66 KB

    The errors you get provide some clues, although they are not very explicit.
    The -23001:  Syntax error of parser  is usually a sign that your string describing the function is ill-formed or that there is a parameter mismatch. You have both.
    The string array constant feeding into the second Lev-Mar VI has two elements, the second one being an empty string.  Even though the string is empty, the parser expects two elements in the Initial Parameters array. But since your equation has only one parameter (a), the proper solution is to remove the blank element from the constant array.
    The other problem is that the first Initial Parameters array is empty.  Maybe you always enter two values but I did not know what to put in. 
    The second fit is somewhat sensitive to the initial Parameter value. Negative values do not work. 1 returns 6.753... 2 through 6 and 8 (integer values only) return 6.246... 7 returns the same result as 1. Values 10 and above return the value entere with error -20041 (singular matrix) appearing at >=12.
    The initial b parameter in the first fit does not matter over a fairly wide range.
    I also noticed that you seem to have a severe allergy to straight wires. Wires running all over the diagram and particularly behind other objects makes it very hard to read your code. Dataflow along the wires should generally be from left to right as much as possible. The code works the same regardless of the number of bends in the wires but straighter wires are much easier on the programmer.
    Lynn

  • Nonlinear Curve Fit and using static data

    I am trying to fit data to a 2D function using the Nonlinear Curve Fit VI in Labview 8.2.1, but I would like to also include 2 parameters that I don't want to be optimized.  I cannot directly use constants since every time I run the fitting I need to change the 2 parameter values.  I tried to modify the example by Altenbach according to my own application in the link below. 
    http://forums.ni.com/ni/board/message?board.id=170&message.id=230831
    I think the problem is that I don't completely understand how to use the static VI reference with the Nonlinear Curve Fit VI?  It looks like there is a static data control that I could use to add additional parameters, but I am not sure?  I can get Altenbach's code to work if I change the function to something different, and even if I change the number of inital fitted parameters.  I just can't figure out how I can add parameters using a control that will not be optimized.  I can attach an example, but it is very similar to Altenbach's code except the function is different, and I am trying to add additional parameters that are not optimized.  Thanks for any help.
    Kevin Baker 

    Thanks Trey.  I am sorry I didn't make it clear what I was talking about before.  I am attaching an example that will hopefully clarify what I would like to do.  When I try to pass the static reference to the Nonlinear Fit VI it says gives me a broken wire and says "function conflict".  I am assuming the problem is that I inserted another control to the VI when I wasn't supposed to.  I just don't know of any other way to pass data into the VI, and still have the Nonlinear Fit VI still work?  What is the "data" control in the Nonlinear Fit VI used for anyway?  It seems that that it was want I need, but I don't know how to use it?  Thanks again for any help.
    Attachments:
    Fit equation.vi ‏15 KB
    general lorentzian.vi ‏26 KB

  • 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

  • Nonlinear curve fit help needed

    I am in need of some help trying to fit a set of data that requires the use of nonlinear curve fitting.  I have attached a txt file containing the data that needs to be fitted.  The first row contains the x-axis values while the second row contains the y-axis values.  The model for this set of data can be described by a single parameter, A, for the first five data points.  The remainder of the data points can be described by the model A+A1*exp((0.4-x)/A2), where A, A1, and A2 are all parameter.  As you can see the two models share the parameter A.
    I have determined some initial values for each of the parameters: A=176.32, A1=2133.4133, and A2=1.4936.
    I have spent the last couple of days trying to figure out how to use the Lev-Mar nonlinear curve fit vi but have had little success.  I have been doing LabVIEW programing for many years now and I have never felt as lost as I do now trying to understand how the Lev-Mar nonlinear curve fit vi works.  Any help you can provide with my data fitting would be greatly appreciated.
    Thanks.
    -Alonzo
    Solved!
    Go to Solution.
    Attachments:
    Data.txt ‏1 KB

    I think the problem is that the first 5 points are not part of the data sent to Lev-Mar.  Because of this the fitting process fits the remaining data very well, but the constant term is able to freely move.  I modified the model function to output A for the first 5 terms, and the complete function for the rest.  The offset found is now more reasonable.
    Also, your quote your model to be A+A1*exp((0.4-x)/A2), but what is implemented in the model VI seems to be A+A1*exp((x-0.4)/A2).
    -Jim
    Attachments:
    ExponentialFunction.vi ‏19 KB
    FitExponentialExample.vi ‏24 KB

Maybe you are looking for

  • How can we remove the Calender,Active tasks,Recent activity and tags sectio

    Hi I want my landing page of my workspace (Keppel_Energy_EAP) to have only the WIKI home screen and want to remove the other sections like calender, Activie Tasks, Recent Activity and tags section. Can you please let me know how i can remove these se

  • IPhone calendar will not sync with iCal on Mac

    Calendar entries on my iPhone 4S/iOS 5.1 will not sync with iCal on my MacBook Pro 2.4/10.6.8, but it will the other way around. I have tried: Restarting iPhone Re-setting sync services (holding down Option key and clicking on Sync icon in menu bar)

  • How to copy a existing process chain

    hi i am a SAP BW learner. i created a process chain for inital load and i want to create a process chain by copying first created process chain and tell me in what situation we delete the indexes of InfoCube. Can any one provide me the solution to ho

  • Connecting two mobile to the one bluetooth car kit...

    Is it possible to connect two mobile phones to the same bluetooth car kit at the same time?

  • JDev 10g, VO Extension is giving error

    When I tried extending the seeded VO, its giving error at "Step 4 of 7". Error is "Each row in the query result columns must be mapped to a unique Query Attribute in the Mapped Entity Columns"...Even I dont modify the base query, its giving the same