The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 NLF Problems with more than 1 independend variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

DataConv

Germany
60 Posts

Posted - 08/23/2011 :  10:38:35 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5.0G SR1
Operating System: W7x64 SP1

I have some problems with the NLF fit function and scripting when having a multivariant formula. The code so far
nlbeginr (1,2,3) func:=FitMag2D nltree:=tt option:=init_all;
nlfit;
nlend;
ra1[1]=tt.x0; ra1[2]=tt.y0; ra1[3]=tt.A; ra1[4]=tt.B; ra1[5]=tt.c;
ra1[7]=tt.e_x0; ra1[ 8]=tt.e_y0; ra1[9]=tt.e_A; ra1[10]=tt.e_B; ra1[11]=tt.e_c;
works for me (ra1 is a range pointing to a column storing the fit parameter). FitMag2D is a fit function with two independent variables (X and Y) and 5 parameters (x0,y0,A,B,c). Now i want the Z=f(X,Y) values in another column. When using the GUI - no problem. On scripting, i however got stuck. I found the function 'fit' which should do my task. Unfortunately, it is designed for one independend variable? The doc lacks here a bit... The old NLSF enviroment is hidden somewhere in the doc and also not that clear to me...
What i want to have: Using col(1) and col(2) as X and Y and the parameters determined by the fit and put that as Z=f(X,Y) in another column. How to?

DataConv

Germany
60 Posts

Posted - 08/24/2011 :  07:58:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok... the solution was quite simple:
rb1=nlf_FitMag2D(r1,r2,tt.x0,tt.y0,tt.A,tt.B,tt.c);
With rb1 pointing to the target column (the Z values)
r1 pointing to the column with the X values and
r2 pointing to the column with the Y values.
Sometimes things turn out simple if you do a break...
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000