Try to make a function for deflection and is just dosen`t want to work.
Mostrar comentarios más antiguos
Hello here is the task what I need to do. I been only able to do some part of it and not really knw why is my code not want to work. Tried use the help, but still cant figure it out what is the problem.
The maximum deflexion of a wind turbine blade should be no more than 10% of its span. The formula used to calculate deflexion being: Delta = (W*L.^3)/(8*E*I)
Where D is the deflexion in mm and L is the length of the blade, mm. Given that the maximum load (W) to be applied to the blade is 8500N, E the elastic modulus of the blade material is 42000 N/mm2, I is 10 million mm4. Create a MATLAB function to determine whether the deflexion of the blade will exceed design parameters or not. Your function should require Length as an input and return the resulting deflection as an output
As a secondary output, the function should also display one of two lines ’Maximum deflexion is tolerable ’ or ’Maximum deflexion will be exceeded’ depending on the value of delta. Demonstrate your code working for the following lengths;
1. 4.2m
2. 10m
3. 25m
Calculate the MAXIMUM tolerable blade length (hint: calculate L when ∆/L = 0.1)
My Code:
function deflection = Wind_turbinDef()
L= input('Lenght of the wind turbine blade in meter: ')*u.m; %Use this input to we can measure the blead deflexion in any lenght.
L=unitConvert(L,u.mm); %The lenght mast be in mm to be able to use in the formular so needed to comvert it.
W=8500*u.N; %The walue is the maximu constant
E=42000 *u.N/u.mm^2; %Elastic modulus of the blade
I=10*(10^6)*u.mm^4;
Delta=vpa((W*L^3)/(8*E*I));% Used vpa() to simplify the last division on the deflexion formular
%max deflexion is 10% from it span
Lim=L*0.1;
deflection = Delta-Lim;
if deflection < 0
Deflection= "Maximum deflexion is tolerable!";
elseif deflection == 0
Deflection = "Maximum deflexion is tolerable!";
else deflection > 0
Deflection = "Maximum deflexion will be exceeded!";
end
end
Thank you for any help!
4 comentarios
John D'Errico
el 31 de Dic. de 2018
Edit to make code more readable.
Milan Sumegi
el 31 de Dic. de 2018
Walter Roberson
el 31 de Dic. de 2018
Your code does not display the required messages .
Your function should take the length as a parameter instead of using input()
Your code does not define u for u.mm
why are you expecting the length in metres when all of the sample inputs are mm ?
Milan Sumegi
el 31 de Dic. de 2018
Respuesta aceptada
Más respuestas (1)
Milan Sumegi
el 31 de Dic. de 2018
Categorías
Más información sobre Wind Power en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
