# Tag Info

## New answers tagged error

5

A typical way to test the result of a function is to set res = DSolve[...] and then test FreeQ[res, DSolve] to see if the result is free of any DSolve command. Now, DSolve might solve a differential equation in terms of Solve: DSolve[D[ ExpIntegralEi[x + y[x]] == x, x], y, x] (* Solve[-x + ExpIntegralEi[x + y[x]] == C[1], y[x]] *) This might not ...

1

Firstly, your f function is undefined at the boundaries between regions, so use <= to make sure the whole range is covered f[x_] := \[Piecewise]{{Tanh[2 x], 0 <= x < 2}, {Tanh[-2 (x - 4)], 2 <= x < 6}, {Tanh[2 (x - 8)], 6 <= x < 10}, {Tanh[-2 (x - 12)], 10 <= x <= 14}}; d = f'; Second, when you try to take the ...

0

Its useful to minimize the number of parameters in your expression as much as possible. Fundamentally you have things that look like this: Integrate[ t Log[a + b t], {t, 0, 1}] With just two parameters this quickly returns a conditional expression: ConditionalExpression[((2 a - b) b + 2 a^2 Log[a] + 2 (-a^2 + b^2) Log[a + b])/( 4 b^2), ...

2

I'm not sure, what exactly goes wrong on your machine, but here it works. Maybe one note, if your integral behaves well, then you could calculate the indefinite integral, which is faster by ages because Mathematica does not check conditions etc. expr = dy ((b x y + c x)/(e y + f) + g x) - dx (a/e x Log[e y + f]) /. {x -> px + t dx, y -> py + t ...

2

One can get the current value of a dynamic object using Setting: Slider[Dynamic@n, {1, 100, 1}, Appearance -> "Labeled"] fib = Dynamic@Table[Fibonacci[i], {i, n}]; indices = Dynamic@Flatten@Position[Setting@fib, _?(# > 99 &)]

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 -> ...

4

Here is the merit function: Both step control methods [line search and trust region] were developed originally with minimization in mind. However, they apply well to finding roots for nonlinear equations when used with a merit function. In the Wolfram Language, the 2-norm merit function r(x).r(x) is used. -- Introduction to Step Control The "sufficient ...

1

OK, look at the following: showStatus[status_] := LinkWrite[$ParentLink, SetNotebookStatusLine[FrontEnd`EvaluationNotebook[], ToString[status]]]; clearStatus[] := showStatus[""]; clearStatus[] rs = NDSolveValue[{IdentityMatrix[Length[a]].p'[t] + p[t].a + Transpose[a].p[t] - p[t].b.Inverse[r].Transpose[b].p[t] == {0, 0, 0, 0, 0, 0, ... 1 After asking Wolfram Support, they tell me this is a bug that has been fixed in version 10.1. 4 A somewhat redundant answer to Michael E2's, but providing the simplification. The problem is not that the numbers are not scaled. (Though it is nice to scale your problems when possible.) The problem is the intermediate forces. You should eliminate them, as well as simplifying the initial conditions. I named your constants for clarity: NDSolve[{ ... 6 Eliminate the unnecessary force* variables, which forces NDSolve to use the DAE solver, and just solve it as an ODE. Then you can use higher precision etc., if desired, but in this case you get the same solution using machine precision as higher precision. newsys = ComplexExpand@Eliminate[Rationalize[#, 0] &@{ ... 7 The error is due to an old Interpolation syntax for specifying multidimensional data as $$\{\{x_1, y_1, z_1, \ldots, f_1\}, \{x_2, y_2, z_2,\ldots, f_2\}, \ldots \}$$ meaning that$f_i$is the desired function value at the point$\{x_i, y_i, z_i, \ldots \}$where the points lie on a structured tensor product grid. This syntax was deprecated a long time ... 5 The only reason I know for writing the Contours option nested two-deep in a list is to designate the color of the contour. ContourPlot3D[x, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, Contours -> {{0., Green}}] In this case the your short form expression looks like Short[cp[[1, 2, 1]], 3] {{EdgeForm[], RGBColor[0., 1., 0.], GraphicsGroup[{...}]}, {}, ... 4 This is not one of the documented forms for Contours. You probably want either Contours -> {0.} or something like Contours -> {{0., Red}}. Right now ContourPlot3D is trying to use the latter form, but is filling in Automatic for the missing style. 4 There seems to be a number of ways to achieve what you want. I don't have MMA 10.2 at hand right now, but the same error comes up in 10.1. The primitive way is to improve MapThread like so: mapThread[f_, args_List, depth_Integer:1] := MapThread[f, PadRight[args, ConstantArray[Automatic, depth+1],$ToNothing], depth] /. f[\$ToNothing..] :> Nothing ...

Top 50 recent answers are included