Nonlinear fit model function

Hi, I'm trying to use a custom fit - fitting modified error function to the provided data. 
For the nonlinear fit I need a model fitting function VI, which I created from template (attached LM_erf_model.vi). 
I have a problem connecting the reference for the attached function to f(x,a) input of the Levenberg-Marquardt
nonlinear fit VI - I can't create the proper reference and end up with
You have connected a refnum of one type to a refnum of another type and both types are members of some class hierarchy, but there is neither a simple up cast nor type cast between the two classes. 
What's the proper way of creating the reference for this model function to be used in marquardt test .vi?
Regards
Michal 
Message Edited by mdwuznik on 01-29-2009 01:07 AM
Solved!
Go to Solution.
Attachments:
LM_erf_model.vi ‏121 KB
marquardt_test.vi ‏16 KB

It is typically much easier to place a static VI reference on the diagram, then
right-click...browse for path...point to the model VI
right-click the static reference and make it strict (red star)
hook it up the the nonlinear fitting VI, ignore the coercion dot.
Your model functions is overly complicated. Index array is resizeable, so get the three parameters before the loop at once. No need to index the same element with every itreation of the loop. I would recommend not to use a formula express VI.
Do you have some typical data?
Message Edited by altenbach on 01-28-2009 05:50 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
modelFnc.png ‏4 KB
modelfnc2.png ‏7 KB

Similar Messages

  • Two nonlinear fitting's function in one

    We bought the LabView 6.1 and I have no clue
    how to make the Lev-Mar work (and many other
    functions as well).
    There are some tasks in the 'getting start' manual
    that tells you step-by-step of doing things.
    I appreciate any body can tell me how to 'write'
    a Lev-Mar from clicking the first buttom step-by-step.
    Anyway, before that, I copied an Lev-Mar example
    for my simple task. It works OK. But when I use
    two in the same vi, it seems when I change one
    function/derivative, it change the other one too.
    My question two: How to make 2 or more different
    function/derivatives in the same vi?
    Thanks.

    Hi, Jeremy:
    Attached is a made-off example of the problem.
    Two set of time-amplitude data are from hardware.
    They have to be fitted with differene function.
    These two Lev-Mar must be inside one same vi as the
    parameters are needed for following processing.
    These two Lev-Mar's function/derivatives are
    obviously different and must be present in this same
    vi file. By clicking on Lev-Mar's Hierarchy >> Diagram
    we can see the function nodes for function & Deveritives.
    How to 'save' these two different function & Deveritives?
    By the way, how to replace the MatLab box into
    function node in my attached example?
    (It's easy to cange MatLab output variable's type,
    but I couldn't change the output variable's type.)
    Attachments:
    Lev-Mar-Question2.vi ‏99 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

  • Howto map to an odata model function import returning an entity, not an entity set?

    Hi,
    how do I map to an odate model function import returning an entity (not an entity set) in a XML view? I tried property mapping {/method/property}, which does not make a network request and sets the value to null and I tried aggregation mapping {/method}, which makes a network request with $skip=0&$top=100&$inlinecount=allpages which is of course rejected by the odata source.
    Thanks,
    Wolfgang

    Hello Dr. Wolfgang,
    you can use
      var oParams = {};
      oParams.Field1 = 'ABC';
      oParams.Field2= 'XYZ';
      oParams.Field3= '123';
      oModel.callFunction('MyFuncImport', 'GET', oParams, null, function(oResponse){
            alert("Call to Func Imp successful");
        },function(){
            alert("Call to Func Imp failed");});
    also refer SAPUI5 SDK - Demo Kit
    Regards,
    Chandra

  • Adobe 3D Reviewer: No "reduce model" function like in 3D Toolkit?

    I'm using Adobe 3D Reviewer to prepare 3D models. I'm trying to reduce the file size of a gigantic 3D model. But it appears that Adobe 3D Reviewer does not have the "reduce model" function that was available in Acrobat 3D Toolkit to reduce mesh size.
    Any thoughts or tips?
    Thanks!
    K

    You are correct, there are no tools in 3D Reviewer to reduce mesh size except for the compression option available for both PRC and U3D when exporting to PDF.
    To export to PDF from 3D Reviewer and use the compression option, please follow these steps:
    1) open your model in 3D Reviewer
    2) go to File>Export
    3) choose PDF for the file type
    4) click on Options (lower left corner)
    5) ckick on Options (again)
    6) select PRC Tessellation for the Format
    7) check the box Compress Tessellation
    8) uncheck the other box
    9) click OK
    10) click OK (again)
    11) click Save
    Hope this helps

  • Fit Sinc Function to Data

    Dear community,
    I recently wrote a program that fits a Gaussian function to some intensity data I pulled from an image of a fluorescent nanoparticle. Here's a snapshot:
    My program would be a lot more useful if I could fit the data to a Sinc function instead of a Gaussian. Could someone please give me some points in the right direction about how to do this? I am very new to LabVIEW, so I may need a little more help than just which VI to use. I'd appreciate your help very much.
    Please note: I need to fit all the data, not just half.
    I am using version 9.0.1 with the Windows 7 64-bit OS.
    My program is attached below.
    Thanks!
    -Patrick
    Solved!
    Go to Solution.
    Attachments:
    MAX_cropped 20130718082713_SI_150_GFP(525_39)_R.jpg ‏1 KB
    PSFAnalyze.vi ‏31 KB

    Here's a quick attempt to fit the entire 2D data. Seems to work just fine. (LabVIEW 9.0)
    Run VI. It will start fitting immediately.
    Change simulation paramters at any time to see the simulated result using the model (lower right)
    Once fitting completes, you can drag the yellow cursor to inspect data and fit along a vertical line.
    The attached zip file contains the toplevel VI, the VI model VI and the picture. Extract all to a new folder and load and run the toplevel VI.
    Since you have limited data, it probably helps to fit all data instead of only a single line. Let me know if anything is not clear. To be honest, I don't think a squared sinc is the correct model. There are no real wings in your data!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Fit2DSinc.zip ‏35 KB
    2Dsinc.png ‏138 KB

  • 3D nonlinear fit + smoothing

    Hello,
     I am trying to fit or smooth a 3D set of data which comes from a CCD image (saved as a 32 bit bitmap ). I need to get rid of the small fringes that you can see in the bitmap attached ( hence smoothing of my data) and  find the phase of the sin function that describes the 3 big fringes . These big  fringes will shift for other CCD images that I have. The function that I need to fit with is a 2D gaussian multiplied by a sin(bx+cy+phase), where x and y are the pixels of the CCD. I was looking at the example of fitting 2D gaussian  surface with offset, but I am lost.
     Any ideas where to start from/ or the best solution for my problem?
    Thank you,
     Andrea
    Attachments:
    f.jpg ‏24 KB

    Well, way too much code!!!
    Remember that the Fourier tools take 2D arrays directly. Here's a "quick and dirty" attempt:
    You should be able to get the frequency and phase of the components directly from the peaks in the complex FT.
    Message Edited by altenbach on 03-05-2008 05:11 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FourierCutoff.png ‏233 KB

  • How can i call a business model function?

    Hello!
    I have a simple problem
    A gui view-backing - function call the setUsername by FacesContext und operative Buinding - it works well.
    Now i want to call the the function getUsername from a function inside the class EntityImplEx - both classes are in the business model in different class-pathes.
    How can I call the function getUsername from AppModule?
    package model.app;
    public class AppModuleImpl extends ApplicationModuleImpl implements AppModule {
        public String username                = "init";
        public void setUsername(String ss) {
            username=ss;
        public String getUsername() {
            return(username);
    package model.entity;
    public class EntityImplEx extends EntityImpl {
    ***************************

    You probably don't want to call a function in your UI from your AM.
    Doing this will break the MVC design pattern and will make your AM depends on a specific UI page.
    The way to communicate between the two is through service methods on the AM that are invoked from the UI layer.
    See chapters 8.3-8.5 in the developer guide:
    http://download.oracle.com/docs/html/B25947_01/bcservices003.htm#sm0206

  • Question re: MapViewer and Network Model functions

    Hi all,
    Quick question re: MapViewer and it's support for the Network Model and the shortest-path functions. If I create a base map with a network theme based on my (large) network, and then use a jdbc_network_query on the same network to do some shortest path analysis will MapViewer use the (hopefully) cached copy of the Network to calculate the shortest path? i.e can I expect good response times once the cache is warmed up?
    Thanks,
    Steve

    Hi Steve,
    MapViewer uses the Network Java library to run the shortest path algorithm. This library is independent of the MapViewer cache, and also not thread safe. So for now the network is always loaded. The load time may be reduced if the request has a MBR, but it is not the ideal solution. There is a working going on, and we hope to avoid this load in future versions.
    Thanks.

  • Org model function tab changing

    HI,
    I am new to CRM and learning CRM.i have created org model by creating marketing,sales and service structure.
    everything works fine.
    but my issue is when i click in service org tab and in function i am selecting service and service org.then i am going to sales org structure and click on it in function i see service is enabled where i have enabled sales before .In same case if i m scrolling through marketing and going to service structure then in service structure in function tab marketing is enabled.
    Can any body tell me any functionality is available in sap CRM to restrict above structure once i have saved it .it will be as usual irrespective If I scroll to different structure.please help me regarding this.
    Reagrds,
    Debesh

    Thanks for your quick response.
    What i am doing is creating a sales organisation in CRM without entering Reference R/3 sales organisation.
    Also i checked the "obj. permitted in determination" in a sales org.and run the report "HRBCI_ATTRIBUTES_BUFFER_UPDATE" .
    I already done all the above mentioned things, but still i am facing the problem.
    One pt is that the table "CRMD_ORGMAN" doesnt have the entry of newly created sales org.
    Please provide some inputs.
    Thanks and Regards,
    Suraj

  • Null values in model function

    Hello,
    Here is the table I m using :
    CREATE TABLE "TEST"
      "IDENTIFIANTACTIONNAIRE" NUMBER(23,0),
      "NUMEROECRITURE" NUMBER(8,0),
      "SENSOPERATION" VARCHAR2(1 BYTE),
      "NOMBRETITRES" NUMBER(15,0),
      "INDICATEURPMU" VARCHAR2(3 BYTE),
      "SOLDE" NUMBER(15,0));
    I have made these insetions :
    insert into test values (10,1111,'I',5,'Yes',NULL);
      insert into test values (10,2222,'I',2,'Yes',NULL);
       insert into test values (10,3333,'R',-7,'Yes',NULL);
        insert into test values (10,4444,'R',-5,'Yes',NULL);
         insert into test values (10,5555,'I',5,'Yes',NULL);
          insert into test values (10,6666,'I',0,'Yes',NULL);
           insert into test values (10,7777,'I',0,'Yes',NULL);
            insert into test values (10,8888,'I',0,'Yes',NULL);
    I m trying to have the Solde comlumn return the cumulation of the the column 'NombreTitres'. The disired result of the sold column is this in order :
    5,7,0,0,5,0,0,0
    Here is the SQL I m using but giving me null all the time :
    SELECT
      IDENTIFIANTACTIONNAIRE,
      NUMEROECRITURE,
      SENSOPERATION,
      NOMBRETITRES,
      INDICATEURPMU,
      Solde
      FROM test
      where identifiantactionnaire = 10
    MODEL PARTITION BY (IDENTIFIANTACTIONNAIRE,INDICATEURPMU)
           DIMENSION BY (row_number() OVER (PARTITION BY IDENTIFIANTACTIONNAIRE,INDICATEURPMU ORDER BY NUMEROECRITURE) rid)
           MEASURES(
                    NUMEROECRITURE,
                    SENSOPERATION,
                    NOMBRETITRES,
                    0 Solde
    rules sequential ORDER
    Solde[1] = nombreTitres[1],
    Solde[any] ORDER BY NUMEROECRITURE = CASE
                                              WHEN SENSOPERATION[cv()] = 'R' and (nombreTitres[cv()]*(-1)) + Solde[cv()-1] <=0 then 0
                                              WHEN SENSOPERATION[cv()] = 'R' THEN (nombreTitres[cv()]*(-1)) + Solde[cv()-1]
                                                        ELSE nombreTitres[cv()] + Solde[cv()-1] END

    with
    test as
    (select 10 identifiantactionnaire,1111 numeroecriture,'I' sensoperation,5 nombretitres,'Yes' indicateurpmu from dual union all
    select 10,2222,'I',2,'Yes' from dual union all
    select 10,3333,'R',-7,'Yes' from dual union all
    select 10,4444,'R',-5,'Yes' from dual union all
    select 10,5555,'I',5,'Yes' from dual union all
    select 10,6666,'I',0,'Yes' from dual union all
    select 10,7777,'I',0,'Yes' from dual union all
    select 10,8888,'I',0,'Yes' from dual
    select identifiantactionnaire,numeroecriture,sensoperation,nombretitres,indicateurpmu,solde
      from test
    where identifiantactionnaire = 10
    model partition by (identifiantactionnaire,indicateurpmu)
           dimension by (row_number() over (partition by identifiantactionnaire,indicateurpmu order by numeroecriture) rid)
           measures(numeroecriture,sensoperation,nombretitres,0 solde)
    rules
      solde[any] order by numeroecriture = case when nombretitres[cv()] = 0 /* TO PRODUCE THE FINAL THREE ZEROS */
                                                then 0                      /* INSTEAD OF THREE 5 WHEN MISSING  */
                                                when nvl(solde[cv()-1],0) + nombretitres[cv()] > 0
                                                then nvl(solde[cv()-1],0) + nombretitres[cv()]
                                                else 0
                                           end
    IDENTIFIANTACTIONNAIRE
    NUMEROECRITURE
    SENSOPERATION
    NOMBRETITRES
    INDICATEURPMU
    SOLDE
    10
    1111
    I
    5
    Yes
    5
    10
    2222
    I
    2
    Yes
    7
    10
    3333
    R
    -7
    Yes
    0
    10
    4444
    R
    -5
    Yes
    0
    10
    5555
    I
    5
    Yes
    5
    10
    6666
    I
    0
    Yes
    0
    10
    7777
    I
    0
    Yes
    0
    10
    8888
    I
    0
    Yes
    0
    Regards
    Etbin

  • Both refer between columns in Model function

    Hello,
    Here is my SQL to create and insert :
    CREATE TABLE "SYSTEM"."PMUOrdinaireTMP111111"
       ( "IDENTIFIANTACTIONNAIRE" NUMBER(23,0),
      "NUMEROECRITURE" NUMBER(8,0),
      "SENSOPERATION" VARCHAR2(20 BYTE),
      "PRIXREVIENT" NUMBER(19,2),
      "NOMBRETITRES" NUMBER(15,0),
      "SOLDE" NUMBER(20,0)
    insert into PMUSALARIAUXTMP111111 values (10,1004848,'I',0,1,1);
    insert into PMUSALARIAUXTMP111111 values (10,1123692,'I',721,1,2);
    insert into PMUSALARIAUXTMP111111 values (10,1150237,'I',0,1,3);
    insert into PMUSALARIAUXTMP111111 values (10,1185011,'I',0,1,4);
    insert into PMUSALARIAUXTMP111111 values (10,1377533,'I',703,1,5);
    insert into PMUSALARIAUXTMP111111 values (10,1426786,'R',0,5,0);
    insert into PMUSALARIAUXTMP111111 values (10,1901940,'I',0,1,1);
    insert into PMUSALARIAUXTMP111111 values (10,2172420,'R',0,1,0);
    insert into PMUSALARIAUXTMP111111 values (10,2953958,'I',0,1,1);
    I then apply This SQL to get desired result :
    select
      IDENTIFIANTACTIONNAIRE,
      NUMEROECRITURE,
      SENSOPERATION,
      NOMBRETITRES,
      PRIXREVIENT,
      Solde,
      PrixRevDevOrigine,
      PrixRevEuro,
      CumulEuro,
      PMUEuro,
      PMUEuroArrondi,
      flag
      from PMUOrdinaireTMP111111
    model partition by (IDENTIFIANTACTIONNAIRE)
           dimension by (row_number() over (partition by IDENTIFIANTACTIONNAIRE order by NUMEROECRITURE) rid)
           measures(NUMEROECRITURE,
                    SENSOPERATION,
                    PRIXREVIENT,
                    NOMBRETITRES,
                    Solde,
                    0 PrixRevDevOrigine,
                    0 PrixRevEuro,
                    0 CumulEuro,
                    0 PMUEuro,
                    0 PMUEuroArrondi,
                    nvl(last_value(case when SENSOPERATION = 'R'
                                        then 'R'
                                   end ignore nulls
                                  ) over (partition by IDENTIFIANTACTIONNAIRE order by NUMEROECRITURE),
                        'I'
                       ) flag
    rules sequential order
    PrixRevDevOrigine[any] order by NUMEROECRITURE = case when SENSOPERATION[cv()] = 'R'
                                                          THEN 0
                                                          ELSE PRIXREVIENT[cv()] END,
    PrixRevEuro[any] order by NUMEROECRITURE = NombreTitres[cv()]*PrixRevDevOrigine[cv()],  
    CumulEuro[any] order by NUMEROECRITURE = case WHEN Solde[cv()] = NombreTitres[cv()] and SENSOPERATION[cv()] = 'I'
                                                  THEN NombreTitres[cv()]*PrixRevEuro[cv()]
                                                  when SENSOPERATION[cv()] = 'I'
                                                  THEN CumulEuro[cv()-1]+PrixRevEuro[cv()]
                                                  WHEN SENSOPERATION[cv()] = 'R' THEN PMUEuroArrondi[cv()-1] END ,
    PMUEuro[any] order by NUMEROECRITURE = case when Solde[cv()] = 0
                                                          THEN 0
                                                          ELSE CumulEuro[cv()]/Solde[cv()] END,
    PMUEuroArrondi[any] order by NUMEROECRITURE = trunc(PMUEuro[cv()],2)        
    I was hoping to get this result :
    IdentifanActionnaire
    NumeroEcriture
    SensOperation
    NOMBRETITRES
    PRIXREVIENT
    Solde
    PrixRevDevOrigine
    PrixRevEuro
    CumulEuro
    PMUEuro
    PMUEuroArrondi
    flag
    10
    1004848
    I
    1
    0
    1
    0
    0
    0
    0
    0
    I
    10
    1123692
    I
    1
    721
    2
    721
    721
    721
    360,5
    360,5
    I
    10
    1150237
    I
    1
    0
    3
    0
    0
    721
    240,333333
    240,33
    I
    10
    1185011
    I
    1
    0
    4
    0
    0
    721
    180,25
    180,25
    I
    10
    1377533
    I
    1
    703
    5
    703
    703
    1424
    284,8
    284,8
    I
    10
    1426786
    R
    5
    0
    0
    0
    0
    0
    284,8
    284,8
    R
    10
    1901940
    I
    1
    0
    1
    0
    0
    0
    0
    0
    R
    10
    2172420
    R
    1
    0
    0
    0
    0
    0
    0
    0
    R
    10
    2953958
    I
    1
    0
    1
    0
    0
    0
    0
    0
    R
    But I get this :
    IdentifanActionnaire
    NumeroEcriture
    SensOperation
    NOMBRETITRES
    PRIXREVIENT
    Solde
    PrixRevDevOrigine
    PrixRevEuro
    CumulEuro
    PMUEuro
    PMUEuroArrondi
    flag
    10
    1004848
    I
    1
    0
    1
    0
    0
    0
    0
    0
    I
    10
    1123692
    I
    1
    721
    2
    721
    721
    721
    360,5
    360,5
    I
    10
    1150237
    I
    1
    0
    3
    0
    0
    721
    240,333333
    240,33
    I
    10
    1185011
    I
    1
    0
    4
    0
    0
    721
    180,25
    180,25
    I
    10
    1377533
    I
    1
    703
    5
    703
    703
    1424
    284,8
    284,8
    I
    10
    1426786
    R
    5
    0
    0
    0
    0
    0
    0
    0
    R
    10
    1901940
    I
    1
    0
    1
    0
    0
    0
    0
    0
    R
    10
    2172420
    R
    1
    0
    0
    0
    0
    0
    0
    0
    R
    10
    2953958
    I
    1
    0
    1
    0
    0
    0
    0
    0
    R
    I think the reason is that CumulEuro is calling PMUEuroArrondi and also PMUEuro is calling CumulEuro when the column "SensOperation"  = R. As simple, When "SensOperation"  = R then I only trunc the previous PMUEuroArrondi value.
    Regards,
    Any Help

    Sorry, i probably dont understand your question.
    You ask for the value marked in red.
    This is the PMUEuro column.
    The rule for this column is
    PMUEuro[any] order by NUMEROECRITURE = case when Solde[cv()] = 0
                                                          THEN 0
                                                          ELSE CumulEuro[cv()]/Solde[cv()] END,
    As Solde in the specific row is 0 you got 0 here according to your rule.

  • 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

  • How can I modify the NonLinear curve fit in 7.1 to a new formula?

    My problem is something like this.
    I am a beginner in LabVIEW and I have been trying to put together a piece of program that would acquire, analyze and display data from dynamic light scattering. I used a Formula Node to create a autocorrelation function which works a lot faster that the function that is on the functions palette and I have my final results in array and graph forms. I tried to look at the examples provided in the software package for some nonlinear fitting and I found the NonLinear Lev-Mar Fit.vi which would do something close to what we needed, but not enough. The autocorrelation data looks as a simple exponential decay, but the fitting procedure needs an extra term in the fitting equation to account for any undesired noise in the solution of interest. That term includes an Exponential Integral which LabVIEW had in its special function section. The problem that I have is to Modify the Lev-Mar fitting vi to account for the change. My formula looks something like:
    f = (B*exp(-A*x) + (1 - B )* ExpIntegr (g*x))^2
    where A and B are our fitting coefficients and the information of interest is included in A.
    Thank you very much for your time.

    What is g? A constant? Another fitting parameter?
    It is hard work to adapt the old lev-mar fit to a new model. Things are much improved in LabVIEW 8.0+, where the model VI is called via reference and tons of other improvements were implemented.
    I made similar improvements in 7.1 and you can e.g. try to modify one of my many such postings. I posted one involving exponential integrals a long time ago.
    (Download the example EI_Fit.llb)
    To adapt, just change the model and adjust the number of parameters if needed.
    For details, check the original thread. Let me know if you have any questions.
    LabVIEW Champion . Do more with less code and in less time .

  • 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