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

Home » Public Forums » archive » estimation matrix elements in a vector
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
estimation matrix elements in a vector [message #94282] Sun, 26 March 2017 06:27 Go to next message
kghreep21 is currently offline  kghreep21
Messages: 7
Registered: March 2017
Junior Member
Dear IDL Users,
I have a matrix like this
5.69 4.77 4.91
5.40 5.33 7.37
6.25 6.25 7.58
6.81 7.44 7.09

I would like to determine the above and the lower value of each elements in the following vector
b =[0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13. 0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25. 0,26.0,27.0,28.0,29.0,30.0]

and calculate (above value - lower value)/ ( above value - element value)

My regards
Khaled
estimation matrix elements in a vector [message #94283 is a reply to message #94282] Sun, 26 March 2017 06:37 Go to previous messageGo to next message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html
Re: estimation matrix elements in a vector [message #94284 is a reply to message #94283] Sun, 26 March 2017 09:00 Go to previous messageGo to next message
kghreep21 is currently offline  kghreep21
Messages: 7
Registered: March 2017
Junior Member
On Sunday, March 26, 2017 at 3:37:54 PM UTC+2, Yngvar Larsen wrote:
> https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html

that's O.K, that is a matrix of 4x3 . i.e the first element 5.69 have a locate 5 in b.
how we can write a code to calculate (above value - lower value)/ ( above value - element value in the matrix) and write the out comes in a same matrix of 4x3
Re: estimation matrix elements in a vector [message #94285 is a reply to message #94283] Sun, 26 March 2017 14:59 Go to previous messageGo to next message
kghreep21 is currently offline  kghreep21
Messages: 7
Registered: March 2017
Junior Member
On Sunday, March 26, 2017 at 3:37:54 PM UTC+2, Yngvar Larsen wrote:
> https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html

Thanks Yngvar.
I am already solve my problem
Re: estimation matrix elements in a vector [message #94286 is a reply to message #94285] Mon, 27 March 2017 00:00 Go to previous messageGo to next message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Sunday, 26 March 2017 23:59:26 UTC+2, kghr...@gmail.com wrote:
> On Sunday, March 26, 2017 at 3:37:54 PM UTC+2, Yngvar Larsen wrote:
>> https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html
>
> Thanks Yngvar.
> I am already solve my problem

Good!

As a courtesy to other readers, maybe you can post your code to solve this problem? This is a rather typical kind of IDL array juggling problem that others might be interested in.

--
Yngvar
Re: estimation matrix elements in a vector [message #94302 is a reply to message #94286] Sat, 01 April 2017 10:12 Go to previous messageGo to next message
kghreep21 is currently offline  kghreep21
Messages: 7
Registered: March 2017
Junior Member
On Monday, March 27, 2017 at 9:00:39 AM UTC+2, Yngvar Larsen wrote:
> On Sunday, 26 March 2017 23:59:26 UTC+2, kghr...@gmail.com wrote:
>> On Sunday, March 26, 2017 at 3:37:54 PM UTC+2, Yngvar Larsen wrote:
>>> https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html
>>
>> Thanks Yngvar.
>> I am already solve my problem
>
> Good!
>
> As a courtesy to other readers, maybe you can post your code to solve this problem? This is a rather typical kind of IDL array juggling problem that others might be interested in.
>
> --
> Yngvar

Pro Inter_Data

; we have a measured wind speed as a string like this:
acutal_w= [ 5.5, 6.4, 8.9, 10.3, 8.2, 7.7, 6.8, 5.9, 5.4, 6.6, 6.1, 6.5]

In laboratory, we have measured a wind power Coor_P corresponding to laboratory wind speed w_t

w_t =[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,2 1.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0]

coor_P=[0.00,0.00,0.00,5.00,25.00,60.00,118.00,154.00,269.00 ,411.00,538.00,600.00,600.00,$
600.00,600.00,600.00,600.00,600.00,600.00,600.00,600.00,600. 00,600.00,600.00,600.00,600.00,0.00,0.00,0.00,0.00,0.00]
; we would like to estimate a wind power corresponding a measured wind speed ;acutal_w. first, we have locate value of acutal_w in W_t via Value_locate ;function

R = VALUE_LOCATE ( w_t ,acutal_w, /L64 )

; the estimated wind power as function in acutal_w, W_t and coor_P as follows:-

pow_est=dblarr(n_elements(r))

for j = 0, n_elements(r)-1 do begin

pow_est(j) = coor_P (r(j)+1) - ( coor_P(r (j) + 1) - coor_P(r(j) ) ) * ( ( w_t ( r(j)+1) - acutal_w( j) ) / ( w_t (r(j)+1)- w_t(r(j) ) ) )

endfor



print, pow_est, format=' (12(F9.2,3x))'

end
Re: estimation matrix elements in a vector [message #94304 is a reply to message #94302] Mon, 03 April 2017 02:46 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 04/01/2017 07:12 PM, kghreep21@gmail.com wrote:
> On Monday, March 27, 2017 at 9:00:39 AM UTC+2, Yngvar Larsen wrote:
>> On Sunday, 26 March 2017 23:59:26 UTC+2, kghr...@gmail.com wrote:
>>> On Sunday, March 26, 2017 at 3:37:54 PM UTC+2, Yngvar Larsen wrote:
>>>> https://www.harrisgeospatial.com/docs/VALUE_LOCATE.html
>>> Thanks Yngvar.
>>> I am already solve my problem
>> Good!
>>
>> As a courtesy to other readers, maybe you can post your code to solve this problem? This is a rather typical kind of IDL array juggling problem that others might be interested in.
>
> Pro Inter_Data
>
> ; we have a measured wind speed as a string like this:
> acutal_w= [ 5.5, 6.4, 8.9, 10.3, 8.2, 7.7, 6.8, 5.9, 5.4, 6.6, 6.1, 6.5]
>
> In laboratory, we have measured a wind power Coor_P corresponding to laboratory wind speed w_t
>
> w_t =[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,2 1.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0]
>
> coor_P=[0.00,0.00,0.00,5.00,25.00,60.00,118.00,154.00,269.00 ,411.00,538.00,600.00,600.00,$
> 600.00,600.00,600.00,600.00,600.00,600.00,600.00,600.00,600. 00,600.00,600.00,600.00,600.00,0.00,0.00,0.00,0.00,0.00]
> ; we would like to estimate a wind power corresponding a measured wind speed ;acutal_w. first, we have locate value of acutal_w in W_t via Value_locate ;function
>
> R = VALUE_LOCATE ( w_t ,acutal_w, /L64 )
>
> ; the estimated wind power as function in acutal_w, W_t and coor_P as follows:-
>
> pow_est=dblarr(n_elements(r))
>
> for j = 0, n_elements(r)-1 do begin
>
> pow_est(j) = coor_P (r(j)+1) - ( coor_P(r (j) + 1) - coor_P(r(j) ) ) * ( ( w_t ( r(j)+1) - acutal_w( j) ) / ( w_t (r(j)+1)- w_t(r(j) ) ) )
>
> endfor
>
>
>
> print, pow_est, format=' (12(F9.2,3x))'
>
> end
>
you can also use the INTERPOL function:

pow_est=interpol(coor_P,w_t,acutal_W)

see:
http://www.harrisgeospatial.com/docs/INTERPOL.html
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 2D Histogram error
Next Topic: Invalid characters in header

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

Current Time: Wed Oct 08 08:49:56 PDT 2025

Total time taken to generate the page: 0.00526 seconds