Skip to main content

calculus and analysis - Residue failed to reproduce this residue in a paper


This problem is a more clearly state of my original problem which is off topic, so I reconsider my problem carefully based on previous discussions, and gives the following valid code to reproduce my problem with all the necessary information.


I use Mathematica to confirm a result from a paper Unsteady unidirectional flow of Bingham fluid between parallel plates with different given volume flow rate conditions which is to calculate the residue of a expression at zero.



  1. Reproduce of my problem:



The following code shows my efforts, but failed to reproduce the analytical solution (resAna in the code) in the papaer.


ClearAll["Global`*"]

varCons = {ν > 0, up > 0, h > h0 >= 0, h > y >= 0};
m = Sqrt[s]/Sqrt[ν];
Δ = Sinh[m h] Sinh[m h0] - Cosh[m h] Cosh[m h0];
Ξ = Cosh[m h0] (Sinh[m h] - Sinh[m h0]) - Sinh[m h0] (Cosh[m h] - Cosh[m h0]);
Ω = (m h (Δ + Cosh[m h0] Cosh[m y] - Sinh[m h0] Sinh[m y]))/(m h Δ +
m h0 (Cosh[m h0]^2 - Sinh[m h0]^2) + Ξ);

u = FullSimplify[up/(t0 s^2) Ω E^(s t), varCons];

Residue[u, {s, 0}]
(* this failed gives the desired 'resAna' as below *)

X1 = (1/6 (h^3 - y^3) h0 + 1/6 (h - y) h0^3 - 1/4 (h^2 - y^2) h0^2 -1/24 (h^4 - y^4)) (1/ν)^(5/2);
X2 = ((h - y) h0 - 1/2 (h^2 - y^2)) t (1/ν)^(3/2);
X3 = (h^5/30 - (h^4 h0)/8 + (h^3 h0^2)/6 - (h^2 h0^3)/4 + (21 h0^5)/120) (1/2 (h^2 - y^2) - (h - y) h0)/(h0^3/6 - (h0 h^2)/2 + h^3/3) (1/ν)^(5/2);
resAna = -((up h)/t0) (X1 + X2 + X3)/((h0^3/6 - (h0 h^2)/2 + h^3/3) (1/ν)^(3/2));
(* resAna is the analytical solution in the paper *)


enter image description here 2. Some numerical tries to get a clue or two


NResidue seems works after given a set of numeric values, but Residue still doesn't work


t0 = 1/10;
t = 2 t0;
up = 1/100;
ν = 2/3580;
h = 1/1000;
h0 = h/8;
y = h/9;


Needs["NumericalCalculus`"]
NResidue[u, {s, 0}, WorkingPrecision -> 20, PrecisionGoal -> 20] // Chop

N[resAna, 20]

Residue[u, {s, 0}]

enter image description here 3. I had thought that Residue should work as in this example by @xzczd


ClearAll["Global`*"]

r = 1;
f[p_, ξ_] = -(5 p Sqrt[(5 p^2)/6 + ξ^2])/(4 (-4 ξ^2 Sqrt[(5 p^2)/6 + ξ^2] Sqrt[(5 p^2)/2 + ξ^2] + ((5 p^2)/2 + 2 ξ^2)^2));
poles = p /. Simplify[Solve[Denominator[f[p, ξ]] == 0, p], ξ > 0]
Residue[f[p, ξ], {p, #}] & /@ poles;
Simplify[%, ξ > 0] // N

Answer




I. A summary for the failing trial






  1. Residue can't calculate the residue of u directly. (It's hard to tell whether it's a bug or not, Residue never promises he will calculate every known residue, anyway.)




  2. SeriesCoefficient won't give desired answer in the following case:


    SeriesCoefficient[u, {s, 0, -1}]

    enter image description here


    If it gave the desired answer, we would be able to calculate the residue by finding Laurent series expansions.





  3. Limit won't give desired answer in the following case:


    Limit[D[s^2 u, s], s -> 0]

    If it gave the desired answer, we would be able to calculate the residue with limit formula.





II. Solution




By observing the structure of undesired output of SeriesCoefficient and u


enter image description here


I guess that maybe it's the $\sqrt{\nu}$ term that causes trouble, so I tried adding the known constraint $\nu>0$ to SeriesCoefficient and Limit, and they give the desired answer then:


resAnaTrue = 
Simplify[SeriesCoefficient[u, {s, 0, -1}, Assumptions -> ν > 0], ν > 0];

resAnaTrue2 = Limit[D[s^2 u, s], s -> 0, Assumptions -> ν > 0]
(* -(h up (h - y) (h - 2 h0 + y) (2 h^3 - 6 h^2 h0 -
2 h (2 h0^2 - 10 h0 y + 5 y^2 + 60 t ν) -
h0 (7 h0^2 - 10 h0 y + 5 y^2 + 60 t ν)))/(20 (h - h0)^2 (2 h + h0)^2 t0 ν) *)


resAnaTrue == resAnaTrue2 // Simplify
(* True *)


III. The formula given in the paper is incorrect



Let's first check the result with the parameters given by you:


para = {t0 -> 1/10, t -> 2 t0, up -> 1/100, ν -> 2/3580, h -> 1/1000, h0 -> h/8, y -> h/9};
ref = NResidue[u //. para, {s, 0}, WorkingPrecision -> 64];

rst1 = N[resAna //. para, 64];
rst2 = N[resAnaTrue //. para, 64];
ref - rst1
(* -2.9855303465924184799970408331399786805478493918575833694822*10^-7 *)
ref - rst2
(* 0.*10^-66 *)

As one can see, the precision of the new derived formula is desired, while there's a significant difference (approximately 3*10^-7) between the formula given in the paper and numeric result.


With the following set of parameter, the difference will be even clearer:


para2 = {ν -> 1/2, h0 -> 1, h -> 3, t0 -> 1/5, up -> 1/5, y -> 1/3, t -> 5};

ref = NResidue[u /. para2, {s, 0}];
rst1 = N[resAna /. para2];
rst2 = N[resAnaTrue /. para2];
ref - rst1
(* -0.653061 + 1.22133*10^-13 I *)
ref - rst2
(* 9.76996*10^-15 + 1.22133*10^-13 I *)

Apparently the formula in the paper is wrong.


Comments

Popular posts from this blog

plotting - How to draw lines between specified dots on ListPlot?

I would like to create a plot where I have unconnected dots and some connected. So far, I have figured out how to draw the dots. My code is the following: ListPlot[{{1, 1}, {2, 2}, {3, 3}, {4, 4}, {1, 4}, {2, 5}, {3, 6}, {4, 7}, {1, 7}, {2, 8}, {3, 9}, {4, 10}, {1, 10}, {2, 11}, {3, 12}, {4,13}, {2.5, 7}}, Ticks -> {{1, 2, 3, 4}, None}, AxesStyle -> Thin, TicksStyle -> Directive[Black, Bold, 12], Mesh -> Full] I have thought using ListLinePlot command, but I don't know how to specify to the command to draw only selected lines between the dots. Do have any suggestions/hints on how to do that? Thank you. Answer One possibility would be to use Epilog with Line : ListPlot[ {{1, 1}, {2, 2}, {3, 3}, {4, 4}, {1, 4}, {2, 5}, {3, 6}, {4, 7}, {1, 7}, {2, 8}, {3, 9}, {4, 10}, {1, 10}, {2, 11}, {3, 12}, {4, 13}, {2.5, 7}}, Ticks -> {{1, 2, 3, 4}, None}, AxesStyle -> Thin, TicksStyle -> Directive[Black, Bold, 12], Mesh -> Full, Epilog -> { Line[ ...

list manipulation - Selecting multiple columns from a matrix?

Sample data: data = { {{2013, 1, 1}, 24.13, 167.67, 231.82}, {{2013, 1, 2}, 32.15, 170.92, 225.99}, {{2013, 1, 3}, 35.43, 172.68, 221.67}, {{2013, 1, 4}, 36.73, 173.05, 218.32}, {{2013, 1, 5}, 58.19, 165.96, 197.05}, {{2013, 1, 6}, 69.99, 163.50, 187.52}, {{2013, 1, 7}, 71.37, 154.21, 175.58}, {{2013, 1, 8}, 72.51, 149.66, 163.25}}; I want a DateListPlot with three graphs, so for a matrix formed by columns 1 and 2, one for columns 1 and 3, and 1 for columns 1 and 4. At the moment I'm using this code: data2 = Transpose[{data[[All, 1]], data[[All, 2]]}]; data3 = Transpose[{data[[All, 1]], data[[All, 3]]}]; data4 = Transpose[{data[[All, 1]], data[[All, 4]]}]; DateListPlot[{data2, data3, data4}, Joined -> True, Filling -> {3 -> {1}}] but I have a hunch that this can be done more efficiently. I don't like the Transpose s in particular. Any ideas? edit (for extra credit) What if I need to multiply the second column by 2, which in my solution is simp...

calculus and analysis - Integral of the Sinc product

Let us consider the following integral $$ B_n = \int_0^\infty \prod_{k=1,3,5,\dots}^n\frac{\sin (x/k)}{x/k}dx $$ By definition, Sinc[x] == Sin[x]/x , therefore B[n_?OddQ] := Integrate[Product[Sinc[x/k], {k, 1, n, 2}], {x, 0, Infinity}] B /@ Range[1, 13, 2] {Pi/2, Pi/2, Pi/2, Pi/2, Pi/2, Pi/2, Pi/2} OK, everything is fine. But... B[15] 467807924713440738696537864469 Pi/935615849440640907310521750000 What's going on? Answer As Eckhard wrote in comments B[n] is the n-th Borwein integral . (The letter B was not accidental :) ) This funny properties of Borwein integrals is related to the Fourier transform of Sinc function FourierTransform[Sinc[x], x, k] 1/2 Sqrt[Pi/2] (Sign[1 - k] + Sign[1 + k]) Plot[%, {k, -2, 2}, Filling -> 0] which is the box function. The result is $\pi/2$ while the sum $$ 1/3+1/5+\dots+1/n $$ B_n = \frac{\pi}{2} - \pi \bigg(\sum_{k=3,5,\ldots}^n\frac{1}{k} -1\biggr)^\frac{n-1}{2}\prod_{k=3,5,\dots}^n\frac{k}{k-1}. $$ For $n=15$ it is equal to $$ \frac{46780...