Conversion to logical from sym is not possible.

6 views (last 30 days)
%% Solution using integration
% for this part you need to manually (by hand) integrate the moment equations twice and apply boundary conditions to arrive at the linear equations
syms c1 c2 c3 c4 c5 c6 c7 c8 %depend on number of equations which depends on number of segments of beam
eqn1= c5==0;
eqn2= (45/6)*5^3-(390/2)*5^2+c3*5+c7==0;
eqn3= (-7/3)*2^3-(5/12)*2^4+c1*2-c2==(-7/3)*2^3+15*2^2-(5/12)*2^4+c2*2+c6;
eqn4= (-7/3)*5^3+15*5^2-(5/12)*5^4+c2*5+c6==(45/6)*5^3-(390/2)*5^2+c3*5+c7;
eqn5= (45/6)*7^3-(390/2)*7^2+c3*7+c7==(25/6)*7^3-125*7^2+c4*7+c8;
eqn6= -7*2^2-(5/3)*2^3-c1==-7*2^2+30*2-(5/3)*2^3+c2;
eqn7= -7*5^2+30*5-(5/3)*5^3+c2==(45/2)*5^2-390*5+c3;
eqn8= (45/2)*7^2-390*7+c3==(25/2)*7^2-250*7+c4;
%ask matlab to prepare the matrices for you (linear equations Ax=b)
[A,B] = equationsToMatrix([eqn1, eqn2, eqn3, eqn4, eqn5, eqn6 , eqn7 , eqn8 ], [ c1 , c2 , c3 ,c4,c5,c6,c7,c8]);
C = double(linsolve(A,B));
syms x
first_segment_EIv= vpa((-5/9*x^4+-7/3*x^3+C(1)*x+C(5)),4);
second_segment_EIv= vpa((15*x^2-7/3*x^3-5/12*x^4+C(2)*x+C(6)),4);
third_segment_EIv= vpa((-390/2*x^2+45/6*x^3+C(3)*x+C(7)),4);
forth_segment_EIv= vpa((25/6*x^3-250/2*x^2+C(4)*x+C(8)),4);
EI= (3.876*10^-9)^-1;
v=piecewise((0<=x)&&(x<2),first_segment_EIv/EI , (2<=x)&&(x<=5),second_segment_EIv/EI , (5<=x)&&(x<=7), third_segment_EIv/EI , (7<=x)&&(x<=10), forth_segment_EIv/EI );
%EIv=vpa(EIv,5)
fplot(v)
g = diff(v, x);
solve(g == 0, x);
max_deflection_location = vpa(ANS, 3);
max_deflection= subs(v,x,max_deflection_location);

Answers (1)

Walter Roberson
Walter Roberson on 13 Aug 2020
C = linsolve( double(A), double(B));
You will get nan and inf results. This is because rank(A) is only 7 instead of 8.
Your 6th equation is inconsistent with the previous equations.

Community Treasure Hunt

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

Start Hunting!