Code Monkey home page Code Monkey logo

Comments (1)

NicWayand avatar NicWayand commented on August 24, 2024

Here is a half completed scaling function (copied from DHSVM V2.8)

function WS_out = scale_WS(WS_in,z_in,z_out,scaling_method)

% Input
%
% WS_in - 1XL Scaler Wind speed
% z_in - Height in meters of WS_in
% z_out - Height in meters of WS_out
% scaling_method - Method used to scale Wind speed
% 1 - Logrithmic
% 2 - Exponential
%
% Output
%
% WS_out - 1XL Scaler Wind speed, scaled up to z_out

%% CODE

Z0_SNOW = 0.01; % Snow roughness (m)

% Calc factor
if scaling_method == 1 % Logrithmic (depends on surface roughness)
if z_in > z_out
Ftcr = log((z_out + Z0_SNOW) / Z0_SNOW) / log(z_in / Z0_SNOW); % DHSVM, no over story, with Snow
else % Flip inputs, and then take 1 over Fct to get correct scalling both ways
Ftcr = log((z_in + Z0_SNOW) / Z0_SNOW) / log(z_out / Z0_SNOW); % DHSVM, no over story, with Snow
Ftcr = 1/Ftcr;
end
% Ftcr = log(z_out) / log(z_in); % BAD method,
elseif scaling_method == 2 % Exponential
error('add here')
end

% Calc new Wind speed
WS_out = WS_in .* Ftcr;

% END

from moq.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.