% %subroutine objective funtion %file name = cable_obj.m %cable nonlinear problem %objective function %Total Potential Energy %Prof. Reyolando Brasil - May 2021 %Design variables: x(1) = u x(2) = v function p=cable_obj(x,Prob_data) %problem data V=Prob_data(1);%vertical load V, KN H=Prob_data(2);%horizontal load H, KN A=Prob_data(3);%cable cross section, mē E=Prob_data(4);%Young's Modulus,KN/mē La=Prob_data(5);%La length, m Lb=Prob_data(6);%Lb length, m N0=Prob_data(7);%N0 KN ka=E*A/La;kb=E*A/Lb; %stretched length LLa=sqrt(x(2)^2+(La+x(1))^2); LLb=sqrt(x(2)^2+(Lb-x(1))^2); %length change da=LLa-La;db=LLb-Lb; %axial forces Na=ka*da;Nb=kb*db; %strain energy U=(N0+Na/2)*da+(N0+Nb/2)*db; %work of external conservative forces W=H*x(1)+V*x(2); %Total Potential Energy p=U-W;