Tag Info

Hot answers tagged

9

Maple's fsolve missed one real root. You can see that by using solve with AllSolutions options restart; eq:= -x^2 + 2*x + 5 + (x^2 + 2*x - 1)* sqrt(2 - x^2)=0; solve(eq,x,'AllSolutions'): evalf(%); #pick the non-complex roots select(type,[%],numeric); So this is wrong: fsolve(eq,x,real) # -1.000000000 And Mathematica is correct: ...


7

Yes, it is documented that the result of Reduce[expr, vars] always describes exactly the same mathematical set as expr, i.e. the result of the reduction is equivalent to the original system. Another way to state the above is In[1]:= s1 = c > 0 && ((d <= -2 - c && a > 0 && b > (-c - d)/a) || (-2 - c < d ...


7

It turns out Solve[] has a feature that doesn't appear in the online documentation that I could find. A third argument can be added, a list of variables to be eliminated from the solution: Solve[eqns == 0, {c3, c4}, {a1, a2}] This yield the same output as above. And I have tested it on problems where solving for a1 and a2 (in order to eliminate them ...


7

Why not take a suitable Mathematica comand literally? Let y as a function of x be given by y = x^x (1 - x)^(1 - x); Aren't we just looking for x as a function of y? So let's simply write down what we want xx = InverseFunction[#^# (1 - #)^(1 - #) &]; This function gives the symbolic solution the OP asked for. Indeed, we can take values ...


5

Just for variety, but as Nasser has illustrated this is dealt with well with well with Solve and NSolve specifying Reals domain (and I have upvoted his answer). You can use root approximations from Mesh points of plot of points to inform FindRoot. You can find roots of polynomial within domain $\sqrt{2}<r<\sqrt{2}$. The plots are very helpful ...


4

By default FindRoot uses the "LineSearch" method of step control as described in the tutorial tutorial/UnconstrainedOptimizationLineSearchMethods. The default settings are FindRoot[Exp[1 - x] - 1, {x, 10.}, Method -> {"Newton", "StepControl" -> {"LineSearch", "CurvatureFactor" -> Automatic, "DecreaseFactor" -> 1/10000, ...


4

One can use GroebnerBasis to eliminate variables, and it is set up in a way that tends to be more efficient than Eliminate (which may be using some dated technology). polys = {-a[1] - 2 a[2] c[1] - 3 a[3] c[2] - 4 a[4] c[3], 1 - a[1] c[1] - 2 a[2] c[2] - 3 a[3] c[3] - 4 a[4] c[4], 2 c[1] - a[1] c[2] - 2 a[2] c[3] - 3 a[3] c[4] - 4 a[4] c[5], 3 ...


4

Just to complement the topic: Solve[ Eliminate[eqn == 0, {a1, a2}], {c3, c4}]


4

You can use a plot to find the roots and then follow up with FindRoot to get precise solutions. Here I'll use ContourPlot to plot where the real part vanishes and use MeshFunctions to find where the imaginary part is simultaneously zero. cp = Show[ Table[ ContourPlot[ Evaluate[Re[WhittakerW[1, (I α)/2, 10] /. α -> a + b I] == 0], {a, a1, a1 ...


4

This can actually be solved analytically (DSolve), noting it is only algebraic in t: urt[r_, t_] = Simplify[(u /. First@DSolve[{kh t D[u[r], r] - 2 Pi a u[r] + 2 Pi a == 0, u[302] == 21/100}, u, r])[r]] 1 - 79/100 E^((2 a Pi (-302 + r))/(kh t)) Plot3D[urt[r, t] /. {kh -> 10^-6, a -> 300}, {t, 10, 200}, {r, 298, ...


4

Here is the implicit equation satisfied by (y,z). ratpolys = {z - (1 - t)^2 (-2 t^2 + 4 t + 1)/(2 (2 t^2 - 2 t + 1)), y - (t - 1) *Sqrt[1 - t^2]*(t^2 - 3 t + 1)/(2 t^2 - 2 t + 1)}; gb = First[ GroebnerBasis[ratpolys, {y, z}, t, MonomialOrder -> EliminationOrder]] (* Out[93]= -135 y^4 - 1728 y^6 + 1024 y^8 - 720 y^4 z + 1536 y^6 z - ...


4

Clear[m, n, c, d]; c = (m == 1 && n >= 0 && ((-1 + 3^n m)/(-1 + 2^n m) - (3^n)/(2^n)) > ((-1 + 3^(n + 1) m)/(-1 + 2^(n + 1) m) - (3^(n + 1))/(2^(n + 1)))); d = (n >= 0 && ((-1 + (3^n))/(-1 + (2^n)) - (3^n)/(2^ n)) > ((-1 + (3^(n + 1)))/(-1 + (2^(n + 1))) - (3^(n + ...


3

I think in the latest revision there may be missing a PatternTest (or ?): In[4]:= Clear[p30]; p30[vSysInput_?NumberQ] := Module[{eq2A, p, t, rGas, Tgas, vSys, parms, sol}, eq2A = p'[t] == rGas Tgas/vSys (-0.64*0.0012 p[t]); parms = {rGas -> 8.3144, Tgas -> 273, vSys -> vSysInput}; sol = ...


3

Elvira, I am going to put here what I had put together for an answer to your question. There is still something puzzling about your question though, and that is the fact that you are essentially recalculating the same integral twice, it seems to me. Here is what I mean: $$\text{firstIntegral}=\int_{x1}^{x2} \! f(x) \, \mathrm{d}x $$ Then you are looking ...


3

Method 1 You can reverse the value of {x,y} to {y,x}, and then interpolate them. Note:In this case, the value of $y$ cannot be duplicate lst= {{3.61648, 5.64818}, {7.53428, 4.52803}, {4.21088, 2.35117}, {4.48224,1.08325}, {4.63735, 5.5877}, {2.24299, 3.10376}} x = Interpolation[Reverse /@ data]; x[3.] 2.44086 Method 2 If the the values of $y$ ...


2

This question is nearly a duplicate of Behavior of Reduce with variables as domain but since it is being addressed separately I shall answer here as well. In the documentation for version 7 (which I used for an extended time) it starts with: In version 8 this was changed to a domain specification, but where distinguishable the older syntax still works. ...


2

Yes, if you include the intermediate variables in the Solve list then Mathematica will try and find solutions for those as well: sys = {{c1, c2}, {c1, c3}, {c1, c4}, {c2, c3}}.{a1, a2} == {5, 2, -4, -3}; Solve[sys, {c3, c4, a1, a2}] Gives: {{c3 -> 1/5 (3 c1 + 2 c2), c4 -> 1/5 (9 c1 - 4 c2), a1 -> 5/(c1 - c2), a2 -> -(5/(c1 - c2))}}


1

f1, f2, and f3 are not equations themselves, but from what you show I think that you want to find roots to those expressions. In that case, FindRoot can do that VERY fast (I am using your definitions of f1, f2, f3): solutions = FindRoot[{f1 == 0, f2 == 0, f3 == 0}, {{x, 1*^60}, {y, 1*^60}, {z, 1*^60}}, MaxIterations -> 1000] (* Out: {x -> ...



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