# Tag Info

The problem relates to the granularity of MachinePrecision numbers. The number 70.329862 is represented as an integer times a power of 2: x0 = SetPrecision[70.329862, Infinity] (* 4949024067128413/70368744177664 *) (The denominator is 2^46.) The machine numbers near this number do not allow for the representation of 70.329862 with $MachinePrecision ... 8 EDIT Input gets different rounding to machine-precision real if it's written in arbitrary precision! RealDigits[70.329862, 2] (* {{1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1}, 7} *) RealDigits[ SetPrecision[70.329862000000000000, ... 7 Just a kickstart to get the equations right (yours are wrong) and an idea of the system dynamics: With[{Pr = 10, a = 1.181, b = 0.675, v = 0.77, l = 8/3}, pfun = ParametricNDSolveValue[{ x'[t] == Pr v (y[t] - x[t]), y'[t] == R (b/v) x[t] - a y[t] - (b/v) (R - (a v)/b) x[t] z[t], z'[t] == a l (x[t] y[t] - z[t]), x[0] == y[0] == 0.8, ... 6 Try this: Solve[c == 0.0625 + 0.0008*X - 0.0232*Y - 0.0157*Z + 0.0059*X^2 + 0.0112*Y^2 + 0.0160*Z^2 - 0.0063*X*Y - 0.0243*X*Z + 0.0211*Y*Z // Rationalize, Z] (* {{Z -> 1/320 (157 + 243 X - 211 Y - \[Sqrt](-375351 + 6400000 c + 71182 X + 21289 X^2 + 82226 Y - 62226 X Y - 27159 Y^2))}, {Z -> 1/320 (157 + 243 X - ... 4 you could start with a simple hack of your code to extract the intersections; Something like {x1, y1} = Transpose[line]; {x2, y2} = Transpose[RotateLeft[line]]; gr2 = {(x1^2 - x1*x2 + y1*(-y1 + y2)), (y1 - y2)} // Transpose // Most; which can be encapsulated in the ellipseSimLowLevel as follows ellipseSimLowLevel[ellPos_, θ_, aimAt_, refls_, ... 4 you can also try UnitStep Manipulate[ Plot[{f[u] /. subs, f[u] UnitStep[u - a] UnitStep[b - u] /. subs}, {u, 0, 5000}, PlotRange -> All, Filling -> {2 -> Axis}, Epilog -> {PointSize[Large], Point[{{a, f[a] /. subs}, {b, f[b] /. subs}}]}] , {a, 0, 4000}, {b, 100, 4000}] 4 I am guessing you want to do something like Manipulate[ Column[{Row[{With[{a = a, b = b}, HoldForm[Integrate[f[u] /. subs, {u, a, b}]]], Integrate[f[u] /. subs, {u, a, b}]}, " = "], Plot[{ConditionalExpression[f[u] /. subs, a <= u <= b], f[u] /. subs}, {u, 0, 5000}, PlotRange -> All, ... 2 Not sure if it is what you are after: action[dog_] := Print@StringForm["take dog no. for a walk", dog]; RadioButtonBar[Dynamic[dog, (dog = #; action[dog]) &], {1, 2, 3}] 2 The first step in debugging is always to narrow down the problem. To do this, you can make ncurve global: DynamicModule[{(* ncurve = {} *) }, EventHandler[ ... Then, you can click on the image and evaluate ncurve in a separate cell: Length[ncurve] 248652 (You can and should put ncurve in a DynamicModule once you're done, of course. But for ... 1 Based on comments, I came to the following approach: DynamicModule[ {nn, tn, dist, dataAll, data, dx, func, wave, f}, ColumnForm[{ Button["New data", dataAll = RandomVariate[dist, 2000]; data = Take[dataAll, nn]; func = CalcG1[wave, data, 0, Ceiling[Log2[nn] - Log2[Log2[nn]]]]; f = func[tn]; ], PopupMenu[Dynamic[wave, ... 1 Your code for your model is wrong. As others are saying, your forcing function is$\cos(\omega t)\$. Therefore, you simply use NDSolve to obtain solution. eq =theta''[t] + b/(m L0^2) theta'[t] + g/L0 Sin[theta[t]] -T0 Cos[w t]/(m L0^2); ic = {theta'[0] == Pi, theta[0] == 1}; b = 0.22; m = 1; L0 = 1; g = 9.8; w = 1; T0 = 1; sol = First@NDSolve[{eq == 0, ic}, ...