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

Home » Public Forums » archive » Re: How can I add parameter to curvefit?
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
Re: How can I add parameter to curvefit? [message #5301] Wed, 15 November 1995 00:00
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <4832k1$37f@decaxp.harvard.edu>, kkobayas@scws40.harvard.edu (Ken Kobayashi) writes:
>
> Hi,
>
> I'm doing a curve fitting using CURVEFIT. However, I would like to be
> able to pass on an extra paremeter to the function that CURFEFIT calls.
> (i.e. the one that returns the function I'm trying to fit to and its
> derivative.) In other words, if the function has three parameters, do a
> least-square fit using just two of the parameters. The only ways I could
> think of were (a) hack CURVEFIT.PRO to add a parameter to the function
> calls, or (b) save the parameter in a file and read that. (a) has a
> problem with portability, and (b) seems rather slow considering the
> function is called many tims. Is there a better way to do this?
>
Use common blocks to communicate the information between your program which
calls CURVEFIT and your evaluation function.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
Re: How can I add parameter to curvefit? [message #5308 is a reply to message #5301] Tue, 14 November 1995 00:00 Go to previous message
hahn is currently offline  hahn
Messages: 108
Registered: November 1993
Senior Member
kkobayas@scws40.harvard.edu (Ken Kobayashi) wrote:


> Hi,

> I'm doing a curve fitting using CURVEFIT. However, I would like to be
> able to pass on an extra paremeter to the function that CURFEFIT calls.
> (i.e. the one that returns the function I'm trying to fit to and its
> derivative.)
[snip]

There is no problem with portability esp. if you change the name
of the procedure to keep the original.

The other idea, to save the parameter in a file, will only be helpful
when you need this for some other reason (log file).

You may save the parameter in a common block. Although common
blocks are not loved by those programmers who favour structured
programming, this feature is well implemented in IDL and can be used
quite efficiently. BTW it's a lot faster to access variables via
common rather than passing structures via a parameter list!

> - Ken
> --
> ------------------------------------------------------------ -----------------
> Ken Kobayashi . "Too low they build, who build
> kkobayashi@cfa.harvard.edu . beneath the stars."
> http://stargazer.student.harvard.edu/ . - Edward Young

Norbert Hahn
Re: How can I add parameter to curvefit? [message #5310 is a reply to message #5308] Tue, 14 November 1995 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
kkobayas@scws40.harvard.edu (Ken Kobayashi) writes:


> Hi,

> I'm doing a curve fitting using CURVEFIT. However, I would like to be
> able to pass on an extra paremeter to the function that CURFEFIT calls.
> (i.e. the one that returns the function I'm trying to fit to and its
> derivative.) In other words, if the function has three parameters, do a
> least-square fit using just two of the parameters. The only ways I could
> think of were (a) hack CURVEFIT.PRO to add a parameter to the function
> calls, or (b) save the parameter in a file and read that. (a) has a
> problem with portability, and (b) seems rather slow considering the
> function is called many tims. Is there a better way to do this?

You can always use a common block to pass additional information to the fitted
function.

Bill Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Shaded cylinder in 3D with IDL
Next Topic: Re: Inaccuracies

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

Current Time: Wed Oct 08 19:39:31 PDT 2025

Total time taken to generate the page: 0.00597 seconds