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

Home » Public Forums » archive » SVDFIT error
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
SVDFIT error [message #93216] Fri, 13 May 2016 23:42 Go to next message
amin farhang is currently offline  amin farhang
Messages: 39
Registered: November 2010
Member
Dear All,

I'm trying to fit a function to some data with SVDFIT function.
But unfortunately although the A vector is defined, program return % Variable is undefined: A.
What is happening?

CODE:

FUNCTION fnc, X ,M
RETURN,[ [X^A[1]], [A[0]*A[1]*X^(A[1]-1.0)] ]
END

t = [13.05, 13.15, 13.2500, 13.3500, 13.4500, $
13.5500, 13.6500, 13.7500, 13.85, 13.95, 14.05, $
14.15, 14.25, 14.35, 14.45, 14.55]
t = 10^t

r = [3.61683, 3.64082, 3.63685, 3.64338, 3.61213, $
3.64366, 3.61047, 3.51532, 3.51648, 3.48258, $
3.48976, 3.48247, 3.44729, 3.21, 3.52913, 3.28420]

yr = [0.0466166, 0.0641466, 0.103431, 0.127357, $
0.177178, 0.221442, 0.277869, 0.405861, 0.439394, $
0.519617, 0.801912, 0.792799, 0.57920, 0.13516, $
0.13516, 0.43342]


A = [3.,1.]
result = SVDFIT(t,r,A=A,MEASURE_ERRORS=yr,$
FUNCTION_NAME='fnc', SIGMA=SIGMA, YFIT=YFIT)


Best regards,
Re: SVDFIT error [message #93217 is a reply to message #93216] Sat, 14 May 2016 11:56 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Um, your function is using the variable A but what is passed into it is the variable M

> FUNCTION fnc, X ,M
> RETURN,[ [X^A[1]], [A[0]*A[1]*X^(A[1]-1.0)] ]
> END



On Saturday, May 14, 2016 at 2:42:13 AM UTC-4, Amin Farhang wrote:
> Dear All,
>
> I'm trying to fit a function to some data with SVDFIT function.
> But unfortunately although the A vector is defined, program return % Variable is undefined: A.
> What is happening?
>
> CODE:
>
> FUNCTION fnc, X ,M
> RETURN,[ [X^A[1]], [A[0]*A[1]*X^(A[1]-1.0)] ]
> END
>
> t = [13.05, 13.15, 13.2500, 13.3500, 13.4500, $
> 13.5500, 13.6500, 13.7500, 13.85, 13.95, 14.05, $
> 14.15, 14.25, 14.35, 14.45, 14.55]
> t = 10^t
>
> r = [3.61683, 3.64082, 3.63685, 3.64338, 3.61213, $
> 3.64366, 3.61047, 3.51532, 3.51648, 3.48258, $
> 3.48976, 3.48247, 3.44729, 3.21, 3.52913, 3.28420]
>
> yr = [0.0466166, 0.0641466, 0.103431, 0.127357, $
> 0.177178, 0.221442, 0.277869, 0.405861, 0.439394, $
> 0.519617, 0.801912, 0.792799, 0.57920, 0.13516, $
> 0.13516, 0.43342]
>
>
> A = [3.,1.]
> result = SVDFIT(t,r,A=A,MEASURE_ERRORS=yr,$
> FUNCTION_NAME='fnc', SIGMA=SIGMA, YFIT=YFIT)
>
>
> Best regards,
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: SPAWN result
Next Topic: plot data

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

Current Time: Wed Oct 08 15:14:37 PDT 2025

Total time taken to generate the page: 0.00436 seconds