I have the following code that has been running for more than three days without an answer, unfortunately. Now, my institution provides us with a computer with Intel Xeon CPU E-52650 v3 @ 20 CPU, 2.3GHz and 32 GB RAM. I have tried the same code on this computer, and it is taking the same time and still running without getting any answer.
I heard that we can use Needs["CUDALink`"]
but it gave us False
. I don't know now how I can benefit from the multi-core computer to speed up our computations or even how to rewrite the code in different way to help in the process. Is there any package we have to download to benefit from the supercomputer? Also, I saw online some info regarding parallel computing but I really don't understand it. Can any one help me speed up this computation?
Here is the code I wrote to evaluate my desired result, ae
:
psi1[x_] :=1/24 (-4 (-2 + x)^3 Sign[-2 + x] + (-3 + 2 x)^3 Sign[-(3/2) + x] - 8 Sign[-1 + x] + 24 x Sign[-1 + x] - 24 x^2 Sign[-1 + x] +
8 x^3 Sign[-1 + x] + 3 Sign[-(1/2) + x] -
18 x Sign[-(1/2) + x] + 36 x^2 Sign[-(1/2) + x] -
24 x^3 Sign[-(1/2) + x] + 3 Sign[1/2 + x] + 18 x Sign[1/2 + x] +
36 x^2 Sign[1/2 + x] + 24 x^3 Sign[1/2 + x] - 8 Sign[1 + x] -
24 x Sign[1 + x] - 24 x^2 Sign[1 + x] - 8 x^3 Sign[1 + x] -
27 Sign[3/2 + x] - 54 x Sign[3/2 + x] - 36 x^2 Sign[3/2 + x] -
8 x^3 Sign[3/2 + x] + 32 Sign[2 + x] + 48 x Sign[2 + x] +
24 x^2 Sign[2 + x] + 4 x^3 Sign[2 + x]);
psi2[x_] := 1/(4 Sqrt[
6]) (Sign[1/2 - x] + 2 (-2 + x)^3 Sign[-2 + x] +
27 Sign[-(3/2) + x] - 54 x Sign[-(3/2) + x] +
36 x^2 Sign[-(3/2) + x] - 8 x^3 Sign[-(3/2) + x] -
8 Sign[-1 + x] + 24 x Sign[-1 + x] - 24 x^2 Sign[-1 + x] +
8 x^3 Sign[-1 + x] + 6 x Sign[-(1/2) + x] -
12 x^2 Sign[-(1/2) + x] + 8 x^3 Sign[-(1/2) + x] -
20 x^3 Sign[x] + Sign[1/2 + x] + 6 x Sign[1/2 + x] +
12 x^2 Sign[1/2 + x] + 8 x^3 Sign[1/2 + x] + 8 Sign[1 + x] +
24 x Sign[1 + x] + 24 x^2 Sign[1 + x] + 8 x^3 Sign[1 + x] -
27 Sign[3/2 + x] - 54 x Sign[3/2 + x] - 36 x^2 Sign[3/2 + x] -
8 x^3 Sign[3/2 + x] + 16 Sign[2 + x] + 24 x Sign[2 + x] +
12 x^2 Sign[2 + x] + 2 x^3 Sign[2 + x]);
psi3[x_] :=1/24 (-4 (-2 + x)^3 Sign[-2 + x] +
3 (-3 + 2 x)^3 Sign[-(3/2) + x] + 56 Sign[-1 + x] -
168 x Sign[-1 + x] + 168 x^2 Sign[-1 + x] -
56 x^3 Sign[-1 + x] - 7 Sign[-(1/2) + x] +
42 x Sign[-(1/2) + x] - 84 x^2 Sign[-(1/2) + x] +
56 x^3 Sign[-(1/2) + x] - 7 Sign[1/2 + x] - 42 x Sign[1/2 + x] -
84 x^2 Sign[1/2 + x] - 56 x^3 Sign[1/2 + x] + 56 Sign[1 + x] +
168 x Sign[1 + x] + 168 x^2 Sign[1 + x] + 56 x^3 Sign[1 + x] -
81 Sign[3/2 + x] - 162 x Sign[3/2 + x] - 108 x^2 Sign[3/2 + x] -
24 x^3 Sign[3/2 + x] + 32 Sign[2 + x] + 48 x Sign[2 + x] +
24 x^2 Sign[2 + x] + 4 x^3 Sign[2 + x]);
psi4[x_] :=1/12 (-(-2 + x)^3 Sign[-2 + x] + (-3 + 2 x)^3 Sign[-(3/2) + x] +
28 Sign[-1 + x] - 84 x Sign[-1 + x] + 84 x^2 Sign[-1 + x] -
28 x^3 Sign[-1 + x] - 7 Sign[-(1/2) + x] +
42 x Sign[-(1/2) + x] - 84 x^2 Sign[-(1/2) + x] +
56 x^3 Sign[-(1/2) + x] - 70 x^3 Sign[x] + 7 Sign[1/2 + x] +
42 x Sign[1/2 + x] + 84 x^2 Sign[1/2 + x] +
56 x^3 Sign[1/2 + x] - 28 Sign[1 + x] - 84 x Sign[1 + x] -
84 x^2 Sign[1 + x] - 28 x^3 Sign[1 + x] + 27 Sign[3/2 + x] +
54 x Sign[3/2 + x] + 36 x^2 Sign[3/2 + x] +
8 x^3 Sign[3/2 + x] - 8 Sign[2 + x] - 12 x Sign[2 + x] -
6 x^2 Sign[2 + x] - x^3 Sign[2 + x]);
psi1jk[x_, j_, k_] :=Piecewise[{{(Sqrt[2])^j psi1[2^j x - k],
0 <= j}, {2^j psi1[2^j (x - k)], j < 0}}];
psi2jk[x_, j_, k_] :=Piecewise[{{(Sqrt[2])^j psi2[2^j x - k],
0 <= j}, {2^j psi2[2^j (x - k)], j < 0}}];
psi3jk[x_, j_, k_] :=Piecewise[{{(Sqrt[2])^j psi3[2^j x - k],
0 <= j}, {2^j psi3[2^j (x - k)], j < 0}}];
psi4jk[x_, j_, k_] :=Piecewise[{{(Sqrt[2])^j psi4[2^j x - k],
0 <= j}, {2^j psi4[2^j (x - k)], j < 0}}];
PSI[j_, k_, l_, s_] :=NIntegrate[
psi1jk[x, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}] -
NIntegrate[(x t + (x t)^2)*
psi1jk[t, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}, {t, -1, 1}] +
NIntegrate[
psi2jk[x, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}] -
NIntegrate[(x t + (x t)^2)*
psi2jk[t, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}, {t, -1, 1}] +
NIntegrate[
psi3jk[x, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}] -
NIntegrate[(x t + (x t)^2)*
psi3jk[t, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}, {t, -1, 1}] +
NIntegrate[
psi4jk[x, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}] -
NIntegrate[(x t + (x t)^2)*
psi4jk[t, j,
k]*(psi1jk[x, l, s] + psi2jk[x, l, s] + psi3jk[x, l, s] +
psi4jk[x, l, s]), {x, -1, 1}, {t, -1, 1}];
ce = ArrayReshape[Table[PSI[j, k, l, s], {j, -4., 4.}, {k, -32., 17.}, {l, -4.,4.}, {s, -32., 17.}], {450, 450}];
coef = Flatten[Table[NIntegrate[(psi1jk[x, l, s] + psi2jk[x, l, s] +
psi3jk[x, l, s] + psi4jk[x, l, s]), {x, -1, 1}], {l, -4.,4.}, {s, -32., 17.}]];
ae = PseudoInverse[ce].coef
Your support is much appreciated!
Sign
s really necessary? Why do all theSign
s pop up? Are they necessary? They might be a major obstruction for using more efficient integration schemes. Does the matrixce
in the end happen to contain many zeroes? Then most of the integrals are superfluous. $\endgroup$Sign
functions there after I did the Fourier transform to get the form of B-splines in time domain. We can't remove all of them as it is essential to get the domain of each spline. What do you mean for using efficient integration schemes? $\endgroup$ce
yes has many zeros and may have multiple rows with a zero values, but I cant ignore them as I have rows after them that are not zero. If we skip them we will get bad approximation. So I don't know if there is a way to skip them and consider those nonzero without affecting evaluating the vectorae
. $\endgroup$