Skip to main content

Section 2.7 answers to some of the proposed exercises

Subsection 2.7.1

Anwer to Subsection 2.6.3.

sig = @(x) ...
[5*x(2)*x(3) 3*x(2)^2 0;
3*x(2)^2 0 -x(1);
0 -x(1) 0];

n = @(x) ...
[2*x(1)/sqrt((2*x(1))^2+(2*x(2))^2+1);
2*x(2)/sqrt((2*x(1))^2+(2*x(2))^2+1);
1/sqrt((2*x(1))^2+(2*x(2))^2+1)];

t = sig([1/2; sqrt(3)/2; -1])*n([1/2; sqrt(3)/2; -1])
Listing 2.7.1.
It is noted that, as usual, the previous instructions are not the only possible way to obtain the required result.

Subsection 2.7.2

Answer to Subsection 2.6.8.

x = sym('x', [3 1], 'real');
syms rho g real
sig = [x(2) x(3) 0;
x(3) x(1) 0;
0 0 rho*g*x(3)];
b = [0; 0; -rho*g];

% 1st question
divergence(sig(1,1:3), x) + b(1)
divergence(sig(2,1:3), x) + b(2)
divergence(sig(3,1:3), x) + b(3)

% 2nd question
t1 = subs(sig, x(1), 1)*[1; 0; 0]
t2 = subs(sig, x(2), 1)*[0; 1; 0]
t3 = subs(sig, x(3), 1)*[0; 0; 1]
t1_ = subs(sig, x(1), 0)*[-1; 0; 0]
t2_ = subs(sig, x(2), 0)*[0; -1; 0]
t3_ = subs(sig, x(3), 0)*[0; 0; -1]

% 3th question
T1 = int(int(t1, x(2), 0, 1), x(3), 0, 1)
T2 = int(int(t2, x(1), 0, 1), x(3), 0, 1)
T3 = int(int(t3, x(1), 0, 1), x(2), 0, 1)
T1_ = int(int(t1_, x(2), 0, 1), x(3), 0, 1)
T2_ = int(int(t2_, x(1), 0, 1), x(3), 0, 1)
T3_ = int(int(t3_, x(1), 0, 1), x(2), 0, 1)
B = int(int(int(b, x(1), 0, 1), x(2), 0, 1), x(3), 0, 1)

R = T1 + T2 + T3 + T1_ + T2_ + T3_ + B
Listing 2.7.2.