Re: [Scilab-users] wind speed analyses via fft power spectral density investigations

2019-02-18 Thread Heinz Nabielek
CORRECTION in horizontal axis



> On 18.02.2019, at 11:46, Heinz Nabielek  wrote:
> 
> Dear friends and colleagues:
> 
> Yann Debray had put my first fragmentary attempt at wind speed analyses on 
> the web: .
> 
> Based on ca. 55.000 hub-level wind speed measurements at 10-min-intervals, I 
> am investigating the power spectral density of wind speed - diagram and code 
> below - with the help of the Scilab 'fft' function and that worked very well.
> 
> One famous Japanese wind professor [he is now away for several months] had 
> suggested "Using an arbitrary phase shift as random number into Inverse FFT, 
> you can generate similar natural wind numerically, having the same spectrum".
> 
> Now my question: HOW DO I DO THAT AND HOW I DO IT IN SCILAB?
> 
> Best greetings
> Heinz
> 
> 
> 
> 
> 
> 
> 
> [fd, SST, Sheetnames, Sheetpos] = xls_open('1.xls');
> [v, TextInd] = xls_read(fd, Sheetpos(1));
> clear SST Sheetnames Sheetpos TextInd fd
> n=length(v);
> x=(1:n)';
> z=fft(v);
> plot2d(x,abs(z),logflag='ll',style=3);
> xx=(60:2)';
> xxx=log(xx);
> M=[ones(xxx) xxx];
> y=log(abs(z(xx)));
> a=M\y
>12.513971
>   -0.8530057
> F=exp(a(1)+a(2)*xxx);
> plot(xx,F,'r--');
> xtitle('Fourier analysis of wind speeds from station 1', ...
> 'f r e q u e n c y[ c y c l e / 1 0 min. ]','p o w e r   s p e c t r a l  
>  d e n s i t y');
> title('Fourier analysis of wind speeds from station 1','fontsize',3);
> legend('measured wind speed data','fit with slope -0.853',3);
> 
> 
> 
> __
> Dr Heinz Nabielek
> Schüttelstrasse 77A/11
> A-1020 Wien, Österreich
> Tel +43 1 276 56 13
> cell +43 677 616 349 22
> heinznabie...@me.com
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] the installation of scilab-6.0.2

2019-02-18 Thread Hermes
good morning
I am presenting problems with the installation of scilab-6.0.2
All the time I receive the following alert:

 

I have uninstalled and installed several times and always with the same
alert when trying to run the software.
Gracias
Hermes



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] need a little help

2019-02-18 Thread P M
problem solved.I had to think differently than before.

Actually my goal was to compare point coordinates to map coordinates and
find the points on the map which are closest to the given point coordinates.

The map is of width:900// in reality the map is based on an image
with 900x1500 pixels
The map is of height: 1500

The points are building a line on the map...e.g: the line consists of 1076
points
So from the map I have build:

x = map(1,:);   // contains all x coordinates of the map
y = map(2,:);   // contains all y coordinates of the map

points = [ lineX, lineY];  // points contain the X-Y-coordinates of the
line

for i = 1:n
 actPoint = points(i,:);
 [nearestX xInd]   = min(abs(actPoint(1)-x));
 [nearestY yInd]  = min(abs(actPoint(2)-y));
 nearestPoint(i,:) = [x(xInd) y(yInd)];
end


This is what works for now, though it is still slow.

For searching 100 points of the line it needs about 10 seconds.
For searching 200 points of the line it needs about 19 seconds.
For searching 500 points of the line it needs about 45 seconds.
For searching 1000 points of the line it needs about 98 seconds.







Am Mo., 18. Feb. 2019 um 16:39 Uhr schrieb P M :

> Ok, thanks for your help..
>
> Actually the sizes I gave where just for demonstation.
>
> If I use the real array sizes, I get a message: can not allocate
> 7469.60MB memory...which maybe is true.
> available RAM after starting Scilab is 3701 MB
>
> actual array sizes:
>
> A has 1076 elements
> B has 1'350'000 elements, with a lot of Nan's in it
>
> if I use thrownan(B) I can reduce the array size of B to 867751 elements
> but still get the Message above.
>
> (without thrownan() the memory scilab wants to allocate is even bigger)
>
>
>
>
> Am Fr., 15. Feb. 2019 um 23:25 Uhr schrieb Samuel Gougeon <
> sgoug...@free.fr>:
>
>> ... and even clearer, with respect to your own notations:
>>
>> --> A = rand(1,1000);  // test's data
>> --> B = rand(1,1);
>> --> [a, b] = ndgrid(A, B);
>> --> size(a)  // same for b
>>  ans  =
>>1000.   1.
>> --> [v, i] = min(abs(a-b), *"c"*);
>>
>> ___
>> users mailing list
>> users@lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] need a little help

2019-02-18 Thread Claus Futtrup

Hi Philipp

>problem solved.I had to think differently than before.

Heh!

It helps to know what you actually want to do (and also the size of the 
problem).


Cheers,
Claus

On 18.02.2019 18:08, P M wrote:

problem solved.I had to think differently than before.

Actually my goal was to compare point coordinates to map coordinates 
and find the points on the map which are closest to the given point 
coordinates.


The map is of width:    900    // in reality the map is based on an 
image with 900x1500 pixels

The map is of height: 1500

The points are building a line on the map...e.g: the line consists of 
1076 points

So from the map I have build:

x = map(1,:);   // contains all x coordinates of the map
y = map(2,:);   // contains all y coordinates of the map

points = [ lineX, lineY];  // points contain the X-Y-coordinates 
of the line


for i = 1:n
     actPoint = points(i,:);
     [nearestX xInd]   = min(abs(actPoint(1)-x));
     [nearestY yInd]  = min(abs(actPoint(2)-y));
     nearestPoint(i,:) = [x(xInd) y(yInd)];
end


This is what works for now, though it is still slow.

For searching 100 points of the line it needs about 10 seconds.
For searching 200 points of the line it needs about 19 seconds.
For searching 500 points of the line it needs about 45 seconds.
For searching 1000 points of the line it needs about 98 seconds.







Am Mo., 18. Feb. 2019 um 16:39 Uhr schrieb P M >:


Ok, thanks for your help..

Actually the sizes I gave where just for demonstation.

If I use the real array sizes, I get a message: can not allocate 
7469.60MB memory...which maybe is true.
available RAM after starting Scilab is 3701 MB

actual array sizes:

A has 1076 elements
B has 1'350'000 elements, with a lot of Nan's in it

if I use thrownan(B) I can reduce the array size of B to 867751
elements but still get the Message above.

(without thrownan() the memory scilab wants to allocate is even
bigger)




Am Fr., 15. Feb. 2019 um 23:25 Uhr schrieb Samuel Gougeon
mailto:sgoug...@free.fr>>:

... and even clearer, with respect to your own notations:

--> A = rand(1,1000);  // test's data
--> B = rand(1,1);
--> [a, b] = ndgrid(A, B);
--> size(a)  // same for b
 ans  =
   1000.   1.
--> [v, i] = min(abs(a-b), *"c"*);

___
users mailing list
users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] need a little help

2019-02-18 Thread P M
..update: removing all NaN's from the map it takes about 27seconds to find
all nearest points...
I think, I can live with that...unless somebody else has another brilliant
idea.

best regards,
Philipp


Am Mo., 18. Feb. 2019 um 18:08 Uhr schrieb P M :

> problem solved.I had to think differently than before.
>
> Actually my goal was to compare point coordinates to map coordinates and
> find the points on the map which are closest to the given point coordinates.
>
> The map is of width:900// in reality the map is based on an image
> with 900x1500 pixels
> The map is of height: 1500
>
> The points are building a line on the map...e.g: the line consists of 1076
> points
> So from the map I have build:
>
> x = map(1,:);   // contains all x coordinates of the map
> y = map(2,:);   // contains all y coordinates of the map
>
> points = [ lineX, lineY];  // points contain the X-Y-coordinates of
> the line
>
> for i = 1:n
>  actPoint = points(i,:);
>  [nearestX xInd]   = min(abs(actPoint(1)-x));
>  [nearestY yInd]  = min(abs(actPoint(2)-y));
>  nearestPoint(i,:) = [x(xInd) y(yInd)];
> end
>
>
> This is what works for now, though it is still slow.
>
> For searching 100 points of the line it needs about 10 seconds.
> For searching 200 points of the line it needs about 19 seconds.
> For searching 500 points of the line it needs about 45 seconds.
> For searching 1000 points of the line it needs about 98 seconds.
>
>
>
>
>
>
>
> Am Mo., 18. Feb. 2019 um 16:39 Uhr schrieb P M :
>
>> Ok, thanks for your help..
>>
>> Actually the sizes I gave where just for demonstation.
>>
>> If I use the real array sizes, I get a message: can not allocate
>> 7469.60MB memory...which maybe is true.
>> available RAM after starting Scilab is 3701 MB
>>
>> actual array sizes:
>>
>> A has 1076 elements
>> B has 1'350'000 elements, with a lot of Nan's in it
>>
>> if I use thrownan(B) I can reduce the array size of B to 867751 elements
>> but still get the Message above.
>>
>> (without thrownan() the memory scilab wants to allocate is even bigger)
>>
>>
>>
>>
>> Am Fr., 15. Feb. 2019 um 23:25 Uhr schrieb Samuel Gougeon <
>> sgoug...@free.fr>:
>>
>>> ... and even clearer, with respect to your own notations:
>>>
>>> --> A = rand(1,1000);  // test's data
>>> --> B = rand(1,1);
>>> --> [a, b] = ndgrid(A, B);
>>> --> size(a)  // same for b
>>>  ans  =
>>>1000.   1.
>>> --> [v, i] = min(abs(a-b), *"c"*);
>>>
>>> ___
>>> users mailing list
>>> users@lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>>
>>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] wind speed analyses via fft power spectral density investigations

2019-02-18 Thread Heinz Nabielek
Dear friends and colleagues:

Yann Debray had put my first fragmentary attempt at wind speed analyses on the 
web: .

Based on ca. 55.000 hub-level wind speed measurements at 10-min-intervals, I am 
investigating the power spectral density of wind speed - diagram and code below 
- with the help of the Scilab 'fft' function and that worked very well.

One famous Japanese wind professor [he is now away for several months] had 
suggested "Using an arbitrary phase shift as random number into Inverse FFT, 
you can generate similar natural wind numerically, having the same spectrum".

Now my question: HOW DO I DO THAT AND HOW I DO IT IN SCILAB?

Best greetings
Heinz







[fd, SST, Sheetnames, Sheetpos] = xls_open('1.xls');
[v, TextInd] = xls_read(fd, Sheetpos(1));
clear SST Sheetnames Sheetpos TextInd fd
n=length(v);
x=(1:n)';
z=fft(v);
plot2d(x,abs(z),logflag='ll',style=3);
xx=(60:2)';
xxx=log(xx);
M=[ones(xxx) xxx];
y=log(abs(z(xx)));
a=M\y
   12.513971
  -0.8530057
F=exp(a(1)+a(2)*xxx);
plot(xx,F,'r--');
xtitle('Fourier analysis of wind speeds from station 1', ...
'f r e q u e n c y[ c y c l e / 1 0 min. ]','p o w e r   s p e c t r a l   
d e n s i t y');
title('Fourier analysis of wind speeds from station 1','fontsize',3);
legend('measured wind speed data','fit with slope -0.853',3);



__
Dr Heinz Nabielek
Schüttelstrasse 77A/11
A-1020 Wien, Österreich
Tel +43 1 276 56 13
cell +43 677 616 349 22
heinznabie...@me.com

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users