Statics with MATLAB Dan B. Marghitu Mihai Dupac Nels H. Madsen
292 pág.

Statics with MATLAB Dan B. Marghitu Mihai Dupac Nels H. Madsen


DisciplinaMatlab498 materiais2.121 seguidores
Pré-visualização47 páginas
SFx=SF_(1);
SFy=SF_(2);
sol=solve(SFx, SFy,\u2019TAB, TAC\u2019);
Tab=eval(sol.TAB);
Tac=eval(sol.TAC);
Tabn=subs(Tab, list, listn);
Tacn=subs(Tac, list, listn);
fprintf(\u2019TAB = \n\u2019);pretty(simple(Tab));
fprintf(\u2019= %g (N) \n\u2019, Tabn);
fprintf(\u2019\n\u2019)
fprintf(\u2019TAC = \n\u2019);pretty(simple(Tac));
fprintf(\u2019= %g (N) \n\u2019, Tacn);
fprintf(\u2019\n\u2019)
fprintf(\u2019Method II \n\u2019)
rB_=[-a1, 0, 0];
rC_=[ a2, 0, 0];
rA_=[0,-a3,0];
% SMB_ = rBA_ x (TAC_+G_) = 0_
fprintf(\u2019sum M about B = rBA_ x (TAC_+G_) = 0_ \n\u2019)
SMB_=cross(rA_-rB_,TAC_+G_);
TACs=solve(SMB_(3),\u2019TAC\u2019);
fprintf(\u2019TAC = \n\u2019)
pretty(simple(TACs))
fprintf(\u2019\n\u2019)
TACn=subs(TACs, list, listn);
fprintf(\u2019TAC = %g (N) \n\u2019, TACn)
fprintf(\u2019\n\u2019)
% SMC = rCA_ x (TAB_+G_) = 0_
fprintf(\u2019sum M about C = rCA_ x (TAB_+G_) = 0_ \n\u2019)
SMC_=cross(rA_-rC_,TAB_+G_);
4.9 Programs 191
TABs=solve(SMC_(3),\u2019TAB\u2019);
fprintf(\u2019TAB = \n\u2019)
pretty(simple(TABs))
fprintf(\u2019\n\u2019)
TABn=subs(TABs, list, listn);
fprintf(\u2019TAB = %g (N) \n\u2019, TABn)
% end of program
4.9.2 Program 4.3
% example 4.3
% equilibrium of a particle on a surface
clear all; clc; close
syms x y z a b c d h k m g lambda
f = a*x+b*y+c*z+d; % surface equation
rP_ = [x y z]; % position vector of the particle P
rA_ = [0 0 h]; % position vector of fixed point A
F_ = k*(rA_-rP_); % attraction force on the particle
G_ = [0 0 -m*g]; % gravity force on particle P
% net force on the particle: F_+G_
% reaction force of the surface on the particle
gradf_ = [diff(f,x), diff(f,y), diff(f,z)];
N_ = lambda*gradf_;
% equilibrium equations
SF_ = F_+G_+N_;
sol=solve...
(SF_(1),SF_(2),SF_(3),f,\u2019x,y,z,lambda\u2019);
xe = eval(sol.x);
ye = eval(sol.y);
ze = eval(sol.z);
lambdae = eval(sol.lambda);
Ne_ = lambdae*gradf_;
Ne = sqrt(simple(Ne_*Ne_.\u2019));
fprintf(\u2019equilibrium equations: \n\u2019)
fprintf(\u2019\n\u2019)
fprintf(\u2019%s = 0 \n\u2019,char(SF_(1)))
fprintf(\u2019%s = 0 \n\u2019,char(SF_(2)))
fprintf(\u2019%s = 0 \n\u2019,char(SF_(3)))
192 4 Equilibrium
fprintf(\u2019%s = 0 \n\u2019,char(f))
fprintf(\u2019\n\u2019)
fprintf(\u2019equilibrium position: \n\u2019)
fprintf(\u2019\n\u2019)
fprintf(\u2019x = \n\u2019)
pretty(simple(xe))
fprintf(\u2019\n\u2019)
fprintf(\u2019y = \n\u2019)
pretty(simple(ye))
fprintf(\u2019\n\u2019)
fprintf(\u2019z = \n\u2019)
pretty(simplify(ze))
fprintf(\u2019\n\u2019)
fprintf(\u2019normal reaction force N_: \n\u2019)
fprintf(\u2019\n\u2019)
fprintf(\u2019lambda = \n\u2019)
pretty(simple(lambdae))
fprintf(\u2019\n\u2019)
fprintf(\u2019N_ = \n\u2019)
pretty(simple(Ne_))
fprintf(\u2019\n\u2019)
fprintf(\u2019N = |N_| = \n\u2019)
pretty(Ne)
% numerical application
lists = {a, b, c, d, h, k, m, g};
% numbers for lists
listn = {1,1,1,1.5,5,10,10,9.8};
xn = subs(xe,lists,listn);
yn = subs(ye,lists,listn);
zn = subs(ze,lists,listn);
ln = subs(lambdae,lists,listn);
rPn_ = [xn yn zn];
rAn_ = subs(rA_,lists,listn);
rPAn_ = rAn_-rPn_;
Gn_ = subs(G_,lists,listn);
Fn_ = subs(k*rPAn_,lists,listn);
Nn_ = subs(Ne_,lists,listn);
4.9 Programs 193
quiver3(0,0,0,xn,yn,zn,1,...
\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1.5)
hold on
quiver3(xn,yn,zn, rPAn_(1),rPAn_(2),rPAn_(3),1,...
\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1.5)
hold on
ff=10;
quiver3(xn,yn,zn,Nn_(1)/ff,Nn_(2)/ff,Nn_(3)/ff,1,...
\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1.5)
hold on
quiver3(xn,yn,zn,Gn_(1)/ff,Gn_(2)/ff,Gn_(3)/ff,1,...
\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1.5)
hold on
% surface equation
mg = 6;
[X,Y] = meshgrid(-mg:1:mg);
Z = (-a*X - b*Y -d)/c;
Z = subs(Z,lists,listn);
surf(X,Y,Z)
mesh(X,Y,Z,\u2019EdgeColor\u2019,\u2019black\u2019)
xlabel(\u2019x(m)\u2019), ylabel(\u2019y(m)\u2019), zlabel(\u2019z(m)\u2019)
sf=12;
axis([-sf sf -sf sf -sf sf])
text(0,0,0,\u2019 O\u2019,\u2019HorizontalAlignment\u2019,\u2019right\u2019)
text(xn,yn,zn,\u2019 P\u2019,\u2019HorizontalAlignment\u2019,\u2019right\u2019)
text(rAn_(1),rAn_(2),rAn_(3),\u2019 A\u2019,...
\u2019HorizontalAlignment\u2019,\u2019right\u2019)
text(xn+Nn_(1)/ff,yn+Nn_(2)/ff,zn+Nn_(3)/ff,...
\u2019 N\u2019,\u2019fontsize\u2019,14,\u2019fontweight\u2019,\u2019b\u2019)
text(xn+Gn_(1)/ff,yn+Gn_(2)/ff,zn+Gn_(3)/ff,...
\u2019 G\u2019,\u2019fontsize\u2019,14,\u2019fontweight\u2019,\u2019b\u2019)
% cartesian axes
quiver3(0,0,0,sf,0,0,1,\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1)
quiver3(0,0,0,0,sf,0,1,\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1)
quiver3(0,0,0,0,0,sf,1,\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1)
text(sf,0,0,\u2019 x\u2019,\u2019fontsize\u2019,12,\u2019fontweight\u2019,\u2019b\u2019)
text(0,sf,0,\u2019 y\u2019,\u2019fontsize\u2019,12,\u2019fontweight\u2019,\u2019b\u2019)
text(0,0,sf,\u2019 z\u2019,\u2019fontsize\u2019,12,\u2019fontweight\u2019,\u2019b\u2019)
AZ = 35;
194 4 Equilibrium
EL = 14;
view(AZ,EL)
% end of program
4.9.3 Program 4.4
% example 4.4
% equilibrium of a particle on a curve
clear all; clc; close
syms x y z a k m g lambda
% parabola equation: y+a*x\u2c62=0 & z=0
f = y+a*x\u2c62; % a>0
% particle position vector
rP_ = [x y 0];
% attraction force on particle
% proportional to the y-axis distance
% F_ = -k*[rP_(1),0,0]
F_ = -k*[rP_(1) 0 0];
% gravity force on particle P
G_ = [0 -m*g 0];
% reaction force of the surface on the particle
gradf_ = [diff(f,x), diff(f,y), diff(f,z)];
N_ = lambda*gradf_;
% equilibrium equations
SF_ = F_ + G_ + N_;
fprintf(\u2019equilibrium equations: \n\u2019)
fprintf(\u2019\n\u2019)
fprintf(\u2019%s = 0 (1)\n\u2019,char(SF_(1)))
fprintf(\u2019%s = 0 (2)\n\u2019,char(SF_(2)))
fprintf(\u2019%s = 0 (3)\n\u2019,char(f))
fprintf(\u2019\n\u2019)
sol=solve...
(SF_(1),SF_(2),f,\u2019x,y,lambda\u2019);
xe = eval(sol.x);
ye = eval(sol.y);
lambde = eval(sol.lambda);
list ={x,y,lambda};
liste ={xe,ye,lambde};
Ne_ = subs(N_,list,liste);
4.9 Programs 195
Ne = sqrt(simple(Ne_*Ne_.\u2019));
fprintf(\u2019I. one equilibrium position is \n\u2019)
fprintf(\u2019x = %d \n\u2019,xe)
fprintf(\u2019y = %d \n\u2019,ye)
fprintf(\u2019lambda = %s \n\u2019,char(lambde))
fprintf(\u2019curve reaction force N_ \n\u2019)
fprintf(\u2019Nx = %s \n\u2019,char(Ne_(1)))
fprintf(\u2019Ny = %s \n\u2019,char(Ne_(2)))
fprintf(\u2019 \n\u2019)
% numerical application
lists = {a, k, m, g};
% numbers for lists
listn = {1, 10, 10, 9.8};
xn = subs(xe,lists,listn);
yn = subs(ye,lists,listn);
ln = subs(lambde,lists,listn);
Gn_ = subs(G_,lists,listn);
rPn_ = [xn yn 0];
Nn_ = subs(Ne_,lists,listn);
fprintf(\u2019numerical application \n\u2019)
fprintf(\u2019G_ = [%g,%6.3f,%g] (N)\n\u2019,Gn_)
fprintf(\u2019N_ = [%g,%6.3f,%g] (N)\n\u2019,Nn_)
fprintf(\u2019 \n\u2019)
fprintf(\u2019II. from Eq.(1)=> \n\u2019)
fprintf...
(\u2019equilibrim condition for any point on the curve\n\u2019)
sole=solve...
(SF_(1),SF_(2),\u2019k,lambda\u2019);
ke = eval(sole.k);
lame = eval(sole.lambda);
fprintf(\u2019k = %s \n\u2019,char(ke))
% plot the curve
x = -2:1/10:2;
y = -x.\u2c62;
plot(x,y,\u2019-\u2019,\u2019LineWidth\u2019,2)
hold on
ff = 50;
quiver(xn,yn,Gn_(1)/ff,Gn_(2)/ff,1,...
\u2019Color\u2019,\u2019k\u2019,\u2019LineWidth\u2019,1.5)
quiver(xn,yn,Nn_(1)/ff,Nn_(2)/ff,1,...
\u2019Color\u2019,\u2019r\u2019,\u2019LineWidth\u2019,1.5)
196 4 Equilibrium
grid on
xlabel(\u2019x(m)\u2019), ylabel(\u2019y(m)\u2019)
text(xn+Nn_(1)/ff,yn+Nn_(2)/ff,...
\u2019 N\u2019,\u2019fontsize\u2019,14,\u2019fontweight\u2019,\u2019b\u2019)
text(xn+Gn_(1)/ff,yn+Gn_(2)/ff,...
\u2019 G\u2019,\u2019fontsize\u2019,14,\u2019fontweight\u2019,\u2019b\u2019)
% end of program
4.9.4 Program 4.5
% example 4.5
% equilibrium of a particle on a circle
clear all; clc; close
syms x y z R k m g lambda
% circle equation
f = x\u2c62+y\u2c62-R\u2c62;
% position vector of the particle P
rP_ = [x y 0];
% reaction force on the particle
% F_ = k*[x 0 0]
F_ = k*[x 0 0];
% gravity force on particle P
G_ = [0 -m*g 0];
% external force on the particle: F_+G_
% reaction force of the surface on the particle
gradf_ = [diff(f,x), diff(f,y), diff(f,z)];
N_ = lambda*gradf_;
% equilibrium equations
SF_ = F_ + G_ + N_;
fprintf(\u2019equilibrium equations: \n\u2019)
fprintf(\u2019\n\u2019)
fprintf(\u2019%s = 0 \n\u2019,char(SF_(1)))
fprintf(\u2019%s = 0 \n\u2019,char(SF_(2)))
fprintf(\u2019%s = 0 \n\u2019,char(f))
fprintf(\u2019\n\u2019)
sol=solve...
(SF_(1),SF_(2),f,\u2019x,y,lambda\u2019);
xe = eval(sol.x);
ye = eval(sol.y);
4.9 Programs 197
lambde = eval(sol.lambda);
list ={x,y,lambda};
fprintf(\u2019equilibrium position P1: \n\n\u2019)
fprintf(\u2019x = %s \n\u2019,char(xe(1)))
fprintf(\u2019y = %s \n\u2019,char(ye(1)))
fprintf(\u2019lambda = %s \n\u2019,char(lambde(1)))
list1 ={xe(1),ye(1),lambde(1)};
N1_ = subs(N_,list,list1);
fprintf(\u2019Nx = %s \n\u2019,char(N1_(1)))
fprintf(\u2019Ny = %s \n\u2019,char(N1_(2)))
fprintf(\u2019Nz = %s \n\u2019,char(N1_(3)))
fprintf(\u2019\n\u2019)
fprintf(\u2019equilibrium position P2: \n\n\u2019)
fprintf(\u2019x = %s \n\u2019,char(xe(2)))
fprintf(\u2019y = %s \n\u2019,char(ye(2)))
fprintf(\u2019lambda = %s \n\u2019,char(lambde(2)))
list2 ={xe(2),ye(2),lambde(2)};
N2_ = subs(N_,list,list2);
fprintf(\u2019Nx
Arthur
Arthur fez um comentário
Muito bom! achei que nunca ia achar um pdf desse livro, fazia tempo que estava procurando! muito obrigado!!!
0 aprovações
Carregar mais