New answers tagged

3

This is not a solution but may provide a good first step. The inner integral (a Green's function, I presume) can be performed symbolically. g = Simplify[Integrate[q^2*((BesselJ[0, t*q] - (2*BesselJ[1, t*q])/(t*q))* BesselJ[0, k*q] + ((6*BesselJ[1, t*q])/(t*q) - 2*BesselJ[0, t*q])* BesselJ[1, k*q]/(k*q)), {q, 0, Infinity}, Assumptions -> k > 0 ...


4

For small k, xs = 10^-4; xm = 12; s = ParametricNDSolve[{y''[x] + 3 y'[x]/x - y[x] + 3/2 y[x]^2 - k y[x]^3/2 == 0, y'[xs] == 0, y[xm] == 0}, y, {x, xs, xm}, {k, ys}, Method -> {"Shooting", "StartingInitialConditions" -> {y[xs] == ys, y'[xs] == 0}}]; f = y[.2, 5.2] /. s; f[xs] Plot[f[x], {x, xs, xm}, AxesLabel -> {x, y}, PlotRange ...


0

(community wiki) This is a slightly cleaned up version to demonstrate the error. A = 1; \[Alpha] = 4; \[Mu] = 1.0000; k = 0; \[Tau] = 1; \[Delta] = 1/2; m = 1/2; s[rd_] := (\[Mu] rd^\[Alpha])/Pm; LocalMeanPowerInLinear = 1; LocalMeanPowerIndB = Log10[LocalMeanPowerInLinear]*10; \[Beta] = LocalMeanPowerIndB*Log[10]/10; StdSindB = 8; \[Sigma] = ...


1

The integro-differential equation can be rewritten as s = NDSolve[{x'[t] == Integrate[x[q], {q, t - 10, t - 1}], x[t /; t <= 0] == 1}, x, {t, 0, 20}] In itself, this transformation does not help. But, it does suggest a course of action. First, note that x'[0] == 9. Then note that the DDE can be differentiated to give s = NDSolve[{x''[t] == x[t ...


1

As mentioned in the comments that DSolve will be unable to solve this nonlinear coupled system of two ODE's. Instead you can use NDSolve. Here is my try omega = 1.83465945; a0 = 0; epsilon = 0.5; Eq1 = y1''[x] == (Sqrt[(1 - epsilon^2)/((Sqrt[1 + a0^2] + y2[x])^2 - epsilon^2*(1 + y1[x]^2))]/epsilon^2 - omega^2) y1[x]; Eq2 = y2''[x] == (Sqrt[(1 - ...


6

The way to deal with this is to use the special setting Method -> "InterpolationPointsSubdivision" of NIntegrate[], which will automagically split the integrand so that an integration rule (by default, "GlobalAdaptive") is only applied within each piecewise polynomial interval of the InterpolatingFunction[] involved. This is akin to the functionality of ...


3

If you are willing to accept some error you can get a faster result by fitting the data to function. Other than at each extreme the data looks like a shifted and scaled Sinh function. Using your data (i.e., not re-copied) sol = FindFit[data, a Sinh[(x - x0)/b], {{a, 0.000015}, {b, 15}, {x0, 100}}, x] (* {a -> 0.0000140493, b -> 14.3721, x0 -> ...


2

NDSolve returned interpolation functions which come from the FEM will evaluate to Indeterminate if queried outiside of the region. In this case, for example: RegionMember[\[CapitalOmega], {10, 50}] (*False*) sol[10, 50] (*InterpolatingFunction::dmval: "Input value {10.,50.} lies outside the range of data in the interpolating function. Extrapolation will be ...


3

I have found my mistake. It was on the initial condition if we take $$\phi(zi)=0$$ and $$\phi'(zi)=0$$ the both methods will give the exact same solution.


1

I Have finally found what was causing the problem. it was with notation. I define my constant a_o but in the equation I have used a_0. Once I changed that it was working.


0

We can learn something by looking at the progression of finite integrals: z = 1; \[Epsilon] = 1/200000000000000; trend = Table[{n, NIntegrate[ BesselK[1, Sqrt[(x^2 + z^2)]]/ Sqrt[(x^2 + z^2)] x (Cosh[(1 - \[Epsilon]) x]), {x, 0, n}, MaxRecursion -> 20, WorkingPrecision -> 40] }, {n, 10^Range[7]}]; Show[{ListLogLogPlot[trend], ...


2

It's from the Bessel factor: Cosh[(1 - ϵ) x] /. x -> 10.`40^16 Note that the Bessel function evaluates to Underflow[]:


0

Edit: Posted for review.. I'm not sure if this is correct. making the substitution per comments, p=r Exp[I t] so that dp == r I Exp[I t] dt == I p dt : With[{r = 2, a = 1, b = 1}, (1/ (2 Pi I)) NIntegrate[ I Exp[a^2/(2 (r Exp[I t])) + b^2/2 (r Exp[I t])], {t, 0 , 2 Pi}]] 1.26607 + 4.24074*10^-15 I for the record I first though we could use ...


1

What you have, I guess, is DAE in the variable t. If you specify the initial condition g[x, 0] == Cosh[x]/Cosh[Pi], NDSolve will compute a "solution," but warns that "an insufficient number of boundary conditions have been specified for the direction of independent variable x." It then computes different initial values, that lead g to be almost identically ...


6

The oddity in this case comes from NSum which is being called in a certain way from NIntegrate. This is a simple example that has roughly the same behavior (note in this case the exact result is known to be $\mp \ln 2$): NSum[(-1)^n/n, {n, 1, Infinity}, Method -> {"AlternatingSigns", Method -> "WynnEpsilon"}, WorkingPrecision -> 32] (* ...


1

Most recent edit This seems to work (tested exactly what is posted here in a fresh kernel), however it does complain a little. α = 4; μ = 10; k = 1; τ = 1; δ = 1/2; s[r_] := (μ r^α)/Pm f[h_] = FullSimplify[ Exp[2 k] (k + 1)/τ Exp[-k - (k + 1) h/τ] BesselJ[0, Sqrt[4 k (k + 1) h/τ]] ]; int[r_, h_] = Integrate[(1 - Exp[-s[r] Pm h ...


2

Difficulties encountered in solving the dispersion relation in the Question are due not so much to convergence of the integral as to the branch point in complex γ- space, which occurs where the argument of ArcTanh[] is equal to 1. Based on the related article cited in a comment above, the integration contour {γ, 1, Infinity} must pass below all non-analytic ...


4

The problem is that Expectation does not evaluate to a numeric result in all cases. It's also quite slow. You could replace it by NExpectation in the final integrand. I threw in an extra N for just to be sure. It takes so long to evaluate, I didn't have time to experiment. AverageProbSuccess[B_, \[Lambda]_] := Block[{n = 0, i, Expectation}, ...


2

It seems that this might be a bug or maybe a weakness of the NDSolvemachinery. One can observe, that with the option "SimplifySystem" -> False the issue does not arise. In fact a lot of settings will cause no problem at all. As far as I can see, the culprit is the option DependentVariables as it seems to influence the sequence of equation simplifications ...


7

You can find the value of $x_{b}$ by using NDSolve and a stopping condition: Reap[ NDSolve[{x'[t] == Sin[t], x[0] == 0, WhenEvent[x[t] == 1, Sow[t]; "StopIntegration"]}, x, {t, Infinity}]][[2, 1, 1]] (* 1.5708 *) Just to verify: Integrate[Sin[t], {t, 0, 1.5708}] (* 1. *)


3

In this BVP, Mathematica uses the shooting method, and you're shooting at an unstable solution. You can iteratively approach the solution, extending the interval of integration at each step, but at machine precision, you can extend it only so far. I'll set up bc to depend on symbolic min and max, so we can fiddle with them at each iteration: (*Boundary ...


4

TechSupport acknowledged and proposed a simple workaround by putting inert expression, e.g. empty string, inside the { }: NDSolve[{x'[t] == x[t], x[0] == 1, WhenEvent[Mod[t, 1] == 0, {""}]}, x, {t, 0, 3}]


5

Here is a simple example for the default method (LSODA) that shows a couple of the issues related to the situation in the question: $$y' = \exp(-10 \, x^2), \quad y(-20) = 1, \quad -20 \le x \le 20$$ The exact solution is a scaled error function (Erf), which has a sigmoid graph going from $y(-20)=1$ to $y(20) \approx 1.5605$. For $|x|$ large, $y'$ is ...



Top 50 recent answers are included