Dear Dr. William,
I am writing to you about a question for fluctuation velocity. In pivlab results how we could calculate fluctuation velocity? I look forward to receive your help your sincerely Reza Kamyab 
hi, i am not William but i am also using pivlab.
i guess, by fluctuation, u mean instantaneous velocity value  mean velocity. if this is so, then i just save the result in matlab workspace and write a few 34 lines of code to get the fluctuation part alone. basically u_smoothed  u_mean. hope this helps, until william replies. 
hi, Thanks a lot for your reply. I have tried to write this code but unfortunately my results are wrong. I need to calculate turbulence intensity. Does anyone have this code and send to me? I look forward to receive yours help From: roul [via PIVlab  TimeResolved Digital Particle Image Velocimetry Tool for MATLAB] <[hidden email]> To: rezakamyab <[hidden email]> Sent: Friday, 4 September 2015, 8:56:25 Subject: Re: fluctuation velocity
hi, i am not William but i am also using pivlab.
i guess, by fluctuation, u mean instantaneous velocity value  mean velocity. if this is so, then i just save the result in matlab workspace and write a few 34 lines of code to get the fluctuation part alone. basically u_smoothed  u_mean. hope this helps, until william replies. If you reply to this email, your message will be added to the discussion below:
http://pivlabtimeresolveddigitalparticleimagevelocimetrytoolf.33690.n7.nabble.com/fluctuationvelocitytp355p357.html

here is a bit of code snippet, maybe u can understand this and modify as per ur requirement:
xvel_inst = zeros(rows,cols); % inst = instantaneous, preallocation of new matrix (in for loop) for speed xvel_fluc = zeros(rows,cols); % fluc. = fluctuation = xvel_inst  xvel_mean, preallocation of new matrix (in for loop) for speed for k = 1:cols xvel_inst(:,k) = u_smoothed{k,1}(:,col_no); end % here, i am saving the xvel_inst values along a vertical line only for all the image pairs, but not for the entire image clear u_smoothed; xvel_mean = mean(xvel_inst,2); % ,2 to calc mean rowwise not colwise for m = 1:cols xvel_fluc(:,m) = xvel_inst(:,m)  xvel_mean; end % _dash = the fluc. part = _inst  _mean xvel_rms = rms(xvel_dash,2); % i guess this is what you want, if i am correct 
Thanks a lot. your code seems to be useful but is not complete. An error is shown as : Undefined function or variable 'rows'. Error in Untitled (line 4) xvel_inst = zeros(rows,cols); Thanks for your help. From: roul [via PIVlab  TimeResolved Digital Particle Image Velocimetry Tool for MATLAB] <[hidden email]> To: rezakamyab <[hidden email]> Sent: Friday, 4 September 2015, 13:25:44 Subject: Re: fluctuation velocity
here is a bit of code snippet, maybe u can understand this and modify as per ur requirement:
xvel_inst = zeros(rows,cols); % inst = instantaneous, preallocation of new matrix (in for loop) for speed xvel_fluc = zeros(rows,cols); % fluc. = fluctuation = xvel_inst  xvel_mean, preallocation of new matrix (in for loop) for speed for k = 1:cols xvel_inst(:,k) = u_smoothed{k,1}(:,col_no); end % here, i am saving the xvel_inst values along a vertical line only for all the image pairs, but not for the entire image clear u_smoothed; xvel_mean = mean(xvel_inst,2); % ,2 to calc mean rowwise not colwise for m = 1:cols xvel_fluc(:,m) = xvel_inst(:,m)  xvel_mean; end % _dash = the fluc. part = _inst  _mean xvel_rms = rms(xvel_dash,2); % i guess this is what you want, if i am correct If you reply to this email, your message will be added to the discussion below:
http://pivlabtimeresolveddigitalparticleimagevelocimetrytoolf.33690.n7.nabble.com/fluctuationvelocitytp355p366.html

of course, its not complete. i just posted the main code lines. i thought u will do the rest.
just define rows as the number of points in the y direction, and cols. as the number of image pairs u want to use to calculate the mean hope now u can get the code running. make any other changes if necessary. regards, roul 
Many thanks roul. unfortunately i am not good at writing code at all! Thanks for your help. Best Regards, Kamyab From: roul [via PIVlab  TimeResolved Digital Particle Image Velocimetry Tool for MATLAB] <[hidden email]> To: rezakamyab <[hidden email]> Sent: Friday, 4 September 2015, 16:53:24 Subject: Re: fluctuation velocity
of course, its not complete. i just posted the main code lines. i thought u will do the rest.
just define rows as the number of points in the y direction, and cols. as the number of image pairs u want to use to calculate the mean hope now u can get the code running. make any other changes if necessary. regards, roul If you reply to this email, your message will be added to the discussion below:
http://pivlabtimeresolveddigitalparticleimagevelocimetrytoolf.33690.n7.nabble.com/fluctuationvelocitytp355p369.html

hi, no probs..in case u haven't figured out the code, just use the following code lines before the ones i sent earlier:
col_no = 40; % this column no. corresponds to data at x = <some value> m from lhs of image, change this one to the column number you want your profiles at cols = size(u_smoothed,1) 1; % no. of cols in new matrix = no. of frames or imagepairs; 1 bec. last cell is for mean frame rows = size(u_smoothed{1,1},1); % no. of rows in new matrix = no. of datapoints along a vertical line hope this helps.. or maybe u can trying subtracting the mean velocity from all the frames in pivlab itself..there is an option to subtract velocity.. 
hi, many thanks for your help. Best regards, From: roul [via PIVlab  TimeResolved Digital Particle Image Velocimetry Tool for MATLAB] <[hidden email]> To: rezakamyab <[hidden email]> Sent: Monday, 7 September 2015, 12:03:21 Subject: Re: fluctuation velocity
hi, no probs..in case u haven't figured out the code, just use the following code lines before the ones i sent earlier:
col_no = 40; % this column no. corresponds to data at x = <some value> m from lhs of image, change this one to the column number you want your profiles at cols = size(u_smoothed,1) 1; % no. of cols in new matrix = no. of frames or imagepairs; 1 bec. last cell is for mean frame rows = size(u_smoothed{1,1},1); % no. of rows in new matrix = no. of datapoints along a vertical line hope this helps.. or maybe u can trying subtracting the mean velocity from all the frames in pivlab itself..there is an option to subtract velocity.. If you reply to this email, your message will be added to the discussion below:
http://pivlabtimeresolveddigitalparticleimagevelocimetrytoolf.33690.n7.nabble.com/fluctuationvelocitytp355p373.html

Free forum by Nabble  Edit this page 