function yp = equationb(t, y)A=2.69; B=168; C=6270; D=59900; %coefficients
V = 10:50;E= 15000000000; h = 0.048; I = (1/12)*h^4; l=4; rho=1600;m = 0.177; c = 0.77; k = (48*E*I)/l^3; R = (0.5*rho*h);yp (1) = y(2);yp (2,1) = (R/m)*(A*V*y(2).^2 - (B*y(2).^4)/V + (C*y(2).^6)/V^3 - (D*y(2).^8)/V^5) - (c/m)*y(2) - (k/m)*y(1);end
And my main function is
close all; clear all; clc;% Initial Conditions
h = 0.048; %section width (m)
x0 = [h,10*h]; %initial displacements
v0 = zeros(length(x0)); %inital velocity
V = 10:50; %flow velocity (m/s)
timespan = [0 30];for j=1:length(x0) for k=1:length(V) a = [x0(1,j), v0(1,1), V(k)]; [t,y] = ode15s(@equationb, timespan, a); R = find(t>25); %returns a vector containing the linear indices of each nonzero element in array.
LCO = y(R,1); maximum_amplitude(j,k) = max(LCO); endendfigure(1)hold on; grid on; box on;ylabel('Structural Displacement Amplitutde (m)')xlabel('Air Flow Velocity (m/s)')plot(V,maximum_amplitude(1,:),'go')plot(V,maximum_amplitude(2,:),'r+')axis([V(1) V(end) 0 0.7])
Best Answer