# Tag Info

1

For the code in the question, ν1 is not always positive, as can be seen by plotting it as a function of γ. ListPlot[%[[2]], DataRange -> {0, .1}, AxesLabel -> {γ, ν1}] where [%[[2]] is obtained from Sow[ν1 /. NSP] within NewRoots. Evidently, the computation breaks down when ν1 decreases to zero. I have run similar computations for smaller Npart, ...

0

Something like the following? f[x_, m_] := 1 + m x Manipulate[ Plot[f[x, m], {x, 0, 1}, PlotRange -> {{0, 1}, {0, 2}} ], {{m, 1}, -2, 2} ] Where you can replace $f$ with your function

1

Using the expressions derived in this paper, we have the following: SetAttributes[aiPrimeZero, Listable]; aiPrimeZero[s_Integer, prec_: MachinePrecision] := With[{t = N[3 π (4 s - 3)/8, prec]}, FixedPoint[# - AiryAiPrime[#]/(# AiryAi[#]) &, -t^(2/3) Fold[#1/t^2 + #2 &, {18683371/1244160, -181223/207360, ...

2

(This is more of a long comment than an answer.) I distinctly recall having the feeling of disappointment in trying to use the derivative of $\eta(\tau)$ as an intermediate in computing $E_2(\tau)$. Among other things, I tried this alternative formula: $$\frac1{\eta(\tau)}\frac{\mathrm d}{\mathrm d\tau}\eta(\tau)=-\zeta(\pi i\mid-\pi i,-\pi i \tau)$$ ...

5

There is some issue with internal numerics. As the argument gets smaller, the more precision is needed. For t == 0.01, three times $MachinePrecision is sufficient. Table[ N@N[ Derivative[1][DedekindEta][I Round[t, 1/100]], 3$MachinePrecision], {t, .01, .2, .01}] (* {0. - 1.09595*10^-7 I, 0. - 0.00919556 I, 0. - 0.256807 I, 0. - 1.08606 I, 0. - ...

2

Modifying the code to include the missing boundary conditions (chosen somewhat arbitrarily in the absence of additional information) that I mentioned in my comment above, tmax = 10; solution = NDSolveValue[{pdeF, pdeM, v1[x, tmax] == 0, v2[x, tmax] == 0, v1[0, t] == 0, v2[0, t] == 0}, {v1, v2}, {x, 0, 1.2}, {t, 0, tmax}, Method -> ...

6

You have a faulty understanding of Mathematica's arbitrary precision arithmetic facility. N given a 2nd argument does not round or truncate a machine precision number (which essentially exist in their own numeric facility separate from the arbitrary precision facility) given as its 1st argument. a = Tan[10 °]; Precision[N[N[a], 4]] MachinePrecision ...

2

To obtain numerical accuracy you have to manually increase the precision of the obtained numerical value SetPrecision[N[Tan[10 °]], 30] - Tan[10 °] (* 1.929227666420*10^-18 *)

1

I post an answer based on the comment from J.M. using the Weierstrass substitution and parallel to Daniel Lichtblau set-up. Pre-set-up: F1[a1_, b1_, b2_, c2_] := -(41/4) + Cos[a1] (10 + 3 Cos[b1]) - Cos[b2] (4 + (7 Cos[c2])/2) + 1/4 (50 - 10 Cos[a1] - 3 Cos[a1] Cos[b1] - 10 Sin[a1] - 3 Cos[b1] Sin[a1] - 3 Sin[b1]) + 1/16 (-159 + 16 ...

4

This should get you started. First the basic definitions to keep this self contained. F1[a1_, b1_, b2_, c2_] = -(41/4) + Cos[a1] (10 + 3 Cos[b1]) - Cos[b2] (4 + (7 Cos[c2])/2) + 1/4 (50 - 10 Cos[a1] - 3 Cos[a1] Cos[b1] - 10 Sin[a1] - 3 Cos[b1] Sin[a1] - 3 Sin[b1]) + 1/16 (-159 + 16 Cos[b2] + 14 Cos[b2] Cos[c2] + 16 Sin[b2] + 14 ...

2

This seems to be caused by the boundary condition evaluated at a variable point. As an illustration, this y[4][3] /. ParametricNDSolve[{ y''[x] + y'[x] + y[x] == 0, y'[10] == y[10], y[0] == u }, y, {x, 0, 10}, u] will evaluate just fine, but changing the y' initial condition to y[4][3] /. ...

1

I note that your diffusion constant has gone away (been set to $1$). I get working solutions with soln = NDSolve[{ D[u[t, x, y], t] == D[u[t, x, y], x, x] + D[u[t, x, y], y, y] + u[t, x, y], Derivative[0, 1, 0][u][t, 0, y] == 0, Derivative[0, 1, 0][u][t, 100, y] == 0, Derivative[0, 0, 1][u][t, x, 0] == 0, Derivative[0, 0, 1][u][t, x, 100] ...

0

Here is an approach to implementing a steady state stop criteria by performing a regression on the last n values. craters = {{0., 0.}}; number = {1}; nlast = 500; tol = 0.001; Dynamic[( craters = #; clen = Min[nlast, Length@number]; fit = LinearModelFit[number[[-clen ;;]], x, x]["BestFitParameters"]; slope = fit[[2]]; ...

5

Here's how I go about doing this type of algebra with Mathematica: eqn = D[u[x, t], t] + D[u[x, t], x] == 0; First, expand the function u[x, t + dt] to first order in dt around 0 and the function u[x -h, t] to first order in h around 0: eqn1 = u[x, t + dt] == Series[u[x, t + dt], {dt, 0, 1}] // Normal eqn2 = u[x - h, t] == Series[u[x - h, t], {h, 0, 1}] ...

0

I have tried to implement all advices, but somehow it is still does not work. Here is the code. I must have been missing something gravely... ClearAll[a, b, c, x, g4, f4, dis] g4[x_?NumericQ] := a ChebyshevT[2, x] + b ChebyshevT[4, x] f4[x_?NumericQ] := Exp[x]^(1/2) + 2 - Exp[x] + x^5 dis[a_?NumericQ, b_?NumericQ, c_?NumericQ, x_] := Norm[f4[x] - g4[x], ...

1

In my experience results from NDSolve are generally quite reliable. When there is doubt I would try to understand what the issue is by solving a smaller but similar problem, symbolically if possible. For the example you posed, here is what DSolve gives for specific values of a, b and n. In[35]:= dsol = With[{a = 1, b = 1, n = 1, int = ...

0

With an extremely large domain you need to use LogLinearPlot to see the region of interest. LogLinearPlot[{(1 + 1/n)^n, E}, {n, 1, 10^17}, WorkingPrecision -> 15, PlotRange -> {2.7, 2.72}] EDIT: As the domain grows the working precision must grow as well. Manipulate[ LogLinearPlot[{(1 + 1/n)^n, E}, {n, 1, 10^m}, WorkingPrecision -> m, ...

8

The short answer to your question is that what you are attempting is insane, so it should be no surprise the result is insane. That said, let us explore the problem in a way that may enlighten you as to what is going on. For this it is useful to look at the numeric behavior of (1 + 1/x)^x for large x. f[x_] := (1 + 1/x)^x Table[N[f[x]], {x, 1.*10^Range[6, ...

Top 50 recent answers are included