Created attachment 108818 [details] fit parameter b is red - create a new table with 2 columns - fill the table columns with row numbers - create a new custom fit - use as fit function this one exp(b*sin(a*x))+c - set fit interval x:10 - 25 - set as start value for all parameters "1" result: 1. the fit parameter b gets red, see attached 2. one cannot see the fit functions using the given parameters. Therefore one doesn't know is the parameter "1" is sensible. - Now press the recalculate button result: one doesn't get a fit curve nor sensible values for the fit parameters, see attached. But this fit is possible without problems, see the attached screenshot from MagicPlot.
Created attachment 108819 [details] no fit result and senseless fit parameters
Created attachment 108821 [details] Fit result from MagicPlot The fit is bad but at least is exists and one can see it. One gets the idea that setting parameter a to a low value should result in a good fit.
OK, let's assume the user got the idea that the parameter a has to be a low value despite LP doesn't show him the fit function. - Therefore let's fit with the parameters a: "0.01", b and c with "1" result: still not fit. So the fit routine in LP seems to have an error because doing the same with MagicPlot leads to a nice fit result, see attached. now it gets even worse: - now use again a: "0.01", b and c with "1" but this time set a to be fixed. result: one gets for the parameter a the value 1.79769e+308 although it was set fixed and must not be changed during the fit. I played a bit with fitting and because of this bug LP is not usable for me regarding custom fits.
Created attachment 108823 [details] MagicPlot good fit result with a=0.01 I attached is the fit result of MagicPlot using the start parameters a=0.01, b=1 and c=1.
Created attachment 108942 [details] screenshot of test case I could not reproduce the problem. Attached my screenshot of your test case. Is there anything i may have missed?
> I could not reproduce the problem. Attached my screenshot of your test case. Is there anything i may have missed? Then this bug was fixed in the meantime. I use the same settings as you and "0.01" as start value for the parameter a, 1 for b and c. As result i get what I posted: https://bugsfiles.kde.org/attachment.cgi?id=108819 To be able to check if this bug is fixed, I need a new build from you.
I uploaded a new package at https://theorie.physik.uni-konstanz.de/gerlach/labplot/labplot-2.5.0rc4-64bit-setup.exe
> I uploaded a new package The bug persists for me, with your build and also with mine. Attached is my test file. The situation is now worse: The recalculate button is always disabled as you can see in my test file. In order to get a fit I have to create a new fit plot. -> major regression
Created attachment 109437 [details] lml testfile test project showing the bug
Created attachment 109438 [details] another test file with this test file the Recalculate button is always disabled
Do this problem still exist in the latest version 2.5rc8?
(In reply to Stefan Gerlach from comment #11) > Do this problem still exist in the latest version 2.5rc8? Yes. When opening the attached .lml file I still get both errors: > 1. the fit parameter b gets red, see attached > 2. one cannot see the fit functions using the given parameters. Therefore one doesn't know is the parameter "1" is sensible. Additionally: 3. The fit parameter window can still not be moved. 4. I cannot press the recalculate button because it is permanently grayed-out. If I therefore create a new fit to be able to calculate I still get senseless results.
Created attachment 110551 [details] .lml test file Test file for comment 12
the data columns are not restored when opening your project. What happens when you select the x- and y-column correctly? The fit parameter are using lower and upper limits for the values. Which values for a,b,c do you expect for best fitting you data?
If you can provide the information requested in comment #14, please add it.
To further investigate this issue, LabPlot developers need the information requested in comment #14. If you can provide it, or need help with finding that information, please add a comment.
Created attachment 112508 [details] test as described by OP I'm not the original poster, but I tried what he suggests in the opening message with a recent compilation, a few minutes ago: === GIT update --> repository: https://anongit.kde.org/labplot updating from commit: 9ba9b2636a94ec4c53dba369c922cb5b482c8333 to commit: ed4021f2e459ab4cbc8ff4ff5a9c7b2d5c908924 === My findings: 1) When entering the parameter initial values, b fields turn red when entering 1. However, it is accepted: after pressing "Apply" and entering into Options again, b=1 is there and b fields are no longer red. 2) The reason for it to turn red is both b and a have default lower and upper limits equal to 0, whilst you are telling labplot their value is 1. 3) If you then perform the fitting, c=1 and both a and b get the same huge value: ~1.8e308 4) However, if you change the default 0 for both lower and upper limits (bug?) to none, set the starting value to 1 for the three parameters and perform the fitting, then you get distinct values for them. The fitting is not good, as you can see in the attached file, because probably you would need to set more realistic starting values, but I would say this is a normal behavior for such a function.
I see at least two things that can be improved. The default ranges should be not 0..0 and "Apply" should not be possible with start values outside the given range. I will fix these soon.
Both problems from comment #18 are fixed now. Please try again to check if there is still anything left to be improved.
This bug is not fixed in the latest available LabPlot version. > If you can provide the information requested in comment #14, please add it. OK: > Which values for a,b,c do you expect for best fitting you data? See the screen shot I once attached with a correct fit: https://bugsfiles.kde.org/attachment.cgi?id=108823 > the data columns are not restored when opening your project. What happens when you select the x- and y-column correctly? I don't know what you mean. I created the file using LabPlot so there must be another bug that columns are not restored. Is there a new LabPlot build available to test?
I uploaded a new Windows packages including the latest fixes at https://theorie.physik.uni-konstanz.de/gerlach/labplot/labplot-2.5.0rc17-64bit-setup.exe The parameter a is very sensitive. The fit works for me using start values closer to the result (b=2, a=.05, c=2).
> The parameter a is very sensitive. The fit works for me using start values closer to the result (b=2, a=.05, c=2). ;-) Well, people use LabPlot because they don't yet the solution. using 1 for all 3 parameters is sensible because one can expect that the solution will have positive values and that b and c won't be very high. However, I restarted now from scratch using RC17 and this recipe: - create a new table with 2 columns - fill the table columns with row numbers - create a new custom fit - use as fit function this one exp(b*sin(a*x))+c - set fit interval x:10 - 25 - set as start value for all parameters "1" result: one doesn't get a fit curve What is missing is that LabPlot does not draw the cureve for A=b=c=1 immediately, meaning even before starting the calculation of the fit. Other programs like MagicPlot do this since it helps a lot to see if the start parameters are sensible. With RC17 the fitting result are now correct but as long as LabPlot does not draw the fit curve with the given start parameters, the problem is not fixed in my opinion. Btw. with RC17 LabPlot does no longer show any fit curve. I'll open new bug reports now.
Created attachment 112528 [details] Test works OK in Linux Well, I just sync'ed and compiled labplot again (Gentoo Linux). My results are identical to those shown by Uwe Stöhr in his MagicPlot Pro graph after knowing the parameters value range, as I show in the new attached file. So, I think there's really no issue here and labplot is now perfectly able to perform the suggested fitting. I got a question for Uwe: does MagicPlot Pro find the "correct" parameter values when the starting values are 1,1,1? If it is, then it's almost magic, imho. The function is complexed and, in these cases, it is common for whatever fitting algorithm that, the further from a straight line the function is, the more prone to fail is the fit when the initial guess values are far away from the true ones.
As I wrote in comment 22: "the fitting result are now correct but as long as LabPlot does not draw the fit curve with the given start parameters, the problem is not fixed in my opinion." > does MagicPlot Pro find the "correct" parameter values when the starting values are 1,1,1? If it is, then it's almost magic Well, it is called MagicPlot ;-) No, it does not find the optimal fit result with these parameters. it finds this: https://bugsfiles.kde.org/attachment.cgi?id=108821 The reason this bug is now still open is that LabPlot does not give feedback about the fit curve. So if I use 1,1,1 as start parameter it is very important that LabPlot drawn immediately the function exp(sin(x))+1 into the plot. Then the user gets a feeling if his start parameters are sensible.
It looks like custom fitting in LabPlot now works. Supporting a preview of the fitting curve using the start values is a new feature which currently is breaking too many things (just before the release of 2.5). But i will put this on the TODO list for the next release and hope to make it possible soon. Is it ok to contact you when we think this new feature is working?
> I will put this on the TODO list for the next release Many thanks. I opened bug 394223 as feature request. > Is it ok to contact you when we think this new feature is working? Sure. You have already my private mail address.