Community RSS Feed https://community.wolfram.com RSS Feed for Wolfram Community showing any discussions in tag Numerical Computation sorted by active NIntegrate::inumr error while integrating interpolated functions https://community.wolfram.com/groups/-/m/t/2372900 Hello guys, i have a problem with double Integral length = 10*10^-6; dz = 5*10^-7; anzahl = length/dz; z = N[Range[0,length,dz]]; f = Range[anzahl+1]; For[i=1,i&lt;(anzahl+2),i++,f[[i]]=RandomReal[{-3*10^-9,3*10^-9}]]; koordinaten = Transpose[{z, f}]; finterpol = Interpolation[koordinaten]; finterpol2[zn_] := Piecewise[{{0,zn&lt;0},{finterpol[zn],0&lt;=zn&lt;=length},{0,zn&gt;length}}] I use this Piecewise function &#034;finterpol2[zn_]&#034; with an interpolated function in it for the following integration. (beta, n1, n2 and k0 are constants ) Ftilde[theta_] := NIntegrate[finterpol2[zn]*Re[Exp[-I*(beta-(n2*k0*Cos[theta]))*zn]],{zn,-Infinity,Infinity}]; After that i want to do a definit integration with Ftilde (\[Phi][d] is defined and outputs a constant): alpha = \[Phi][d]^2*(n2^2-n1^2)^2*(k0^3)/(4*Pi*n1)*NIntegrate[(1/length)*Abs[Ftilde[theta]]^2,{theta,0,Pi}] For the integral which calculates alpha I get an error message: &#034;NIntegrate::inumr: The integrand (\[Piecewise] &lt;&lt;1&gt;&gt;) Re[E^(-I zn (1.09246*10^7-5.83728*10^6 Cos[theta]))] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0.,5.*10^-7}}.&#034; and so on. How can I solve this? Thank you in advance for all the answers Andrei Costina 2021-09-25T14:25:59Z I'm having problems with third type heat transfer boundary condition https://community.wolfram.com/groups/-/m/t/2371852 Hi! I&#039;m a beginner level user of Mathematica, and still learning it. Basically, I&#039;m trying to monitor the natural cooling of an imaginary plastic slab with the top/bottom side insulated, only the left/right side is dissipating heat to the environment. Thus the model reduced to a 1D heat transfer model. The slab has a thickness of 10mm, and initial uniform temperature of 275C, the environment temperature is 25C. I&#039;m trying to implement a Neumann type boundary condition at both left (x = -5) and right (x = 5) side, i.e., k*dT/dx = h(T-Tenvironment) at boundary, but I keep getting error messages that the boundary and initial conditions are inconsistent and more importantly the results looks unstable, my code looks like this, can anyone give me a little help? Would be really appreciated! h = 13/(1000^2);(*units are converted to mm*) k = 0.3/1000; c = 1030; rou = 1380/(1000^3); heq = rou*c*D[u[t, x], t] == k*D[u[t, x], {x, 2}]; ic = u[0, x] == 275; bcs1 = (D[u[t, x], x] /. x -&gt; 5) + h*(u[t, 5] - 25) == 0; bcs2 = (D[u[t, x], x] /. x -&gt; -5) + h*(u[t, -5] - 25) == 0; sol = NDSolve[{heq, ic, bcs1, bcs2}, u[t, x], {t, 0, 20}, {x, -5, 5}]; F[t_, x_] = u[t, x] /. sol[]; Plot3D[F[t, x], {x, -5, 5}, {t, 0, 15}, PlotRange -&gt; All, AxesLabel -&gt; Automatic] Y L 2021-09-23T04:19:16Z Empty result when solving two differential equation with NDSolve[ ]? https://community.wolfram.com/groups/-/m/t/2371613 q[x_?NumericQ]:=(830397. - 0.375 x^(87/296))/( 4.51833*10^8 x^(34/37) - 1.02416*10^7 x - 1. x^(383/296)); sol1 = NDSolve[ Rationalize[{y1&#039;[x] == y1[x] (-3 P1[x] - q[x] + G&#039;[x]/G[x]), 3 P1[x] y2[x] + y2&#039;[x] == 0.95 y1[x] q[x], 4 P1[x] y3[x] + (y1[x] G&#039;[x])/G[x] + y3&#039;[x] == 0, 4 P1[x] y4[x] +y4&#039;[x] == 0.05 y1[x] q[x], P1[x] == 2.372463129699238`*^-19 Sqrt[y2[x] + y4[x] + y1[x] + y3[x]], G&#039;[x] == (-8.722718060807123`*^73 + 1.80559635200202`*^-76 G[x]^4 y3[x])/G[x]^2, 3 y1[10^-30] == 10^51 \[Pi]^2, y2[10^-30] == 0, y3[10^-30] == 3.3*10^56 \[Pi]^2, y4[10^-30] == 0, G[10^-30] == 5.468912167778173`*^27}], {y1, y2, y3, y4, G}, {x, 10^-30, 10^5}, Method -&gt; &#034;Automatic&#034;, AccuracyGoal -&gt; 100, PrecisionGoal -&gt; 5, WorkingPrecision -&gt; 80] How to solve such coupled numerical differential equation, since it always gives back some empty result instead of some Interpolating Function. John Wick 2021-09-22T16:14:28Z