Symbolic Linear system returns wrong solution.
3 views (last 30 days)
Show older comments
Tiago Araujo
on 19 Apr 2021
Answered: Divija Aleti
on 21 Apr 2021
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 Comments
Accepted Answer
Divija Aleti
on 21 Apr 2021
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 Comments
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!