Symbolic Linear system returns wrong solution.
2 次查看(过去 30 天)
显示 更早的评论
I would like to solve the symbolic defined integrals U and V in terms of the variable X, how can I do that?
syms C0 C1 C2 C3 C4 X L EI q;
%__________________________________________________
% POLYNOMIAL 4TH
Y3(X) = C0 + C1*X + C2*X^2 + C3*X^3 + C4*X^4;
% Y3(X) DERIVATIVES:
dY3(X) = diff(Y3(X),X);
d2Y3(X) = diff(dY3(X),X);
% RAYLEIGH RITZ METHOD
U = + (EI/2) * int((d2Y3(X))^2,[0 L]);
V = - q * int(Y3(X),[0 L]);
PI = U + V;
% BOUNDARY CONDITIONS IN Y3(X)
cc1 = Y3(0) == 0;
cc2 = Y3(L) == 0;
cc3 = -EI*d2Y3(L) == 0;
cc4 = -EI*d2Y3 (0) == 0;
% NEW BOUNDARY CONDITION FROM THE RR METHOD
dPIdC4 = diff (PI,C4);
cc5 = dPIdC4 == 0;
% SYSTEM LINEAR SOLVING
R = solve([cc1,cc2,cc3,cc4,cc5],[C0,C1,C2,C3,C4]);
C0 = R.C0;
C1 = R.C1;
C2 = R.C2;
C3 = R.C3;
C4 = R.C4;
disp 'CONSTANTES C'
disp ([C0;C1;C2;C3;C4]);
Y3(X) = C0 + C1*X + C2*X^2 + C3*X^3 + C4*X^4;
disp 'EQUAÇÃO DA LINHA ELÁSTICA';
disp (Y3(X));
disp 'EQUAÇÃO DO MOMENTO';
M3(X) = -EI * diff(diff(Y3(X),X),X);
disp(M3(X));
As it is, the the integral solution for U and V is in terms of X, what is wrong. 'X' should disappear .
2 个评论
采纳的回答
Divija Aleti
2021-4-21
Hi Tiago,
I understand that you are getting wrong solutions but there is nothing wrong with the working of the code. I suggest you re-check your initial assumption of Y3(X) as a polynomial (try taking a combination of trigonometric functions and later use Taylor series expansion to expand them) or maybe try using different boundary conditions.
Hope this helps!
Regards,
Divija
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!