help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extrapolation


From: Macy
Subject: Re: Extrapolation
Date: Sat, 24 Aug 2013 07:08:13 -0700

Just occurred to me, why do you need 17 to become 34 and not stop at the end 
points for 33? That way, you would NOT have to extrapolate at all.

Did you try my suggestion? making the 'next' points simply 2*value(end) - 
value(end-1)?  That's a linear extrapolation that should match all your 
interpolation points. When I say, match, I mean add the same 'distortion' 
throughout your amtrix. By distortion, I mean, make every other second 
deriviatives disappear. [I think]


--- address@hidden wrote:

From: Sarah Ali <address@hidden>
To: Macy <address@hidden>
Subject: Re: Extrapolation
Date: Sat, 24 Aug 2013 02:10:33 -0700 (PDT)

Thanks for replying Macy!

yes it is linear. a, b and c are given. 

For interpolation,
I have to add values to “a” and “b” like adding 1.5 between 1 and 2
and so on. 
Similarly for “b” add 0.0015 between 0.001 and 0.011 and so on.
I
have to add same number of points for a and b, and thus c values will be 
automatically
generated.


________________________________
 From: Macy <address@hidden>
To: Sarah <address@hidden> 
Sent: Monday, August 19, 2013 8:26 PM
Subject: Re: Extrapolation
 

You're lucky your numbers are evenly spaced.

I don't remember how the interp function works. Is it linear? 

You can do the same if you're only adding a single edge of numbers, run index 
out.

Just make the next number out equal to the adjacent number, then find the slope 
between the last number and the inside number and continue that slope and 
you've got a decent approximation to the extrapolation.

xe= x(end) + ( x(end)-x(end-1) ) * step/step = 2*x(end)-x(end-1)

It's hokey, but you can see it continues the slope out a bit.  

A far better way is to use the sinx/x formula where you take into acount ALL 
the terms, but this simpler form may be enough for your needs. 






--- address@hidden wrote:

From: Sarah <address@hidden>
To: address@hidden
Subject: Extrapolation
Date: Sun, 18 Aug 2013 11:37:16 -0700 (PDT)

I want to do interpolation and extrapolation. I can interpolate by using
interp2 command. But, this command didn't perform extrapolation. Is there
any built-in function for extrapolation in octave? I have given an example
in detail. 

a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13
14 15 16 17];
b= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
0.001 0.001 0.001 0.001 0.001 0.011 0.011 0.011 0.011 0.011 0.011 0.011
0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011];
c= [ -0.88 -8.87 -0.86 -0.82 -0.77 -0.71 -0.66 -0.62 -0.57 -0.54 -0.50 -0.47
-0.44 -0.42 -0.39 -0.377 -0.36 -0.89 -0.88 -0.85 -0.81 -0.76 -0.71 -0.66
-0.61 -0.57 -0.53 -0.50 -0.47 -0.44 -0.42 -0.39  -0.37 -0.36];
cc = repmat(c,34,1);

ci= interp2(a, b, cc, 1.5, 0.0015) % Interpolation at some point

ai= [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5
12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5 5
5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5
16 16.5 17 17.5];
bi= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
0.001 0.001 0.001 0.001 0.001 0.001 0.0015 0.0015 0.0015 0.0015 0.0015
0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015
0.0015 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017
0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.011 0.011 0.011 0.011
0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011
0.011];
cim= interp2(a, b, cc, ai, bi) % Interpolation matrix


ce= interp2(a, b, cc, 18, 0.2)  % Extrapolation at some point

ae= 4* [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11
11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5
5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15
15.5 16 16.5 17 17.5];
be= [ 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101
0.101 0.101 0.101 0.101 0.101 0.101 0.1015 0.1015 0.1015 0.1015 0.1015
0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015
0.1015 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017
0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.111 0.111 0.111 0.111
0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111
0.111];
cem= interp2(a, b, cc, ae, be)  % Extrapolation matrix


How can I find 'ce' and 'cem' in this case?  Here, it gives "NA". How should
I extrapolate to find 'ce' and 'cem' ?

Thanks in advance

Sarah



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Extrapolation-tp4656696.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]