P_vals = linspace(0, 33.754, 10);
psi = atan(kh / (1 - kv));
delm1 = 0.5 * (1 - R1) * delta;
delm3 = -0.5 * (1 - R3) * delta;
A = a * mq / (x * (1 + mq));
thetacm = atan((sin(l) * sin(m) + sqrt(sin(l)^2 * sin(m)^2 + A * cos(l) * sin(m) * cos(n) + cos(m) * sin(l) * sin(m) * cos(l))) / (cos(m) * sin(l) - A * cos(n)));
B = (x / tan(thetacm)) - a;
kg = (tan(thetacm - phi) + tan(psi)) / (tan(thetacm) * (cos(2 * phi / 3) + sin(2 * phi / 3) * tan(thetacm - phi)));
kq = (1 - atan(thetacm) / x) * ((tan(thetacm - phi) + tan(psi)) / (tan(thetacm) * (cos(2 * phi / 3) + sin(2 * phi / 3) * tan(thetacm - phi))));
pg = 0.5 * gma * (1 - kv) * kg * x^2 * cos(delm1);
pq = (1 - kv) * q * kq * (B / (B + 2 * a)) * (x - a) * cos(delm1);
k4R0 = (2 * cos(phi - psi)^2) / (cos(phi - psi)^2 + cos(psi) * cos(delta / 2 + psi) * (1 + sqrt(sin(phi + delta / 2) * sin(phi - psi) / cos(delta / 2 + psi)))^2);
k3 = (2 * cos(phi - psi)^2) / (cos(phi - psi)^2 * (1 + R3) + cos(psi) * cos(delm3 + psi) * (1 - R3) * (1 + sqrt(sin(phi + delm3) * sin(phi - psi) / cos(delm3 + psi)))^2);
delm23 = 0.5 * (3 - 1) * delta;
k23 = 1 + 0.5 * (3 - 1) * ((cos(phi - psi)^2 / (cos(psi) * (cos(delm23 + psi) * (-sqrt(sin(phi + delm23) * sin(phi - psi) / cos(delm23 + psi))) + 1)^2)) - 1);
R2 = 3 * (beta * (1 - y1))^0.5;
delm213 = 0.5 * (R2 - 1) * delta;
k213 = 1 + 0.5 * (R2 - 1) * ((cos(phi - psi)^2 / (cos(psi) * (cos(delm213 + psi) * (-sqrt(sin(phi + delm213) * sin(phi - psi) / cos(delm213 + psi))) + 1)^2)) - 1);
delm201 = 0.5 * (1 - R2) * delta;
k201 = (2 * cos(phi - psi)^2) / (cos(phi - psi)^2 * (1 + R2) + cos(psi) * cos(delm201 + psi) * (1 - R2) * (1 + sqrt(sin(phi + delm201) * sin(phi - psi) / cos(delm201 + psi)))^2);
delm43 = 0.5 * (3 - 1) * delta;
k43 = 1 + 0.5 * (3 - 1) * ((cos(phi - psi)^2 / (cos(psi) * (cos(delm43 + psi) * (-sqrt(sin(phi + delm43) * sin(phi - psi) / cos(delm43 + psi))) + 1)^2)) - 1);
R4 = 3 * (alfa * y2)^0.5;
delm413 = 0.5 * (R4 - 1) * delta;
k413 = 1 + 0.5 * (R4 - 1) * ((cos(phi - psi)^2 / (cos(psi) * (cos(delm413 + psi) * (-sqrt(sin(phi + delm413) * sin(phi - psi) / cos(delm413 + psi))) + 1)^2)) - 1);
delm401 = 0.5 * (1 - R4) * delta;
k401 = (2 * cos(phi - psi)^2) / (cos(phi - psi)^2 * (1 + R4) + cos(psi) * cos(delm401 + psi) * (1 - R4) * (1 + sqrt(sin(phi + delm401) * sin(phi - psi) / cos(delm401 + psi)))^2);
H23 = matlabFunction(k23 * y1 * cos(delm23));
h23 = gma * x^2 * integral(H23, 0, (1 - (1 / beta)));
H213 = matlabFunction(k213 * cos(delm213) * y1);
h213 = gma * x^2 * integral(H213, (1 - (1 / beta)), (1 - (1 / (9 * beta))));
H201 = matlabFunction(k201 * y1 * cos(delm201));
h201 = gma * x^2 * integral(H201, (1 - (1 / (9 * beta))), 1);
H401 = matlabFunction(k401 * y2 * cos(delm401));
h401 = gma * y^2 * integral(H401, 0, (1 / (9 * alfa)));
H413 = matlabFunction(k413 * y2 * cos(delm413));
h413 = gma * y^2 * integral(H413, (1 / (9 * alfa)), (1 / alfa));
H43 = matlabFunction(k43 * y2 * cos(delm43));
h43 = gma * y^2 * integral(H43, (1 / alfa), 1);
hb43 = (x + (q / gma)) * y * k4R0 * cos(delta / 2);
h4 = h401 + h413 + h43 + hb43;
h3 = 0.5 * gma * k3 * y^2 * cos(delta) + gma * x * k3 * y * cos(delta);
HF = -P - h1 + h2 + h3 - h4;
V23 = matlabFunction(k23 * y1 * sin(delm23));
v23 = gma * x^2 * integral(V23, 0, (1 - (1 / beta)));
V213 = matlabFunction(k213 * sin(delm213) * y1);
v213 = gma * x^2 * integral(V213, (1 - (1 / beta)), (1 - (1 / (9 * beta))));
V201 = matlabFunction(k201 * y1 * sin(delm201));
v201 = gma * x^2 * integral(V201, (1 - (1 / (9 * beta))), 1);
V401 = matlabFunction(k401 * y2 * sin(delm401));
v401 = gma * y^2 * integral(V401, 0, (1 / (9 * alfa)));
V413 = matlabFunction(k413 * y2 * sin(delm413));
v413 = gma * y^2 * integral(V413, (1 / (9 * alfa)), (1 / alfa));
V43 = matlabFunction(k43 * y2 * sin(delm43));
v43 = gma * y^2 * integral(V43, (1 / alfa), 1);
vb43 = (x + (q / gma)) * y * k4R0 * sin(delta / 2);
v4 = v401 + v413 + v43 + vb43;
v3 = 0.5 * gma * k3 * y^2 * sin(delta) + gma * x * k3 * y * sin(delta);
v1 = pg * cot(delm1) + pq * cot(delm1);
M23 = matlabFunction(k23 * y1 * (1 - y1) * cos(delta));
m23 = gma * x^3 * integral(M23, 0, (1 - (1 / beta)));
M213 = matlabFunction(k213 * cos(delm213) * y1 * (1 - y1));
m213 = gma * x^3 * integral(M213, (1 - (1 / beta)), (1 - (1 / (9 * beta))));
M201 = matlabFunction(k201 * y1 * cos(delm201) * (1 - y1));
m201 = gma * x^3 * integral(M201, (1 - (1 / (9 * beta))), 1);
M401 = matlabFunction(k401 * cos(delm401) * y2^2);
m401 = gma * y^3 * integral(M401, 0, (1 / (9 * alfa)));
M413 = matlabFunction(k413 * cos(delm413) * y2^2);
m413 = gma * y^3 * integral(M413, (1 / (9 * alfa)), (1 / alfa));
M43 = matlabFunction(k43 * cos(delta) * y2^2);
m43 = gma * y^3 * integral(M43, (1 / alfa), 1);
mb43 = (x + (q / gma)) * (y / 2)^2 * k4R0;
m4 = m401 + m413 + m43 + mb43;
m1 = pg * (x / 3) + pq * ((x - a) / 2);
m3 = 0.5 * gma * k3 * y^2 * cos(delta) * (2 * (y / 3)) + gma * x * k3 * y * cos(delta) * (y / 2);
MF = m2 + m4 - m1 - m3 + P * (h + x);
HF = -P - h1 + h2 + h3 - h4
MF = m2 + m4 - m1 - m3 + P * (h + x)
double(subs([HF, VF, MF],[x,y,P],[3, 1.646, 33.754]))
ans =
191.289189155057e+000 44.5300512610845e+000 534.518193150590e+000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
J = jacobian([HF, VF, MF], [x, y, P]);
P_vals = linspace(0, 33.754, 10);
Z = zeros(3, numel(P_vals));
subs_values = [t(1), t(2), t(3)];
gnum = double(subs([HF; VF; MF], [x, y, P], subs_values));
Jnum = double(subs(J, [x, y, P], subs_values));
error('Jacobian matrix is not square: %d x %d', m, n);
error('Dimension mismatch: gnum vector length (%d) does not match Jacobian matrix size (%d)', length(gnum), m);
error('Matrix division failed: %s', ME.message);
if length(delx) ~= length(t)
error('Dimension mismatch: delx vector length (%d) does not match t vector length (%d)', length(delx), length(t));
fprintf('NEWTON-RAPHSON SOLUTION CONVERGES IN %d ITERATIONS\n', indx);
NEWTON-RAPHSON SOLUTION CONVERGES IN 16 ITERATIONS
fprintf('FINAL VALUES OF x, y, and P FOR P = %.2f ARE:\n', P_vals(end));
FINAL VALUES OF x, y, and P FOR P = 33.75 ARE:
disp(Z);
Columns 1 through 7
62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006
-31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006
1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012
Columns 8 through 10
62.2358956951181e-006 62.2358956951181e-006 62.2358956951181e-006
-31.3808137998502e-006 -31.3808137998502e-006 -31.3808137998502e-006
1.52107049952637e-012 1.52107049952637e-012 1.52107049952637e-012
double(subs([HF, VF, MF],[x,y,P],Z(:,end).'))
ans =
1.0e+00 *
75.2337027918753e-009 10.1922481593136e-009 9.50654654042714e-012
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>