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


8

You've already done the hard work in putting the path together. Now you could just do a quick and dirty interpolation and FindRoot. rex = Interpolation[Thread[{Range@Length@pathre, First /@ pathre}]]; rey = Interpolation[Thread[{Range@Length@pathre, Last /@ pathre}]]; imx = Interpolation[Thread[{Range@Length@pathim, First /@ pathim}]]; imy = ...


8

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

1) The Clear function starts with an uppercase C; in general all built-in functions in Mathematica start with an uppercase letter. 2) Generally speaking it's good practice not to start your own variable names with uppercase letters to avoid confusion. In particular, it's a good idea never to have single-letter uppercase symbols. These can generate sneaky ...


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


5

Just for fun: in the following the complex plane (reflected through the line of identity) is plotted with variation in parameter a. The red points show behviour of roots with a and the colored lines are the desired plots using the horizontal axis as a (as well as the Imaginary axis): sol[a_] := x /. NSolve[ 1/4 (x^4 + 3^4) + (9/2 + 0.5^2 - 1) x^2 + 2 ...


5

A few of your points in the im list seemed to be wrong. I couldn't fully reproduce your plot. After removing those I did: pathreInt1 = Interpolation[pathre[[All, 1]]]; pathreInt2 = Interpolation[pathre[[All, 2]]]; pathimInt1 = Interpolation[pathim[[All, 1]]]; pathimInt2 = Interpolation[pathim[[All, 2]]]; pathreInt1["Domain"] (* {{1., 51.}} *) ...


4

Perhaps this is close enough? Graphics`Mesh`FindIntersections[{Line@re, Line@im}] (* {{0.436215, 0.512333}} *)


4

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


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


3

Here is a Fred Flintstone method. (1) To create a list of prime numbers: plist = Table[Prime[k], {k, 10, 15}] which outputs {29, 31, 37, 41, 43, 47} (2) To solve the equation use n = k x where k is an integer: Solve[(( 2 k + 3 ) x + \[Epsilon])/(3 x y - \[Epsilon]) == GoldenRatio,y] which provides {{y -> (6 x + 4 k x + 3 \[Epsilon] + Sqrt[5] ...


3

Let's look at using Reduce on your problem. First we will define your function p[t], then assign parts of your problem to a couple of variables to make this easier to see and finally try using Reduce to see when the sign of your expression will be negative. Note: Your p[t] doesn't depend on t. Is this perhaps a typo or did you mean something different? ...


3

Fixing the 0.5, which was asking for trouble (don't feed approximate numbers to exact machinery), and then telling it Quartics->False sols = x /. Solve[1/4 (x^4 + 3^4) + (9/2 + (1/2)^2 - 1) x^2 + 2 x (a - 10 I) + 9*(1/2)^2 - (a - 10 I)^2 == 0, x, Quartics -> False] {Root[490 + 80 I a - 4 a^2 - 80 I #1 + 8 a #1 + 15 #1^2 + #1^4 &, 1], ...


2

Try clearing the variables first, for example: Clear[a, b, x, y]; The result in the question can be reproduced exactly by evaluating a = (x + y)^20 // Expand; Solve[x^2 + a x + b == 0, x] and the package example notebook ToMatlabExamples.nb does contain such an assignment to a -- most likely it has been evaluated in the same kernel session before ...


2

What you are doing wrong is not paying attention to the form NSolve uses for returning results. Do it in three steps. First evaluate the your NSolve assigning the results to a variable. Do not end this assignment with a semicolon (;) -- you need to see the results. Next transform the results expression into a list of values. Finally apply Max to the list of ...


2

1) Use SetDelayed (:=) for function definition, Set (=) for constants. 2) Don't use a pattern (_) in evaluation of the function. ClearAll["Global`*"] RD = 4700 RE = 10000 RL = 10000 kN = 0.001 vDD = 10 vTN = 1 U[x_] := 0.5*(1 + Tanh[x/(10^-5)]) iD[vGS_, vDS_] := (1 - U[vTN - vGS]) (1 - U[vDS - (vGS - vTN)]) kN ((vGS - vTN) vDS - (vDS^2)/2) + ...


2

You can numerically solve this with n = 10; k1 = 0.5; k2 = 2; interpol = NDSolve[{a'[t] == (0.5/(1 + (b[t]/k1)^n)) - 0.2*a[t], b'[t] == (1/(1 + (a[t]/k2)^n)) - 2*b[t], a[0] == b[0] == 0}, {a, b}, {t, 0, 120}] That produces an interpolating function called interpol. You can plot parametrically as ParametricPlot[Evaluate[{a[t], b[t]} /. interpol], {t, ...


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



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