trying to perform a summation and its returning the value in separately in a matrice when i need a single answer.
조회 수: 1 (최근 30일)
이전 댓글 표시
syms x y z f g
%%%%%Variable Values%%%%%%%%%
theta=0;
n=0;
m=0;
k = (0.6569);
h = 11;
alpha = 2.57*10^(-7);
t=0;
L=(.051);
W=(.01);
H=(.005);
X=(.051/4);
Y=(.01/2);
Z=(.005/4);
beta = ((n+0.5)*pi);
eta = ((m/.01)*pi);
mew = (117);
lamda = (beta.*beta) +(eta.*eta)+ (mew.*mew);
%%%%%%%%DETERMINATION OF CONSTANT C%%%%%%%%%%%%%%%%
f(z,y,x) = cos(beta*z)*sin(mew*y)*cos(eta*x)*sin(eta*x);
C_nmp_numerator = int(int(int(f,z,[0 (H/2)]),y,[0 W]),x,[0 (L/2)]);
g(z,y,x) = (L/4)*(H/4)*((((-k*mew)/h)*(cos(mew*x))^2*sin(mew*x))+((sin(mew*x))^2*cos(mew*x)));
C_nmp_denominator = int(x,[0 (L/2)]);
C_nmp = C_nmp_numerator/C_nmp_denominator;
pretty(C_nmp);
%%%%%%%%DETERMINATION OF DEMENTIONLESS TEMP THETA%%%%%%%%%%%%%%%%
for n=0:10,m=0:10,t=0:10
theta = (C_nmp .* cos(beta.*z).*sin(eta.*y).*((-k.*mew)/h).*cos(mew.*x)+sin(mew.*x)).*exp(-(lamda.*lamda)*alpha.*t);
vpa(subs(theta, {x,y,z}, {X,Y,Z}));
end
theta;
vpa(subs(theta, {x,y,z}, {X,Y,Z}))
댓글 수: 1
Walter Roberson
2021년 12월 6일
vpa(subs(theta, {x,y,z}, {X,Y,Z}));
That does the substitution, calculates a numeric approximation, and then throws the result away without displaying it because of the semicolon.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!