Numerical integration of one DOF discrete gust wind model 1-minus-cosine shape. Time domain

8 views (last 30 days)
Good morning,
i'm having some difficulties when i try to write a Matlab code for the Numerical integration of one DOF discrete gust wind model 1-minus-cosine shape, time domain.
I found something useful in the image below, i think i need a bit of help to handle the derivative inside the integral.
It's my first time here, i hope my question will respect all the rules and the netiquette of the community.
Thank you very much
Marco Ruggiero
  2 Comments
MARCO DAVIDE ALFREDO
MARCO DAVIDE ALFREDO on 28 May 2025
I tried to write the convolution with an approximation based on the trapezoidal rule. I had some problems and errors trying to solve the differential equation with ode 45, so i tried and something similar to Euler step-by step method. The code produces some values too distant from the expected ones. Thank you very much for your help.
I posted only the final part of the script.
% INIZIALIZZAZIONE
z_sol = zeros(N,1); dz_sol = zeros(N,1); z_ddot = zeros(N,1);
z_sol(1) = 0; dz_sol(1) = 0;
% INTEGRAZIONE CON EULERO (PASSO PASSO)
for i=2:N
s_hist = s_span(1:i-1);
z_ddot_hist = z_ddot(1:i-1);
if i==2
conv_Kw = 0;
else
integrand = Kw(s_span(i)-s_hist).*z_ddot_hist;
conv_Kw = trapz(s_hist, integrand);
if numel(conv_Kw) > 1
conv_Kw = conv_Kw(1);
end
end
Kg_val = Kg(s_span(i));
if numel(Kg_val) > 1
Kg_val = Kg_val(1);
end
acc = -(1/mu)*conv_Kw + (1/mu)*(mac/V)*Kg_val;
dz_sol(i) = dz_sol(i-1) + acc*delta_s;
z_sol(i) = z_sol(i-1) + dz_sol(i-1)*delta_s;
z_ddot(i) = acc;
end

Sign in to comment.

Answers (1)

Supraja
Supraja on 1 Aug 2025
Hello Marco,
Please refer to the MATLAB documentation for writing code for integrals and differentiation which is given here: Numerical Integration and Differentiation - MATLAB & Simulink
Thanks!

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!