| T O P I C R E V I E W |
| saschia |
Posted - 01/19/2005 : 04:14:41 AM Origin Version (Select Help-->About Origin): Origin Pro 7 SR4 Operating System: XP pro SP2
Hi, I encountered a problem with NLSF.fit function. I use an Origin C script for automatic fitting of data in several worksheets, each consisting of several columns of data. The worksheets are made by multiple ascii import. In one (and only one, not the first, not the last) of the worksheets not all columns are fitted, however, if I comment out the NLSF.Fit(100) command, the cycle goes through all of the columns (I use foreach cycle). If I paste other data into the same worksheet, the problem still occurs, but if I paste the problematic data to other worksheet, this other worksheet is fitted without problems.
This problem causes the cycle to end as if there were no more columns in the worksheet, it gives no error message. Prinf() command at the end of the cycle round is executed, printf() command at the beginning of next round is not executed. If I comment out the NLSF.fit(100) command or use NLSF.Iterate(100) instead, the cycle goes through all columns in the worksheet. Oh, and NLSF.err property printed outjust after the NLSF.Fit command has null value.
Any ideas, where the problem is?
PS. I tried couple of things after posting this message, so I add them:
1. I have column A, type X and 5 Y type columns named p1, p2, p3, p4 and p5. Normally column p3 is the last which is fitted. (I want to fit all of them) If I move position of column p3, still only first 3 Y type columns atre fitted
2. If I delete any of the columns in the worksheet, the script goes through all columns.
3. If I add 1 column, script goes only through first two columns.
4. If I add 2 columns, script goes through all columns.
Edited by - saschia on 01/19/2005 07:49:10 AM |
| 4 L A T E S T R E P L I E S (Newest First) |
| saschia |
Posted - 01/20/2005 : 09:30:12 AM Yes, I sent scipt files (with nlsf.fit() and nlsf.iterate), project and fitting function. I'll let you know what they found out then.
By the way, I also had problem using the makecurve command, if I just used NLSF.makecurve(func);, it didn't compile, I had to put it there as a string. (string func = "func"; NLSF.makecurve(func);). Then it compiled without problem, but freezed after couple of column fittings. |
| Mike Buess |
Posted - 01/20/2005 : 07:45:41 AM I'm sure they would also like to see the offending worksheet, if not the entire project.
Mike Buess Origin WebRing Member |
| saschia |
Posted - 01/20/2005 : 07:04:28 AM The problem is that the same script works fine in other worksheets of the same project and work on the same worksheet if I delete one of the columns or add two (I can delete them right after adding them). It looks to me like bug or something, I tried also nlsf.iterate command, but then the same problem occurs with wks.addcol command. And now the makecurve command causes entire Origin to freeze.
I posted the file with script to the support team, so I hope they come up with at least knowing why. |
| Mike Buess |
Posted - 01/19/2005 : 5:01:16 PM It's hard to tell what's happening without seeing your code, but the description of the nlsf.fit() method in the manual states...quote: Similar to nlsf.iterate(n), except this method automatically generates a fitted curve with an X dataset. In the default case the curve is generated and the data is placed in the original worksheet next to the independent variable.
If that's what is happening in your code it might be messing up the column numbering for the datasets you're actually trying to fit. Unfortunately, the nlsf documentation does not explain what's available besides the "default case" so I suggest that you use nlsf.iterate() to obtain the fit and nlsf.makeCurve() to generate your curves. See my last post in this topic for an example of using nlsf.makeCurve()...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=3628
...Easwar's post under the same topic is possibly more apropos.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/19/2005 5:06:19 PM
Edited by - Mike Buess on 01/19/2005 6:54:40 PM |
|
|