Dear friends, Can you help me to run the code below? I tried many things but I couldn't succeed.
clear all
clc
close all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global aoa_rbar aoa_r c C_L0 GJ e
% GIVEN PARAMETERS
GJ= 76.6; %Nm^2
c=0.15; %m
x_ac=0.0375; %m
x_0=0.075; %m
d=0.0; %m
L=0.6; %m
W= 11.919; %N/m
rho=1.225; %kg/m^3
aoa_r= 3*0.0174533; %rad
C_Mac=0;
C_L0=0;
C_L_aoa=4.8074; % 1/rad
N=1;
e=x_0-x_ac;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% SOLUTION B.2)
q_b2=1500;
aoa_rbar=0;
solinit_b2=bvpinit(linspace(0,L,100),@guess,q_b2);
sol_b2=bvp4c(@theta_b2,@bc_b2,solinit_b2);
%% FUNC B.2 )
function dthetady_b2=theta_b2(y,theta,q_b2)
global c GJ C_L_aoa e aoa_rbar aoa_r
lamda_sq_b2=q_b2*c*C_L_aoa*e/GJ;
dthetady_b2=[theta(2) ;-lamda_sq_b2*(theta(1)+aoa_r+aoa_rbar)];
dthetady_b2=dthetady_b2(:);
end
% Initial guess function
function yinit_b2 = guess(x)
yinit_b2 = [0; 0.01];
end
function output_b2=bc_b2(theta_a,theta_b,q_b2)
output_b2=[theta_a(1) ;theta_b(2); theta_b(1)-10000];
end