comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with mpfit.pro
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problem with mpfit.pro [message #89396] Mon, 06 October 2014 16:26 Go to next message
Payam Bagheri is currently offline  Payam Bagheri
Messages: 2
Registered: October 2014
Junior Member
Hi there,

Has anyone worked with the fitting procedure mpfit.pro in IDL? When my fitting function exceeds around 3600 characters (I have to use really large fitting functions) the code gives me this error:

% MPFITEXPR: ERROR: execution of "The FUNCTION" failed
% MPFITEXPR: check syntax and parameter usage

Has any seen this and knows a work-around?

Thanks,
Payam
Re: Problem with mpfit.pro [message #89397 is a reply to message #89396] Mon, 06 October 2014 22:44 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den tisdagen den 7:e oktober 2014 kl. 01:26:26 UTC+2 skrev Payam Bagheri:
> Hi there,
>
>
>
> Has anyone worked with the fitting procedure mpfit.pro in IDL? When my fitting function exceeds around 3600 characters (I have to use really large fitting functions) the code gives me this error:
>
>
>
> % MPFITEXPR: ERROR: execution of "The FUNCTION" failed
>
> % MPFITEXPR: check syntax and parameter usage
>
>
>
> Has any seen this and knows a work-around?
>
>
>
> Thanks,
>
> Payam

According to your error message, you are not using mpfit directly, you are using mpfitexpr. Mpfitexpr allows you to specify the function to minimize as a string but that is only useful for simple expressions.

If you use mpfit directly, you can specify your function as an idl function and specify just the name of it in the call to mpfit. Then there is no limit to how complicated your fitting function can be.

(OK, I guess there is a limit but it's not 3600 characters...)
Re: Problem with mpfit.pro [message #89400 is a reply to message #89396] Tue, 07 October 2014 08:27 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, October 6, 2014 7:26:26 PM UTC-4, Payam Bagheri wrote:
>
> Has anyone worked with the fitting procedure mpfit.pro in IDL? When my fitting function exceeds around 3600 characters (I have to use really large fitting functions) the code gives me this error:
>
> % MPFITEXPR: ERROR: execution of "The FUNCTION" failed
> % MPFITEXPR: check syntax and parameter usage
>
> Has any seen this and knows a work-around?

It means your string is not a valid IDL expression. The expression must be able to be EXECUTE()ed by IDL. I guess it is possible that IDL has a limit on the string size, but I don't know.

If you have a complicated function, you should be using MPFITFUN. Write your expression into a function once, and use that instead.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: I can only view my plot when I press control+c
Next Topic: plot position keyword

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:22:19 PDT 2025

Total time taken to generate the page: 0.00541 seconds