7

The main question here is, there are too many approaches to perform the same operation. And normally, I didn't know which approach is the most optimal way in terms of efficiency. Mathematica's performance is hard to predict, even more so than that of other high-level languages. There is no simple guideline you can follow. There will always be surprises and ...


6

MichaelE2 already has answered the question in a comment: To use Method -> "ImplicitRungeKutta", differentiate the second equation and add a corresponding boundary condition for y. However, the OP expressed the concern that doing so might produce an inaccurate answer. Out of curiosity, I tried it. So, the following actually is an extended ...


5

FindMinimum seems to automatically choose the midpoint for a second starting point to specify the search direction (see tutorial). But the midpoint differs from the specified starting point by one bit. Therefore 55.00000000000001 == 55. is true since the default Internal`$EqualTolerance (2.10721 = Log10[2.^7]) specifies that two machine reals are equal if ...


4

Simplify gives the correct result. Simplify[Sin[(4 π^2)/3] + Sin[2/3 π (-(3/2) + 2 π)]] (* 0 *)


4

The source of the NIntegrate error messages can be seen from a factor of the integrand, x^d/Sqrt[1-c x^d z^d], of toroot. For c > z^-3, the integrand is singular for some point in the domain, {x, 0, 1}. Moreover, if NIntegrate could integrate through the singularity (and, with help, it can), the result would be a complex number, which (presumably) is ...


4

The solution for any number of steps (for instance, 5) is With[{a = 1, τ = 3, m = 4}, tm = (m + 1) τ; s = NDSolveValue[{f'[t] == -a*Sum[f[t - n τ] UnitStep[t - n τ], {n, 0, m}], f[t /; t <= 0] == 1}, f, {t, 0, tm}]; Plot[s[t], {t, 0, tm}, ImageSize -> Large, AxesLabel -> {t, f}, LabelStyle -> {15, Bold, Black}]] This ...


3

Your sol1 is a list containing the desired function of t. Either extract the first part of that list, or use NDSolveValue with f[t] in the second argument to return said function of t directly. The "non-numerical value for a derivative at t == 3" message arises from HeavisideTheta[0] not having a numerical value. Use UnitStep instead. Altogether: ...


3

Method 1: By using theorem 4 on page 219 of this book, we can easily obtain the convergence rates of these two iterative methods: φ1[x_] := Power[x + 1, (3)^-1] (D[φ1[x], x] /. x -> SuperStar[x]) // FullSimplify[#, (SuperStar[x])^3 - (SuperStar[x]) - 1 == 0] & φ2[x_] := (2 (x)^3 + 1)/(3 (x)^2 - 1) (D[φ2[x], x] /. x -> SuperStar[x]) // ...


3

This is an interpolation problem due to the course grid in h. For simplicity, label the solution s instead of testmodel001. Then, the grid in h is s["Coordinates"][[1]] (* {100., 106.25, 112.5, 118.75, 125., 131.25, 137.5, 143.75, 150., 156.25, 162.5, 168.75, 175., 181.25, 187.5, 193.75, 200., 206.25, 212.5, 218.75, 225., 231.25, 237.5, ...


2

In the calculation of the Precision[] of 2 a - a, the error in 2 a and a are treated as independent. Therefore the error bounds, 2 Δa and Δa, are added. Thus the new error bound is estimated as 3 Δa, and the Precision[] is reduced by Log10[3] each iteration. Therefore we run out of Precision[] in Precision[a]/Log10[3] steps: a = 1.11111111111111111111; ...


1

Well It took a few minutes but I was able to run N[Log[10],6*10^6] on my laptop (Intel Core i7-8750H @ 2.2 GHz) in 330 seconds. Looking into the problem I found the OEIS sequence for the digits of Log(10) https://oeis.org/A002392 and in the references of this page the current world record of 1,200,000,000,100 digits: https://ehfd.github.io/world-record/...


1

Memoization is the way to go here. Your problem is that when Mathematica sees wp[1000], it will rewrite it using your rule for wp[n_], and then it will try to evaluate wp[999], wp[998], and wp[997]. But each of those evaluations depend on, e.g., wp[996], and so Mathematica will end up evaluating wp[996] three times. This ends up exploding combinatorially: ...


1

I'm not sure what you are trying to model here, but there's not enough initial and boundary conditions for the system to be solved. I tried to just add a few, this works but I'm not sure exactly which initial and boundary conditions you need for your problem (*your eqs and conditions*) INC4 = Derivative[1, 0][T][0, τ]; INC5 = Derivative[2, 0][u][0, τ]; INC6 =...


1

using my myRootSearch and myRootSearchShow ClearAll[f]; f[x_, a_] := BesselJ[1, x]^2 + BesselK[1, x]^2 - Sin@Sin[a*x] Manipulate[ Column[{Quiet@myRootSearchShow[f[#, a] &, 0, 50, ImageSize -> 250], Quiet@myRootSearch[f[#, a] &, 0, 50]}], {a, 0, 4}]


Only top voted, non community-wiki answers of a minimum length are eligible