25_appendix d

Appendix D
MATLAB Codes for Soil Cutting Models of McKyes and Zeng,
and Generalized Breakout and Digging Force Model
This appendix presents the MATLAB codes for two 2D analytical soil-tool interaction
models of McKyes (E. McKyes, 1985) and Zeng (Xiangwu David Zeng et al., 2007) as
presented in chapter 6, and a MATLAB code developed for the generalized breakout and
digging force model as described in chapter 7. The notations used in the codes are
compared with the original notations used in chapter 6 and chapter 7.
D.1 MATLAB code for McKyes soil cutting model

The MATLAB code to find the resistive force using McKyes model:
clear all
clc
%Enter the values of soil and tool parameters
alpha =(__)*pi/180;
phi = (__)*pi/180;
delta = (__)*pi/180;
gama = __;
g = 9.81;
d = __;
c = __;
q = __;
Ca = __;
W = __;
for beta = 1:90
Nr(1,beta) = ((0.5*(cot(alpha)+cot( beta*pi/180)))/(cos(alpha+delta)+
sin(alpha+delta)*cot((beta*pi/180)+phi)));
end
Nrm = min(Nr);
%Plot Nr vs beta and find beta critical = betac for minimum value of Nr
plot(Nr);
%Take this betac instead of beta for rest of the calculations
Betac = (__)*pi/180;
Nc =
(1+(cot(betac)*cot(betac+phi)))/(cos(alpha+delta)+(sin(alpha+delta)*cot(
betac+phi)));
Nq=2*Nrm;
Nca = (1(cot(alpha)*cot(betac+phi)))/(cos(alpha+delta)+(sin(alpha+delta)*cot(bet
ac+phi)));
Force =((gama*g*(d^2)*Nrm)+(c*d*Nc)+(q*d*Nq)+(Ca*d*Nca))*w
The blanks in the MATLAB code requires inputs, note that all the angles are
required to be input in degrees as it will be multiplied by the term π/180 will return the
values in radians. In this MATLAB code, the green fonts show the description of terms
256
used in the program. The finial equation of “Force” in the program determines the value
of the resistive force using McKyes model. This program can be utilized to do the
parametric study of the parameters those influence on the reaction force. The terms used
in this code can be compared with the original terms as given in chapter 6 as: alpha = α′,
phi = ϕ′, delta = δ′, gama = γ′ (Kg/m3), Nr = Nγ , betac = βcr , ca = ca (N/m2), beta = β′,
Nca = Na, Nq = Nq, Na = Na, Nrm = minimum value of Nγ .
D.2 MATLAB code for D. Zeng soil cutting model

The MATLAB code to find the resistive force using Zeng model:
clear all
clc
convalpha = __;
alpha = (90-convalpha)*pi/180;
phi = (__)*pi/180;
delta = (__)*pi/180;
gama = __;
g = 9.81;
d = __;
c = __;
q = __;
Ca = __;
W = __;
w1 = __;
K = __;
av = __;
ah = __;
Wb = __;
zie = atan(ah/(g+av));
c1 =
sqrt((tan(phi+zie)*(tan(phi+zie)+cot(phi+alpha+zie)))*(1+(tan(delta-ziealpha)*cot(phi+alpha+zie))));
c2 = 1+(tan(delta-zie-alpha)*(tan(phi+zie)+cot(phi+alpha+zie)));
beta = -zie-phi+atan((tan(phi-zie)+c1)/c2);
zeta = beta;
Lw = d*(tan(alpha)+cot(beta));
Fs = Lw*((c*d)+(K*q*d*tan(phi))+(K*gama*tan(phi)*(d^(2))/3));
Fb = (Ca*d*w1);
Tx = (Pp*cos(alpha-delta))+(Fs*cos(zeta))+(Wb*ah/g)-(Fb*sin(alpha));
Ty = Wb+(Pp*sin(alpha-delta))+(Fs*sin(zeta))+(Wb*ah/g)+(Fb*cos(alpha));
T = sqrt(Tx^(2)+Ty^(2))
The terms used in this code can be compared with the original terms as given in
chapter 6 as: convalpha = α′ (should be in degrees), W = L (m), w1 = w (m), k = K0, av =
av (m/s2), ah = ah (m/s2), Wb = Wb (N), zie = ψ, zeta = beta = αp = β′, Lw = Lw (m), Fs =
Fside (N), Fb = Fblade (N), Tx = Tx (N), Ty = Ty (N).
These two MATLAB codes may help an individual to do the parametric study of
the parameters those influence on the reaction force for both the soil tool interaction
models.
257
D.3 MATLAB code for a generalized breakout and digging force model
If the working pressure in the hydraulic cylinders, end cylinder diameters of the arm and
bucket cylinders, and backhoe geometry constants are known, then the breakout and
digging forces when the arm cylinder and the bucket cylinder are active can be
determined from the following MATLAB code respectively.
clear all
clc
%Enter the value of working pressure p in MPa
p = __;
%Enter the end cylinder diameter of the arm cylinder in mm
Da = __;
Db = __;
%Enter the values of constant distances from the geometry of the backhoe
%excavator in mm
BH = __;
GH = __;
BG = __;
IJ = __;
JL = __;
IL = __;
BD = __;
CD = __;
%Determination of the force when arm cylinder is active = Farm and
%determination of the force when the bucket cylinder is active = Fbucket
%in N
Fgh = (p*pi*(Da)^(2))/4;
Fij = (p*pi*(Db)^(2))/4;
tau1 = atan2(((4*GH^(2)*BH^(2))-(GH^(2)+BH^(2)BG^(2))^(2))^(0.5),(GH^(2)+BH^(2)-BG^(2)))
tau2 = atan2(((4*IJ^(2)*JL^(2))-(IJ^(2)+JL^(2)IL^(2))^(2))^(0.5),(IJ^(2)+JL^(2)-IL^(2)))
Marm = BH*sin(tau1)*Fgh;
Farm = Marm/BD
Mbucket = JL*sin(tau2)*Fij;
Fbucket = Mbucket/CD
The blank spaces in the program require input data. The terms used in the program
can be compared with the notations used in chapter 7 as: Fgh = FA 7 A 8 , Fij = FA 9 A 10 ,
sigma1 = Γ1 , sigma2 = Γ2 , Marm = MArm, Farm = FArm, Mbucket = MBucket, and Fbucket =
FBucket. The descriptions of the other used terms are same as given in the section B.1 of the
appendix B.
258