Lev-Mar template missing

I am trying to fit A*sin(w*t+phi) to some noisy data (amplitude, frequency, and phase are all to be detrmined from the matched sine). When I looked at the Lev-Mar fitting VIs I could not locate the template for the LM model function and gradient VI template mentioned in the Help file. labview\vi.lib\gmath\opti.llb\numerical is empty. (Help says this template should be there). The figure in the help file shows a cluster called Output Control as an input to the VI, but does not specify the elements of the control. I also could not find a way to put the formula into the String Formula version. Is there a listing of the available functions and syntax? The help did not seem to lead me to it.
LV8.0.1 on Mac OS X
Maybe it is just too late on Friday afternoon.
Lynn

Sarah, Christian,
I had looked at that link and several others. I was hoping to find some reference where someone had made some practical suggestions reagrding optimizing the initial guesses, or at least some clues as to how to go about it.
My data has a frequency range of about 2.5:1 so I was hoping I could just set the initial guess at the middle of the range. In my testing an initial guess 20% above or below the actual frequency resultis in erroneous values about 80-90% of runs with noise at 10% of signal amplitude which is better than the real data. With initial amplitude and phase equal to the data parameters and initial frequency guess at 1.2 times the actual I recorded two runs with the fit frequency at 99.9%. Eight others produced: 160%, 180%, 210%, 160%, 160%, 130%, 60%, and 160%. With the initial frequency at 80%, the results were somewhat worse.
My suspicion is that because the partial derivatives of the model equation are also sines and cosines, the algorithm tends to find some kind of local minimum and converges to that even though it is a really poor fit.
Here is my modified Lev-mar VI and the simple sine model VI (LV8). The default values are fairly typical of the data sets we will be getting.
Thanks for the help.
Lynn
Attachments:
Nonlinear Fit Lev-Mar.Berry.vi ‏41 KB
simple sine model.vi ‏21 KB

Similar Messages

  • Lorentz fit of a curve with Lev-Mar

    Hello everybody! I am trying to set of data to a Lorentz curve to calculate a Q value (resonance.) I found a program on a thread from this forum that appears to work with the sample data set from the thread. However, when I try to run the program using my data set with known fitted coefficients as the initial guesses, we get an error in the Lev-Mar sub-VI -- something like “the input matrix is singular”. There’s a screenshot of my data in in the attached zip folder, as well as the text file containing my data.
    My data curves down (reaching a minimum) instead of up, as in the sample data set, but it seems like that should be accounted for by the different initial guesses. I am thinking that something else is going on; hopefully it is something simple that I am just missing. Any help y'all can provide would be greatly appreciated!
    Thank you!
    Attachments:
    Lorentz Fit.zip ‏1992 KB

    Hello Lynn,
    Yes, there are quite a few potential peaks in that data set. The peak you identified was the one that we are trying to fit (The peak should be trimmed by the cursors.) We used origin to fit that same peak in order to get the initial guesses for the coefficients in the screenshot. When it runs, we get the error message: "Error -20041 occured at NI_Gmath.lvlib: Nonlinear Curve Fit LM.vi:2 Possible reason(s): Analysis: The system of equations cannot be solved because the input matrix is singular." 
    Thanks!
    -Garrison

  • Moved: Creation of new iViews not possible because templates missing

    Hello,
    sorry I moved this issue to "Portal Content Development"
    Creation of new iViews not possible because templates missing
    Regards
    Alex
    Message was edited by:
            Alexander Lepka

    Alex,
    I'd be curious to know what SAP says.  We have the same problem.  Not sure how/if we broke it, but we can no longer create iviews using the wizard.  I opened an OSS msg a while ago, but did not get much assistance. 
    We have recently upgraded to 2004s and it did not resolve the issue as I hoped it would. 
    If SAP provides a solution for you, please post it. 
    Thanks,
    Shelly

  • Outlook Integration - Snapshot templates missing when upgrade to 8.8 PL14

    hello all,
    We have a problem when upgrade from B1 8.8 PL10 to PL14, the snapshot template missing. We had no problems to generate snapshots in B1 8.8 PL10.
    All the snapshot templates has been installed on <Servername>\B1_SHR\AddOn\Microsoft Outlook Integration\Templates\Default
    And in the -GoTo meny- and select -create default templates- could not be started.
    Grateful for all help.

    Hi Jorg,
    I quote a solution for similar case but the solution is based on client PC :
    OI: Failed to create snapshot template in client machine
    Symptom
    You start up Outlook integration Addon in client machine. When you want to create a snapshot template, you get an error that can not create it.
    Other terms
    SAP Business One, Add-on, Outlook integration, OI, snapshot template, Index, Host, U_Host, BOOSTP , failed to create
    Reason and Prerequisites
    The index on user defined table [@BOOSTP] is not right. It does not include column U_Host.
    Solution
    You can run below script to fix it,
    IF EXISTS (SELECT 1 FROM CUFD
    WHERE AliasID = 'Host'
    and TableID = '@BOOSTP')
    BEGIN
    IF EXISTS (SELECT name FROM sys.indexes
    WHERE name = N'@BOOSTPBOOSTPI1')
    DROP INDEX [@BOOSTP].[@BOOSTPBOOSTPI1]
    IF EXISTS (SELECT name FROM sys.indexes
    WHERE name = N'BOOSTPI1')
    DROP INDEX [@BOOSTP].[BOOSTPI1]
    ALTER TABLE [@BOOSTP] ALTER Column U_Host nvarchar(200)
    CREATE INDEX BOOSTPI1
    ON [@BOOSTP](U_TplName, U_Language, U_CatID, U_Host)
    IF NOT EXISTS (SELECT 1 FROM UKD1
    WHERE tableName = N'@BOOSTP' and SubKeyId = 3)
    Insert into UKD1 values('@BOOSTP',0,3,'Host')
    END
    ELSE
    Print 'There is no U_Host column in @BOOSTP table!'
    if the above solution can't solve it, log a message to SAP support.
    JimM

  • 'save site as template' missing SP2013

    Hello!
    I would like to save my webpart page as a template. The problem is that i don't see "save site as template" anywhere on this site. On another site i've created the "save site as template" is visible.
    What could be the problem? I think i activated the necessary features. 
    Thanks. 

    Hi,
    Open the site in SharePoint Designer, in the home page, Click on “Site Options”, you will get prompt, In the “Parameters”
     Tab, you can find “SaveSiteAsTempalteEnabled”, set it to true.
    For more information, see
    http://microsoftechies.wordpress.com/2013/01/08/sharepoint-2013-save-site-as-template-missing/
    Best Regards.
    Kelly Chen
    TechNet Community Support

  • Curve Fit of ODE, should I use Lev-Mar or Constrained Nonlinear Optimization?

    I wanna do a curve fitting of differential equations, following is the equations:
    dx/dt = u*x-a*x
    ds/dt = b*u*x+c*x
    dp/dt = d*u*x+e*x+f*p
    and u = um*s/(km+s+s^2/ki)
    I've tried "nonlinear curve fit( Lev-Mar)", but I met difficulties when writing the f(x,a) of Lev-Mar.
    Then I tried "Constrained Nonlinear Optimization", I found that the example "Estimate Nonlinear Spring Constant.vi"
    in the "labview\examples\math\curvefit.llb" was similar to the fitting I tried to do, but there was only one parameter
    need to estimate in this example,but what I need is to estimate 3 parameters.
    However,I modified the example to my equations, it failed again.
    How can I achieve this? is it possible to do this fit only using Labview VIs or need Matlab Script Node?
    Any help will be appreciated.

    I forgot to mention that in the equations above,  a,b,c,d,e,f is constant,
    and the data of x,s,p corresponding with the data of time is already known,
    and which parameters I wanna identify is um,km,and ki
    帖子被myafu在12-22-2006 01:33 AM时编辑过了

  • A confusing lev-mar error

    I am trying to fit a Lorentzian to some acquired data using the lev-mar function, and it returns the error "wrong model equation". I know for a fact that the data has a lorentzian shape because I wrote a little vi to fit it manually using the exact same equation. Does anyone have a suggestion as to what to do next, or at least what the "wrong model equation" error really means? Thank you.
    JPC

    The error refers to a syntax issue with the "model description" input.
    This input is a cluster of three strings: model, which is the actual equation (Ex: a+b*x+c*x^2); paramters, which are the solvable variables (a, b, & c in the previous ex.) inputted as an array of strings; and the independent variable (x).
    All 3 parts of the model must match exactly (e.g. you can't have 3 variables in the model and 1 in the parameters, and if you designate x as the independent variable, there must be an x in the model equation).
    Additionally, the model equation follows standard LabVIEW formula node syntax, except there are no input variables designated ("y=x+1" won't work but "x+1" will) and you don't need a semi-colon terminator.
    Let me know how it goes,
    ~j5
    2006 Ultimate LabVIEW G-eek.

  • Depoyed com.businessobjects.pct.masteriview.par but iview template missing

    Hi
    I have successfully deployed the com.businessobjects.pct.masteriview.par in Portal
    I had taken the PAR file from the installation KIT folder of SAP Integration KIT
    I have ONLY deployed the PAR and deployment was successful
    I am using SAP EP 7.0 SP21
    After the deployment I can not see the BusinessObjects Integration Kit -iView template in the iView creation template
    I have refresh the browser, logoff and login number of times, clear the browser cache and history also.
    Any suggestion what I need to do to get the BusinessObjects Integration Kit -iView template
    Regards
    Janak Mehta

    Hi,
    Do check the below forums for more details:
    Do not see BusinessObjects Enterprise Integration Kit - iView template
    IView Template Missing
    Hope this may help you.
    -Noor.

  • Curvefit of the reflectivi​ty with Lev-Mar

    Hello,
    I am a beginner with Labview and I need your help, I recuper the data of the reflectivity from the spectrometer (3648 points) and I am going to make the fitting to extract information about the thickness and refractive indices n and k (k in the general case it will be zero because the materials used are oxides and I work in the visible range.
    I want to use the model of Lev-Mar but I have the problem with the model, i have used the formula node to write the eqaution of the reflectivity, and currently I am block.
    Data.txt
    column1 = Lambda
    column 2 : Reflectivity
    the substrate is Pyrex  ; n= 1,47
    the thin film is Ti-Nb, the index is like that of the titane(Antase) : ñ = 2,561 + i2,488
    Thank you very much.
    Nb: i know my english is so bad
    Attachments:
    fit1.png ‏36 KB
    fit2.png ‏30 KB
    Data.txt ‏51 KB

    Thank you very much Lynn,
    I did what you told me to do and it works a better,
    I would like to know if you can help me, I have the values of the reflectivity R as a function of the wavelength (lambda) but the indices " n "  and " k " are also a function of lambda.
    R = (n,k,d,lambda )   and  the dispersion equation n(lambda) and k(lambda)
    With the curvefit Lev-Mar is possible to define these parameter ? if you have ideas that will be cool

  • Problem: Fitting Lev-Mar with Error Function

    Hi everyone,
    I have very little experience with LabVIEW and I'm trying for the first time to do some NonLinear Curve fit for some data I have.
    I've searched in forums for almost a day and couldn't find what I need. The problems are:
    1) I need to fit a function of the following type: P = Po/2 - Po/2*erf(sqrt(2)*(x-xo)/w) , where Po, xo and w are my parameters.
    But in my error2.vi I cannot link my y=sqrt(2)*(x-xo)/w  variable of the erf function to the input, because the erf.vi does not accept 1D array as input and doesn't give that as output as well. The output thing is another problem, since the input of F(x,a) needs to be a 1D array.
    2) I read about the Lev-Mar NonLinear CurveFit VI and I think I got what needs to be done. However, a I was having problems in wiring my Static VI Reference to the F(x,a) input in the Lev-Mar VI and it didn't give me a broken wire only when I made de Reference a "Strictly Typed VI Reference". What does that mean? Why did it only work with that?
    I know these are some pretty basic doubts, but I've been trying to understand it for quite some time and couldn't get this done.
    Thanks.
    PS* The fitting function (subvi) is the error2.vi file.
    Solved!
    Go to Solution.
    Attachments:
    error2.vi ‏13 KB
    FittingGaussianKnife.vi ‏15 KB

    Try this. Seem to work  just fine (LabVIEW 2013).
    (don't try to graph the best parameters, graph the best fit output!)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FittingGaussianKnife_MODCA.vi ‏17 KB
    error2_MODCA.vi ‏14 KB
    erfit.png ‏40 KB

  • Please help on this Lev-Mar problem

    Hi,
    I have two acquisition data sources that need
    to be fitted. Then the fitted parameters are
    passed along with data for further processing.
    As the data is heardware generated, I made a
    similar 'signal generator' to present very closely
    the problem.
    ===Please see the attached vi file===
    As you can see, these two Lev-Mar's function
    / derivatives are obviously different. We can edit
    the fuction / derivative node. But the problem
    is that when one is edited, the other changes too.
    Anyways, we can NOT have two different functions.
    My question is: How to have two different function
    / Deveritives here?
    By the way, how to replace the MatLab box into
    function node in my attached example?
    I can 'wire' the out
    put to next if it's a
    function node. It says the type of variables are
    different (output is a real instead of array).
    Attachments:
    Lev-Mar-Question2.vi ‏99 KB

    You have a few options for multiple function/derivatives.
    1. If you can express the model functions using the formula string syntax, then you might consider using the "Levenberg Marquardt.vi". Unfortunately the Levenberg-Marquardt.vi does not allow the specification of the derivative of the model function and always uses numerical derivatives. It is also somewhat slower than the "Nonlinear Lev-Mar Fit.vi".
    2. You could also save a copy of the "Nonlinear Lev-Mar Fit.vi" using a different name, and also the "Lev-Mar ABX.vi" and "Target Fnc & Deriv Nonlin.vi" with different names. Then you would have a different set of VIs to implement the curve fitting on two different models. This is ugly, but would work.
    3. You could modify the "Nonlinear Lev-Mar
    Fit.vi", "Lev-Mar ABX.vi", and "Target Fnc & Deriv Nonlin.vi" to accept/pass VI references. The "Target Fnc & Deriv Nonlin.vi" would then perform a call by reference to a VI that you wrote implementing the current model function.
    To replace the Matlab script node place the formula node inside a for-loop. The for-loop will auto-index the x and t arrays, and auto-build the y-array.

  • How to constrain parameters in Lev-Mar?

    It's a common case for non-linear fitting.
    How can it be done in LabView's Lev-Mar?
    Thanks.

    The provided LabVIEW implementation does not contain options for parameter bounds.
    One solution would be to re-parametrize your code in terms of unconstrained variables that cause a constraint on your original parameters.
    Some transformations for one-sided or two-sided parameter bounds are given here:
    http://www.id.unizh.ch/software/unix/statmath/sas/sasdoc/stat/chap19/sect41.htm
    The link also lists references with more details.
    LabVIEW Champion . Do more with less code and in less time .

  • Ajustement de courbe (Fitt) Lev-Mar

    Bonjour/Bonsoir
    Je veux faire un ajustement de courbe en utilisant le modèle de Mar-Lev pour des mesures de la Réflectivité en fonction de la longeur d'onde mais j'ai pas réussi à le faire;
    Les valeurs de "n" et "k"  varient en fonction de la longueur d'onde mais la je les ai pris fixes, es ce qu'il y a une possibilité de prendre les paramètres comme étant des tableaux ??.
    Les valeurs de "ns" et "ks"  je peux les considérer fixes mais comment faire pour changer leurs valeursr dans la formule ( Utilisation d'une variable globale ???)
    je voudrais savoir aussi es ce que c'est mieux d'utiliser Lev-Mar : VI ou chaine de formule.
    Je sais pas s'il manque d'autres informations .
    merci pour votre aide.
    Cordialement.
    Pièces jointes :
    1NI.png ‏37 KB
    2NI.png ‏62 KB

    Bonjour,
    "Les valeurs de "n" et "k"  varient en fonction de la longueur d'onde mais la je les ai pris fixes, es ce qu'il y a une possibilité de prendre les paramètres comme étant des tableaux ??."
    --> oui, tout est possible. seulement je ne vois pas où sont ces paramètres dans le code, donc c'est dur.
    Les valeurs de "ns" et "ks"  je peux les considérer fixes mais comment faire pour changer leurs valeursr dans la formule ( Utilisation d'une variable globale ???)
    --> si je comprends, ils sont fixes mais tu veux pouvoir contrôler leur valeur depuis "l'extérieur". Dans ce cas, variable globale ou variable globale fonctionnelle (=VGF). Tu trouveras des exemples facilement pour les VGF
    "je voudrais savoir aussi es ce que c'est mieux d'utiliser Lev-Mar : VI ou chaine de formule."
    --> à toi de voir selon tes exigences et tes critères. La formule est peut-être plus performantes en terme de temps d'exécution, mais le code tient plus de place dans le diagramme, il est peut-être moins lisible. Moi je prendrais la formule, car ça s'exécute plus vite et on sait exactement quel calcul est fait.
    Francis M | Voir mon profil
    Certified LabVIEW Developer

  • Templates missing

    Somehow all my WSS templates are GONE; this includes the Default and the "Fab 40" I had installed. Not sure when/what happened, been several weeks since I've accessed our site, which is just for intranet and not yet in production.
    If I run stsadm -o enumtemplates I get:
    "There are no items matching the criteria specified."
    When I go to Home->View All Site Content->Create this is what I see:
    http://i68.photobucket.com/albums/i33/Mamba357/Work/notemplates.jpg
    This is a WSS 3.0 (not upgrade) stand-alone install.
    AFAIK this was working okay last time I accessed the site, as I was creating a form (a list). I've tried rebooting the server, and Deactive/Activate the Team Collaboration Lists in the Site Settings->Site Features page.  ????
    TIA,
    M

    Regarding the create list issue,  I found the create list issue also may caused by the user permission for web application. I suggest you perform the steps below:
    1. Open Sharepoint 3.0 Central Administration
    2. Click application management > user permissions for web application
    3. select the problematic web application
    4. Under list permissions, check manage Lists.
    5. Click OK and test the issue.
    If the issue persists, please also confirm  whether other checkboxes are checked under user permissions and check them.
    Regarding the template missing issue, please answer the following questions. It’s important for us to narrow down the cause:
    1. Does the issue occur on different site collections?
    2. Does the issue occur on different webapplications?
    If the issue occurs on different webapplications, I suggest run the following command to re-config resource security on this server.
    PSCONFIG.EXE -cmd secureresources
    More information about PSCONFIG.EXE command :
    http://technet.microsoft.com/en-us/library/cc263093.aspx
    If the issue persists, please check uls log and post the related error.

  • Varying Lev-Mar init. conditions causes wide change in fit coeficients.

    Hey, I'm trying to use the advanced Lev-Mar fit vi to fit an exponential decay with an offset. I noticed that when I vary the initial condition for the time constant by 5% I get significant changes in my fit coeficient for the same parameter. However, when I multiply my input Y values by 10^4, the fit coeficients are more robust and change little with initial conditions that vary more than 10%. Also, the values now seem to match well with values I obtain when I perform the same fit in the Origin plotting program. Why is this? All my values are in double precision so I don't see how this could be a precision issue.

    The Lev-Mar has a well-known "bug" in the termination condition IF you fail to wire the "standard Deviation Input". In this case, the standard deviation is taken as 1, which is fine except for the case where your y-data is very small (e.g. all in microvolts or nanovolts). In this case, the function is considered converged after one iteration using the initial guesses.
    You have two options:
    (1) (not recommended) Edit the Lev-MAR.vi and make the diagram constant in the bottom center much smaller.
    (2) (RECOMMENDED!) Always wire a "standard deviation input array". In your case, just create an array with equal size as your data, initialized with numbers corresponding to the noise in your data. It does not need to be accurate, you could just take it as e.g. 10E-4 to 10e-6 times your y-range (y-max minus y-min).
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for