I have been trying to solve a boundary value problem analytically which involves a three-dimensional temperature Laplacian over a parallelepiped. In the final step of my solution, using the two non-homogeneous $z$-boundary conditions, I calculate the two unknown Fourier coefficients $C_1,C_2$. The mathematica code is as follows:
T[x_, y_, z_] = (C1*E^(γ z) + C2*E^(-γ z))*Sin[(α x/L) + β]*Sin[(δ y/l) + θ] + Ta;
tc[x_, y_] = E^(-bc*y/l)*{tci + (bc/l)*Integrate[E^(bc*s/l)*T[x, s, 0], {s, 0, y}]};
bc1 = (D[T[x, y, z], z] /. z -> 0) == pc (T[x, y, 0] - tc[x, y]);
ortheq1 = Integrate[(bc1[[1]] - bc1[[2]])*Sin[(α x/L) + β]*Sin[(δ y/l) + θ], {x, 0, L}, {y, 0, l}, Assumptions -> {C1 > 0, C2 > 0, L > 0, l > 0, α > 0, β > 0, γ > 0, δ > 0, θ > 0, bc > 0, pc > 0, Ta > 0, tci > 0}] == 0;
th[x_, y_] = E^(-bh*x/L)*{thi + (bh/L)*Integrate[E^(bh*s/L)*T[s, y, w], {s, 0, x}]};
bc2 = (D[T[x, y, z], z] /. z -> w) == ph (th[x, y] - T[x, y, w]);
ortheq2 = Integrate[(bc2[[1]] - bc2[[2]])*Sin[(α x/L) + β]*Sin[(δ y/l) + θ], {x, 0, L}, {y, 0, l}, Assumptions -> {C1 > 0, C2 > 0, L > 0, l > 0, α > 0, β > 0, γ > 0, δ > 0, θ > 0, bh > 0, ph > 0, Ta > 0, thi > 0}] == 0;
soln = Solve[{ortheq1, ortheq2}, {C1, C2}];
CC1 = C1 /. soln[[1, 1]];
CC2 = C2 /. soln[[1, 2]];
The coefficients CC1, CC2
I get from this code are extremely complex and lengthy (I must mention here that they are correct as I have verified my series solution against an FEM approach), which makes reporting them in a thesis or a scientific communication troublesome.
I will appreciate if someone can help me simplify the resulting C1,C2
expressions. I have already tried the inbuilt Simplify
command to not so favorable results.
Some context and possibly helpful information
The function I am trying to determine is of the form:
$$ T(x,y,z)=\sum_{n,m=0}^{\infty}(C_1 e^{\gamma z}+C_2 e^{-\gamma z})\sin\bigg(\frac{\alpha_n x}{L}+\beta_n\bigg)\sin\bigg(\frac{\delta_m y}{l}+\theta_m\bigg)+T_a \tag 1 $$
The two $z$ bc(s) are:
$$\frac{\partial T(x,y,0)}{\partial z}=p_c (T(x,y,0)-t_c) \tag 2$$ $$\frac{\partial T(x,y,w)}{\partial z}=p_h (t_h-T(x,y,w))\tag 3$$
I have defined $t_c, t_h$ in my code and am not repeating here. If someone would have solved this problem using a pen and paper approach, he/she would have substituted $(1)$ in $(2), (3)$ and multiplied throughout by $\int_0^L \sin\bigg(\frac{\alpha_k x}{L}+\beta_k\bigg)\mathrm{d}x$ and $\int_0^l \sin\bigg(\frac{\delta_j y}{l}+\theta_j\bigg)\mathrm{d}y$ and used their orthogonality to remove the summations. In this procedure, he/she might have used the following relations:
$$u=\int_0^L \sin\bigg(\frac{\alpha_n x}{L}+\beta_n\bigg)\sin\bigg(\frac{\alpha_k x}{L}+\beta_k\bigg)\mathrm{d}x, v=\int_0^l \sin\bigg(\frac{\delta_m y}{l}+\theta_m\bigg)\sin\bigg(\frac{\delta_j y}{l}+\theta_j\bigg)\mathrm{d}y$$ For $n=k, m=j$, these integral evaluates to $u=\frac{L}{2}-\frac{L}{4}[\sin(2\alpha_k + 2\beta_k)-\sin(2\beta_k)]$, $v=\frac{l}{2}-\frac{l}{4}[\sin(2\delta_k + 2\theta_k)-\sin(2\theta_k)]$.
For $n\neq k$, the integrals are $0$ in this particular problem. I am skipping those details here.
Apart from these integrals, one also encounters the following while solving
$$I_1=\int_0^L \sin\bigg(\frac{\alpha_k x}{L}+\beta_k\bigg)=\frac{L}{\alpha_k}[\cos(\beta_k)-\cos(\alpha_k+\beta_k)], I_2=\int_0^l \sin\bigg(\frac{\delta_j y}{l}+\theta_j\bigg)=\frac{l}{\delta_j}[\cos(\theta_j)-\cos(\delta_j+\theta_j)]$$
I mention the $u,v,I_1,I_2$ expressions here as I guess these might help in simplification. I will also post their MMA code if someone wishes to use:
u = L/2 - (L/4)*(Sin[2 α + 2 β] - Sin[2 β])
v = l/2 - (l/4)*(Sin[2 δ + 2 θ] - Sin[2 θ])
I1 = (L/α)*(Cos[β] - Cos[α + β])
I2 = (l/δ)*(Cos[θ] - Cos[δ + θ])
Alternative approach This is an alternative approach from Andrea's great answer:
I tried an alternative approach where I write the two linear equations (i.e ortheq1
and ortheq2
) containing $C_1$ and $C_2$ as the following:
$$A_{11}C_1+A_{12}C_2=XX_1 \tag4$$ $$A_{21}C_1+A_{22}C_2=XX_2 \tag5$$
I then extracted the coefficients of $C_1$ and $C_2$ using the following code, for which I took help from this answer given by Natas
Module[{coeffs = CoefficientList[Subtract @@ ortheq1, {C1, C2}]},
A11[C1_] = coeffs[[2, 1]] C1;
A12[C2_] = coeffs[[1, 2]] C2;
X11 = -coeffs[[1, 1]];
]
(Subtract @@ ortheq1) - (A11[C1] + A12[C2] - XX1) // Simplify
(* 0 *)
Module[{coeffs =
CoefficientList[Subtract @@ ortheq2, {C1, C2}]},
A21[C1_] = coeffs[[2, 1]] C1;
A22[C2_] = coeffs[[1, 2]] C2;
XX2 = -coeffs[[1, 1]];]
(Subtract @@ ortheq2) - (A21[C1] + A22[C2] - XX2) // Simplify
(*0*)
The solution of $(4),(5)$ is pretty straightforward in terms of $A_{11},A_{12},A_{21},A_{22},XX_1$ and $XX_2$
$$\text{C1}\to -\frac{A_{22} \text{XX}_1-A_{12} \text{XX}_2}{A_{12} A_{21}-A_{11} A_{22}},\text{C2}\to -\frac{A_{11} \text{XX}_2-A_{21} \text{XX}_1}{A_{12} A_{21}-A_{11} A_{22}}$$
I then simplified (using Mathematica and some hand calculations by looking at similar terms) $A_{11},A_{12},A_{21},A_{22},XX_1$ and $XX_2$ to get the following: