| Author | 
                
                  Topic   | 
                
                
                 
                 
                 
                 
                 
                                 | 
               
              
                | 
                 altomare 
                 
                
                USA 
                19 Posts  | 
                
                  
                    
                      
                       Posted - 08/16/2005 :  6:57:39 PM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Origin Version (Select Help-->About Origin): 7.5 Operating System: WinXP
  I am trying to fit some dataset using a custom function with a script like r=exp(-x*a1); y=f(r);
  The output of this fitting function is the y value but I was wondering if it is possible to have origin (using some property of the nlsf object) to create a dataset for the intermediate value r without calculating it afterward (there is a certain number of parameter  I have omitted here which would be a pain to get it right). Is there any way to do it? Thanks a lot Fabio
  PS I tried to define r as a dependent variable as well but the fit is not working in this case | 
                     
                   
                 | 
               
              
                | 
                 Leo_Li 
                 
                
                China 
                 Posts  | 
                
                  
                    
                      
                       Posted - 08/17/2005 :  06:25:19 AM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Hello Fabio,
  After performing the NLSF fit, you can add a new column to your source worksheet. Assume the title of your worksheet is "Data1", in which Col(A) contains X values, and Col(D) is the new column; run the following script in the Script Window:
  Data1_D = exp(-Data1_A * nlsf.p1)
  Here I assume that a1 is the 1st parameter, so nslf.p1 = a1.
  Leo OriginLab Corp. | 
                     
                    
                        | 
                     
                   
                 | 
               
              
                | 
                 altomare 
                 
                
                USA 
                19 Posts  | 
                
                  
                    
                      
                       Posted - 08/17/2005 :  1:14:43 PM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Leo, unfortunately there are several additional assignment in the script involving vector operation on the x variable (of the fit as well): this is the reason I was hoping there was some way to do it in a similar fashion to nlsf.funcx$ . I have, in fact, tried to define my variable (r) as additional independent variable in the fit and tried nlsf.funcx1$ and nlsf.funcx2$ (in analogy to nlsf.x1$ and nlsf.x2$) but  it didn't work. Do you have any other suggestion I can try? Thanks a lot
  Fabio | 
                     
                    
                        | 
                     
                   
                 | 
               
              
                | 
                 Leo_Li 
                 
                
                China 
                 Posts  | 
                
                  
                    
                      
                       Posted - 08/18/2005 :  04:15:45 AM
                        
                        
                        
                        
                        
                      
  | 
                     
                    
                       Fabio,
  You may want to try "After Fit Script" to automate the vector operations on X variable. To do it, pick "Script -> After Fit" menu in Nonlinear Curve Fitting dialog.
  Leo
  | 
                     
                    
                        | 
                     
                   
                 | 
               
              
                |   | 
                
                  Topic   | 
                
                
                 
                 
                 
                 
                 
                 | 
               
             
           | 
         
       
     |