Tag Info

New answers tagged

5

Many times I've found Mathematica to be way better solving equations, when trigonometric functions are written with exponential functions. This time is no exception: Solve[FullSimplify[TrigToExp[-2 (m^2/36 + n^2/4)^(1/4) Sin[1/2 ArcTan[n/2,-(m/6)]]==y]],n] {{n -> (m^2 - 9 y^4)/(18 y^2)}}


1

Evaluate[Array[a, 6, 0]]= {1, 0, 0, 0, c, 0}; eqns = Table[ a[n] == Sum[(m - 2) a[m] b[n - m], {m, 0, n}], {n, 0, 5}]; Solve[eqns, Array[b, 6, 0]]` {{b[0]->-(1/2),b[1]->0,b[2]->0,b[3]->0,b[4]->-c,b[5]->0}}


2

a[0] = 1; a[1] = a[2] = a[3] = a[5] = 0; a[4] = g2/20; funcs = Table[a[n] == Sum[(m - 1) a[m] b[n - m], {m, 0, n}], {n, 0, 5}] var = b /@ Range[0, 5] Solve[funcs, var]


2

Something like this: ComplexExpand[ Solve[ { Re[(1 - Sqrt[x - I y])/(1 + Sqrt[x - I y])] == A, Im[(1 - Sqrt[x - I y])/(1 + Sqrt[x - I y])] == B }, {A, B} ], TargetFunctions -> {Re, Im} ] (* {{A -> 1/((1 + (x^2 + y^2)^(1/4)*Cos[(1/2)*ArcTan[x, -y]])^2 + Sqrt[x^2 + y^2]*Sin[(1/2)*ArcTan[x, -y]]^2) - ...


1

"Is there a way to get Mathematica to do such substitutions on its own?". The answer to this question is: yes. Just use Solve and exact numbers. Solve[{ (5 - k) (2940/100) == tl1^(3/10), (5 - k) (3150/100) == tl2^(3/10), 4200 tl1^(7/10) + 4500 tl2^(7/10) == 1000000}, {k, tl1, tl2}, Reals] // N {{k -> 4.74961, tl1 -> 776.036, tl2 ...


1

Get this code working You can get the code running under Mma v9, by adding options to Solve: Adding VerifySolutions -> False should work. And also VerifySolutions -> True, WorkingPrecision -> MachinePrecision works on my PC, if res isn't too big. For bigger res (tested for 50) VerifySolutions -> False, WorkingPrecision -> ...


1

TraditionalForm@FullSimplify@Exp[FullSimplify@PowerExpand[ Log[((Ft Bcr)^(2 p + 4)*Ft^(23 p - 4))/(Bcr^(1/(2.5 p - 4))* Ft^((24 p + 4)/(3 p - 1)))^(3 p - 6)]]] $\text{Ft}^{p+\frac{60}{3 p-1}+36} \text{Bcr}^{-\frac{1.2}{4.\, -2.5 p}+2. p+2.8}$


0

From your error message it appears that something is wrong with your definition of y. Using the code in your question and entering: y[288, 1520, 0.0186, 0.1, 10, 30, 1.21] Returns: {{x -> 303.595}} Which allows: x /. y[288, 1520, 0.0186, 0.1, 10, 30, 1.21] {303.595} This was confirmed in both version 7 and version 10 under Windows. If ...


1

Because s[t] is decreasing whenever p < 1, s[t] - myPreviousStep < 10^-4 will always be True. WhenEvent[cond, action] evaluates action when the condition changes from False to True; however, the condition is always True when p < 1. You need something like Abs[s[t] - myPreviousStep] < 10^-4, instead. Note that if p is closer to 1 than 10^-4, ...


3

Reduce has its own syntax for specifying constrains and domains. Please try this: Reduce[2*a*b*n*c*Q - 3*a*b*n*p*c*Q + a*b*n*p^2*c*Q - 4*a^2*b*n*p*Q^2 - 4*a*b^2*n*p*Q^2 + 6*a^2*b*n*p^2*Q^2 + 6*a*b^2*n*p^2*Q^2 - 2*a^2*b*n*p^3*Q^2 - 2*a*b^2*n*p^3*Q^2 + a^2*b*c*Q^2 + a*b^2*c*Q^2 - 2*a^2*b*p*c*Q^2 - 2*a*b^2*p*c*Q^2 == 0 && 0 < a ...


2

Funny problem. I like it. But there is must be something else in the condition of the problem? Or I misunderstand you. You say that I am guaranteed that w1, w2 exist Ok. Let's set v1 = {0, 0, 0, 1}; v2 = {1, 0, 0, 0}; it's independent vectors. Then find w1 and w2 in general case for this example: w1 = v1*a1 + v2*b1 w2 = v1*a2 + v2*b2 ...


3

Please check the result by doing the following eqn = FullSimplify[ 2*a*b*n*c*Q - 3*a*b*n*p*c*Q + a*b*n*p^2*c*Q - 4*a^2*b*n*p*Q^2 - 4*a*b^2*n*p*Q^2 + 6*a^2*b*n*p^2*Q^2 + 6*a*b^2*n*p^2*Q^2 - 2*a^2*b*n*p^3*Q^2 - 2*a*b^2*n*p^3*Q^2 + a^2*b*c*Q^2 + a*b^2*c*Q^2 - 2*a^2*b*p*c*Q^2 - 2*a*b^2*p*c*Q^2 == 0] // TraditionalForm This returns ...


0

You should define your functions outside of the Manipulate so the definitions aren't reevaluated each time the slider is moved. In doing this, you'll need to make g and U explicitly depend on ρ. g[e_, ρ_] := { {e, ρ, 11}, {1, e, ρ}, {1, 1, e} }; U[e_, ρ_] := Transpose[Eigenvectors[g[e, ρ]]] . { {0, 0, 1}, {0, 1, 0}, {1, 0, 0} }; Next it ...


0

I would suggest: Try to write your function definition outside of the Manipulate, but in dependence of the changing parameter, like so: g[ρ_, e_] := ( {{e, ρ, 11}, {1, e, ρ}, {1, 1, e}} ); U[ρ_, e_] := (Transpose[Eigenvectors[g[ρ, e]]]).( { {0, 0, 1}, {0, , 0}, {1, 0, 0}} ); And than inside the Manipulate use this function definition: Manipulate[ ...


3

Plot[2 x - Sinh[x], {x, -Pi, Pi}] FindRoot[2 x == Sinh[x], {x, #}] & /@ {-2, 0, 2} {{x -> -2.17732}, {x -> 0.}, {x -> 2.17732}}


0

Bob, this is the solution that I got: Clear[a, b, c, d, x, y] With[{a = 1, b = 2, c = 3, d = 4}, eqn = Exp[-a Exp[-x/b] - c Exp[-x/d]] == y // Simplify; sol = Solve[eqn, x]] Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >> Assuming[Element[{C[1], C[2]}, ...


1

This is really a comment, but for ease of reading... Adjusting your code slightly, we note some useful information: Remove["Global`*"] L3 = 2 c1 + 4 c2 + Sqrt[24 c1^2 + 16 c1 c2 + 16 c2^2]; L4 = 1/2 (4 c1 + 8 c2 - 2 Sqrt[24 c1^2 + 16 c1 c2 + 16 c2^2]); soln = Solve[{L3 == K3, L4 == K4}, {c1, c2}]; {L3, L4} /. First@soln // Simplify (* {1/2 (K3 + Sqrt[(K3 ...


0

You can gain more insight by looking at the symbolic form of the solutions Remove["Global`*"] L3 = 2 c1 + 4 c2 + Sqrt[24 c1^2 + 16 c1 c2 + 16 c2^2]; L4 = 1/2 (4 c1 + 8 c2 - 2 Sqrt[24 c1^2 + 16 c1 c2 + 16 c2^2]); Solve[{L3 == K3, L4 == K4}, {c1, c2}]; Set @@@ %[[1]]; FullSimplify[{{L3, K3}, {L4, K4}}] FullSimplify[{{L3, K3}, {L4, K4}}, Assumptions -> ...


1

Without making assumptions on the parameters except that they are real, one easily observes that the original equation is equivalent to the following: eq1 = -a E^(-(x/b)) - c E^(-(x/d)) == f where (* f = Log[Y] *). With the exchange: eq2 = eq1 /. x -> -b*Log[y] one obtains this: (* -a y - c y^(b/d) == f *) By rescaling y -> A*z: eq3 ...


0

Noticing that for the general equation of an ellipse $$a x^2+b y^2+c x y+d x+e y+f=0$$ we have $$c=0$$ if it's axis-aligned. For the general equation of an axis-aligned ellipse $$a x^2+b y^2+d x+e y+f=0$$ we have $$d=e=0$$ if it's centered. So this problem can be solved like this: exp1= -1.43328 - 0.281261 x + 0.00228797 x^2 - 0.832702 y + 0.00138781 ...


0

Clear[a, b, c, d, x, y] Provided a, b, c, and d have appropriate numeric values, With[{a = 1, b = 2, c = 3, d = 4}, eqn = Exp[-a Exp[-x/b] - c Exp[-x/d]] == y // Simplify; sol = Solve[eqn, x]] Verifying that sol satisfies eqn under the given conditions: Assuming[Element[{C[1], C[2]}, Integers], eqn /. sol // Simplify] {True, True}


4

The equation is numerically unstable. The second root is not valid at machine precision so is rejected. Higher precision is required to arrive at a valid second root. Use Solve to see exact solutions as root objects. Then use higher precision when converting root objects to numbers. k = .2; eqn = Rationalize[2 r^2 - .2 r^(k + 2) - 1 == 0]; sol = Solve[eqn, ...


0

My approach, since BSplineFunction evaluates to a pair of numbers only when t is numeric, would be wrap the difference in a function protected by ?NumericQ: rooteq[t_?NumericQ] := First[k[0]] - First[f[t]] FindRoot[rooteq[t], {t, .5, 0, 1}] (* {t -> 0.674177} *) f[t] /. % k[0] (* {-4.93131, 2.99958} {-4.93131, 2.99958} *) The problem with the ...


2

Symbolically solve this equation: Solve[Tan[a Sqrt[α]]+Tan[(1-a) Sqrt[α]]==Sqrt[α]//TrigToExp,a] Solve[Tan[a Sqrt[α]]+Tan[(1-a) Sqrt[α]]==Sqrt[α]/.a->ArcTan[x]/Sqrt[α] //FullSimplify,x] Updated: expr=Tan[a*Sqrt[α]]+Tan[(1-a)*Sqrt[α]]-Sqrt[α]; expr=FullSimplify@ReleaseHold@Numerator@Together[expr/.Tan[x_]:>Sin[x]/Hold@Cos[x]] ...


1

Here we can see that the two sides, for r == 4. are not equal near 1.6: With[{i = 6}, Plot[pot[Er[[i]][[1]], x] - Er[[i]][[2]], {x, -0.3, 1.7}, PlotLabel -> Row[{"r = ", r[[i]]}]] ] Here we see it has no real solutions at all: With[{i = 6}, Reduce[pot[Er[[i]][[1]], x] - Er[[i]][[2]] > 0, x, Reals] ] Reduce::ratnz: Reduce was unable to ...


6

The following remarks are crucial when we are to solve equations symbolically: So far (in general) Mathematica cannot solve transcendental equations when two unknowns are involved, nevervetheless in some exceptional cases it may seem like it could (see e.g. How do I solve this equation?). This is also the case when some symbolic constants are involved ...


3

The Method option in LQOutputRegulatorGains is not documented yet and seems to be going through several iterations. This is what works for the different versions. v8: Method -> {"RiccatiSolveOptions" -> {Method -> "Eigensystem"}} v9: Method -> {"Riccati", {Method-> "Eigensystem"}} v10:Method ->{"Riccati"->{Method-> ...


3

Just a way to visualize by rearranging (noting Chenminqi 's observation). Uses: $tan(x)+tan(y)=sin(x+y)/(cos(x)cos(y))$. Limiting range important to avoid periodicity and singularities: cp = ContourPlot[ Sin[Sqrt[y]]/Sqrt[y] == Cos[(1 - x) Sqrt[y]] Cos[ x Sqrt[y]], {x, 0, 0.5}, {y, 0, 35}, FrameLabel -> {"a", "\[Alpha]"}, BaseStyle -> 20]; ...


4

Numerical solution: sol[a_] := {a, α} /. First@NSolve[ Tan[a*Sqrt[α]] + Tan[(1 - a)*Sqrt[α]] == Sqrt[α] && 5 <= α <= 35, α]} // Quiet ListLinePlot[sol /@ Range[0, 0.5, 0.01]] I don't know why ContourPlot doesn't work well,even though I change some options of ContourPlot.Maybe it is because there are some singular points. ...


1

thank you all for your suggestions. They have been very helpful. I concluded that by defining 2 functions, as in the following: x0 = {x -> 1}; f1[a_?NumericQ] := {x0 = FindRoot[x == E^(-a x), {x, x0[[1, 2]]}]}; f2[a_] := x /. f1[a]; I can Plot[f2[a],{a,0,2}] and obtain what I wanted. Now, moving on to my real problem. What I really want to do is ...


0

This is just another approach using NSolve rather than FindRoot. In the real domain this has a unique solution. g[a_] := Quiet[x /. First@NSolve[x == Exp[-a x], x, Reals]]; You can plot: Plot[g[u], {u, 1, 4}] Tabulating makes processing faster, e.g.: Manipulate[ Plot[{x, Exp[-p x]}, {x, 0, 3}, PlotRange -> {0, 1}, MeshFunctions -> (#1 - ...


0

I think you are trying too hard. If you make a simple change to the definition of equ, things will be much easier equ[a_?NumericQ, x0_?NumericQ] := FindRoot[x == E^(-a x), {x, x0}][[1, 2]] sol = 1; sols = Table[{a, equ[a, sol]}, {a, 1, 10, .5}]; ListPlot[sols, Joined -> True]


0

sol = {x -> 0}; sols = Table[sol = FindRoot[a x == 1, {x, sol[[1, 2]]}], {a, 1, 10}]; ListPlot[x /. sols] sol = {x -> 0}; equ[a_?NumericQ] := {sol = FindRoot[x == E^(-a x), {x, sol[[1, 2]]}]}; Plot[x /. equ[a], {a, 0, 2}] ListPlot[Flatten[Table[{a, x} /. equ[a], {a, 0, 2, .05}], 1]]


3

This gives the solution to the equation: temp = Solve[eqn[x, y, z], D[y[x, z], x]] This extracts the value of the rule: res = D[y[x, z], x] /. temp This evaluates the result at the requested coordinates: res /. {x -> 1, y -> 1, z -> 1} (* {9} *)


2

iter = Reap[FindRoot[Sin@x == Cos[x], {x, 0}, EvaluationMonitor :> Sow[x]]] {{x -> 0.785398}, {{0., 1., 0.782042, 0.785398, 0.785398}}} Length@Last@Last@iter - 1 4


2

Options[FindRoot] (* {AccuracyGoal -> Automatic, Compiled -> Automatic, DampingFactor -> 1, Evaluated -> True, EvaluationMonitor -> None, Jacobian -> Automatic, MaxIterations -> 100, Method -> Automatic, PrecisionGoal -> Automatic, StepMonitor -> None, WorkingPrecision -> MachinePrecision} *) ?? EvaluationMonitor (* ...


2

This does not solve the equation (in the following I just let $w=1$), of which there are infinite, but I hope provides insights. The surface of solutions is sectioned by desired x value. sol[g_, x0_] := Module[{p, l, sn}, p = g[[1, 1]]; l = Cases[g, Line[w___] :> w, Infinity]; sn = Select[p[[#]] & /@ l, #[[1, 1]] == x0 &]; ...


4

The problem here can arise because of numerical underflow which appears for sufficiently large dimension of the problem. Some numerically very small number multiplies the parameter "a" and therefore "a" does not appear in the "solution". Consider a simple example Define the matrix m (fill it with random numbers, here exponentially distributed) In[263]:= ...


5

There are a few problems with your code. Allow me to highlight them and guide you to a solution. First of all, the proper way to define a function in Mathematica is using :=. So your code should read F[x_] := NSum[Exp[-x BesselJZero[0, a]^2]/BesselJZero[0, a]^2, {a, 1, Infinity}] Furthermore, you should note that the zeroes of the Bessel function are ...


1

NSolve will most probably not lead to a solution. Here are some hints to nevertheless find numerical solutions: Use vars = list of left hand sides of the equations eqs. You easily notice that vars2 = vars.vars == 0 for w1 == 0, w2 ==0, ..., w8 == 0 (the trivial solution). Play around with Random[] to find non-trivial numerical solutions thus a = 5; r := ...


2

Clear["Global`*"]; f[rx_, ry_] := Module[{d1, d2, d3, a, b, c, sol1, sol2, data}, {d1, d2, d3} = # - {rx, ry} & /@ {{0, -1}, {Sqrt[3]/2, 1/2}, {-Sqrt[3]/2, 1/2}}; {a, b, c} = Norm[#]^-3 & /@ {d1, d2, d3}; sol1 = NSolve[a b (d2 - d1) Sin[{x, y}.(d1 - d2)] + b c (d3 - d2) Sin[{x, y}.(d2 - d3)] + a c (d3 - d1) Sin[{x, y}.(d1 ...


1

Below is something that works in V8.0.4. Apparently something in Solve was improved in V9, even though the docs indicate it was last modified in V8. theta = 0.1; phi = 0.1; a = 1 - 3 Sin[theta]^2*Cos[phi]^2; b = 1 - 3 Sin[theta]^2*Cos[phi - (2 Pi/3)]^2; c = 1 - 3 Sin[theta]^2*Cos[phi - (4 Pi/3)]^2; Chop @ N @ Solve[ TrigExpand @ Rationalize[ ...


4

Here is some preprocessing that might be useful. We will get rid of radicals "by hand", and eliminate variables using GroebnerBasis. The end result will be a single (complicated) expression in several variables. eqns = {x == (Etot - M - MI)/( Etot + 1/4 (Kd - Sqrt[Kd] Sqrt[8 Etot + Kd])), Etot == 2 Di + M + Inh M, Itot == Inh + MI, Kd == M^2/Di, ...


1

Clear["Global`*"] pts = {{1, 1}, {2, 3}, {3, -1}, {4, 1}, {5, 0}}; f1 = Interpolation[pts, InterpolationOrder -> 1]; f2 = BSplineFunction[pts]; Show[Graphics[{Red, Point[pts], PointSize[0.02], Point[f2 /@ {0.2, 0.4}], Green, Line[pts]}, Axes -> True], ParametricPlot[f2[t], {t, 0, 1}]] First,determine approximate range of t, in my example ...


3

ToRules is useful here. If we manually set a value to the parameter C[1], we can convert the remaining expression to a list of rules similar to what Solve would return: In[5]:= rules = {ToRules[sol /. C[1] -> 0]} Out[5]= {{phi -> -ArcCos[-(Csc[theta]/Sqrt[3])]}, {phi -> ArcCos[-(Csc[theta]/Sqrt[3])]}, {phi -> ...


1

Respecting generated conditions is important. In this particular equation (which could be solved by hand and the conditions are clear from the equation. You can access the solutions in a number of ways (e.g. using rules from Solve). Here is just one way: a = 1 - 3 Sin[theta]^2 Cos[phi]^2; sol = Reduce[a == 0, phi] solc = sol /. Equal[x_, y_] :> Rule[x, ...


3

I post this only for insights into solving this equation (given the discussion) and ambiguity of interpretation...and for fun. I have alread +1 Artes answer. f[x_] := Sqrt[x] + Sqrt[1 - x^2]; g[x_] := Sqrt[2 - 3 x - 4 x^2]; Note the domain that f(x)-g(x) is real valued. dom = Reduce[x > 0 && Abs[x] < 1 && 2 - 3 x - 4 x^2 > 0] ...


3

We can find the minimum-producing argument x as a function of n2 using NDSolve. We need only find an initial minimum and a differential equation for the trace of the minima. In fact, we can integrate the minimum value of eisl and return a single function that yields the minimum for each n2. Given that the parameters b,e0,g,gamma,p,epsilon`, are (constant) ...



Top 50 recent answers are included