Issue with Matlab symbolic int

2 次查看(过去 30 天)
I am modeling a load curve distribution on a cantilever beam in order to get a maximum deflection value and for whatever reason, the moment equation which should just be the boundary condition + the integral of the shear function is evaluating at a higher number at the connection point than it should. I have found a way to account for this but now do not know the validity of the integration in general. I am wondering how I may have messed up my own code to get the erroneous result.
code attached here
syms y
load=vpa(0.5*(2.97952*(2.56-2/15*1.54*y)+sqrt((16*4/(3*pi))^2*(1-y^2/(15/2)^2))))
%load curve using up as negative from convention
L=7.5; %length of beam in ft
totalf=int(load, [0, 7.5]); %total force as a check
yloc=int(load*y, [0, 7.5])/totalf; %find the centroid of load
V=-40+int(load); %shear as function of span using convention, V(0)=-40 is the first boundary condition
shearcheck=int(V);
y=0;
shearcorrection=subs(shearcheck); %factor that accounts for weird evaluation of int(V)
M=totalf*yloc+int(V)-shearcorrection; %moment as a function of span using convention, M(0)=127 is second bc
momentcheck=int(M);
matroot=subs(momentcheck);
EItheta=int(M); %first integral of the deflection eqn
EIdeflection=int(EItheta); %deflection
EImaxdeflection=int(EItheta,[0 7.5]); %deflection

采纳的回答

Walter Roberson
Walter Roberson 2023-11-13
Use definite integrals rather than indefinite integrals.
For example matlab tends to take a term that would be typically be written as sin(x)^2, and return cos(x)^2 instead and in the indefinite integral that is valid because the two different by a constant.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by