Tag Info

New answers tagged

0

Starting with bbgodfrey's excellent suggestion to solve ab == ac == bc == 0, we can obtain a fairly compact list of all of the solutions by Reduce-ing ab == 0, ac == 0, and bc == 0 separately and then combining the conditions. Reduce each equation separately: conds = LogicalExpand /@ FullSimplify[Reduce /@ Thread[Simplify@{ab, ac, bc} == 0]]; Combine the ...


0

Edited to simplify and expand results It is not difficult to show that the three eigenvalues, w, of M are equal if and only if M is diagonal; i.e., ab = ac = bc =0. f[e_] := 2 Norm[e]^-3 (1 - 3 Sin[θ]^2 Cos[ϕ - ArcTan[e[[1]], e[[2]]]]^2) Cos[{x, y}.e] ab = f[{1, 0}] (* 2 Cos[x] (1 - 3 Cos[ϕ]^2 Sin[θ]^2) *) ac = f[{0, 1}] (* 2 Cos[y] (1 - 3 Sin[θ]^2 ...


2

It has been noted a fair number of times on this site that one can use the MeshFunctions option of Plot[] to help in root-finding. Applied to this case: ie[x_] := Im[Exp[1/2 + I x]] iz[x_] := Im[Zeta[1/2 + I x]] pic = Plot[{ie[x], iz[x]}, {x, 0, 20}, Mesh -> {{0.}}, MeshFunctions -> {(ie[#] - iz[#]) &}, MeshStyle -> ...


1

You can use Rationalize to convert numbers to exact numbers gammaex = 0.2506 // Rationalize[#, 0] &; omega[t_] = 2.43163218375*10^7*Exp[1700*(1/298.15 - 1/(273.15 + t))] // Rationalize[#, 0] &; w[t_] = (3.414105049212413*10^12)/(omega[t]) // Rationalize[#, 0] &; v[t_] = Sqrt[661.6469313477045*(t + 273.15)] // Rationalize[#, 0] &; ...


0

Some additional progress can be made to Solve these equations. Begin with the first three lines from the Question. s = ((1 + m*r^2 + f*r^4 + g*r^6)/(1 + h*r^2 + n*r^4 + j*r^6)); c1 = c == a*s + 2*k*a*b + l*(r^2 + 2 a^2); c2 = d == b*s + k*(r^2 + 2 b^2) + 2*l*a*b; and Simplify them a bit with {c1, c2} /. Equal[z1_, z2_] :> Equal[Collect[(z2 - z1) // ...


6

As Guesswhoitis already suggested, this is a machine precision issue. So let us do your computation with arbitrary precision numbers. For doing so, all machine numbers have to be replaced with arbitrary precision numbers, otherwise the computation falls back to machine numbers. In the following command I have done this by placing `30 after each machine ...


2

This is an incomplete answer, but we will be able to show that there is no solution for most values of θ and ϕ. We will also be able to draw a plot of the regions of interest that you should check further to find solutions, should they exist. M = {{s - w, ab, ac}, {ab, s - w, bc}, {ac, bc, s - w}}; {d, c, b, a} = CoefficientList[Det[M], w]; disc = ...


3

This problem is more related to physics other than Mathemaitca. The solution isn't wrong and special care should be paid when analysing dimensions in logarithm. "Inconsistancy" of the dimensions in logarithm is quite common and necessary in physics. Let's take a naive example to illustate the "inconsistancy": $$\int \frac{1}{x} dx$$ Everyone knows that ...


3

Your problem is the Set. Set means you're assigning something to a variable (=), x2 Sin[x2] is not a variable. Try Equal[] instead, this is equivalent to ==. Vars = {{(x1) Cos[x2], Sin[x2], 0, (x3) (Sin[x2])}, {(Cos[x2]) (Sin[x4]), (x3) Cos[x4], 1, x1}}; Const = {{1, 0, 0, 1}, {0, 1, 1, 2}}; MapThread[Equal, {Vars, Const}, 2] yields the output: {{x1 ...


1

Your definition of c and d are not related to any other variables, so the system is fundamentally underdetermined as you have written it. It is as if you wrote $$c = a + x, \quad d = b + y, \quad r^2 = a^2 + b^2,$$ and you want to solve for $a,b$. Moreover, you have a syntax error, which is why Mathematica will not complete the evaluation. The == symbol ...


4

The purpose of this answer is to give simple, clear answers to the simple component questions, How to draw an infinite tangent line? How to draw an infinite secant line? I will use the V10+ InfiniteLine, which Mr.Wizard has already pointed out as a way to draw an infinite line. See also the Note below. How to draw a tangent line Round about the eighth ...


0

Try Simplify[..., Assumptions -> { rho > 0, r > 0 ,....}] or Assuming[ {rho >0, r > 0, ...}, Simplify[...] ] NOT Simplify[..., rho > 0, r > 0, ...]


0

For your physical problem the condition t > 0 is appropriate. I would simply inform NSolve of that condition. NSolve[ t > 0 && 270. == 400. E^(-0.3 t) (0.0580357 - 0.870536 E^(0.28 t) + E^(0.3 t)), t] {{t -> 49.2642}}


2

First of all, note the difference between = (assignment) and == (equality). Take a look at NSolve examples which all use ==. NSolve is limited in what sorts of equations it can solve, but when it can solve an equation, it will try to get all solutions. The result it gives you is a fairly general one, and it's valid for any C[1] that is an integer. If you ...


2

You have to use Equal (==) instead of Set (=) for the equation and add Reals as a third argument to NSolve to restrict all variables, parameters, and function values to be real NSolve[270 == 399.99999999999966 E^(-0.3 t) (0.058035714285714336 - 0.8705357142857142 E^(0.27999999999999997 t) + E^(0.3 t)), t, Reals] {{t -> -8.31446}, {t -> ...


5

Since "Visualizing the resulting triangle is left as an exercise for the interested reader" and I am interested here is a visualization of J.M.'s numeric solution. DynamicModule[{corners, perimeter, sol, u, v, pts}, Manipulate[ corners = {{-c, 0}, b {(1 - u^2)/(1 + u^2), 2 u/(1 + u^2)}, a {(1 - v^2)/(1 + v^2), 2 v/(1 + v^2)}}; perimeter[u_, v_] = ...


6

Update Based on Guesswhoitis. answer I have improved my ugly code and use his approach. Otherwise the format is as outlined in original answer. Manipulate[p = {-a, 0}; q = {0, b}; r = {c, 0}; s = mp[a, b, c]; nfb = RegionNearest[Circle[{0, 0}, b]]; nfc = RegionNearest[Circle[{0, 0}, c]]; res = VectorAngle @@@ Partition[Join[{{-a, 0}}, sc[#] & /@ ...


2

We can use FindAllCrossings[] to find the roots of $\Re\left(\zeta\left(\frac12+i t\right)\right)$ like so: FindAllCrossings[Re[Zeta[1/2 + I t]], {t, 10, 30}, WorkingPrecision -> 20] {14.134725141734693790, 14.517919628262233651, 20.654044969367919453, 21.022039638771554993, 25.010857580145688763, 25.491508214625488621, 29.738510300151580038} ...


21

I've decided to expand on my comment. Before I delve into the solution, let's all pause for a moment and marvel at the stereographic parametrization of a unit circle: $$\begin{pmatrix}\frac{1-t^2}{1+t^2}\\\frac{2t}{1+t^2}\end{pmatrix}$$ Sometimes also referred to as the Weierstrass substitution, it has often been used as a tool in the solution of algebraic ...


1

You can extract roots from a Solve command using the replacement operation /.: xroots[n_]:= Solve[LegendreP[n, x] == 0] roots[n_]:= x /. xroots[n] Your Product call combined with an If condition, as suggested in the comment above, should do the trick. w[i_, x_] := Product[ If[i==j,1, (x - roots[n][[j]])/(roots[n][[i]] - roots[n][[j]]) ] ,{j,1,n}]


22

Working off of m_goldberg's idea, we can make it look a little nicer by using $Pre and $PrePrint to make equations behave as lists but still display as equations: CASViewOn[] := ( $Pre = If[Head[#] === Equal, List @@ #, #] &; $PrePrint = If[Head[#] === List, Equal @@ #, #] &; ); CASViewOff[] := ( $Pre =.; $PrePrint =.; ); Now we can do ...


0

For a finite range of interest, NSolve works well f[x_] = BesselJ[1, x]^2 + BesselK[1, x]^2 - Sin[Sin[x]]; Manipulate[ Module[{sol}, Column[{ sol = NSolve[{f[x] == 0, 0 <= x <= xmax}, x], Plot[f[x], {x, 0, xmax}, Epilog -> {Red, AbsolutePointSize[6], Point[{x, f[x]} /. sol]}, ImageSize -> 360]}]], {{xmax, 16}, 1, ...


2

And we Go: ClearAll[b, c, k, x, t T0]; SOL = First @ Assuming[{b, c, k, T0} ∈ Reals, DSolve[{x'[t] == b x[t] - (c - x[t])^2/(4 k), x[T0] == 0}, x[t], t]]; // Quiet FullSimplify[SOL] $\left\{x(t)\to 2 \sqrt{b} \sqrt{k} \sqrt{b k+c} \tanh \left(\frac{\sqrt{b} (t-\text{T0}) \sqrt{b k+c}}{2 \sqrt{k}}-\tanh ^{-1}\left(\frac{2 b k+c}{2 ...


0

Actually, Reduce produces the correct answer, although it is a bit slow: x > 16. (I assume that you really do want {a, b, c} to be restricted to the range {0, 1}, as indicated in the argument of Reduce.) Another way to look at the this problem is to ask for how {p1, p2} behave in this range of {a, b, c}. First, determine c such that p1 == p2 Solve[(p1 ...


2

...most of the solutions are for simpler functions... I'm not quite sure what gave OP that impression; certainly, FindAllCrossings[] is quite capable of handling transcendental equations, as long as all the roots being sought are simple. But first: I slightly tidied up the definition of f[] (e.g. by using auxiliary variables for common subexpressions), ...


25

I usually find it easier to do this kind of manual equation munging by first converting the equation to a list, carrying out the operations on the list (convenient because math operations thread over lists), and then converting back to an equation when done. Example List @@ 3 x + 8 == 16 {8 + 3 x, 16} % - 8 {3 x, 8} %/3 {x, 8/3} Equal ...


7

Alright, I managed to borrow a computer. Here's an implementation of my suggestion: ellipseIntersections[mat1_?MatrixQ, mat2_?MatrixQ] /; Dimensions[mat1] == Dimensions[mat2] == {2, 3} := {\[FormalX], \[FormalY]} /. RootReduce[Solve[Flatten[Map[ GroebnerBasis[Append[Thread[{\[FormalX], \[FormalY]} == #], ...


26

Yes, it has. This is your example equation: eq1 = 3 x + 8 == 16 (* 8 + 3 x == 16 *) Here is its TreeForm: TreeForm[eq1] As you see, there are two elements on the first level: eq1[[1]] eq1[[2]] (* 8 + 3 x 16 *) which are the left- and right-hand parts of the equation. Any equation in Mma has such a form, that is, left- and ...


3

Another Method with the hep of J.M.'s suggestion use GroebnerBasis[] to produce the implicit Cartesian equations of the two ellipses, and feed those equations to Solve[]. $$\begin{cases} x=a_1 \text{sin$\theta $}+b_1 \text{cos$\theta $}+c_1 \\ y=d_1 \text{sin$\theta $}+e_1 \text{cos$\theta $}+f_1 \\ \end{cases}$$ $\Rightarrow$ $$ ...


4

As said in the comment by J.M, with the help of Graphics`Mesh`FindIntersections However, this method with lose the tangent points newSolution[mat1_, mat2_] := Module[{graph, pts, start1, start2}, graph = ParametricPlot[ {mat1.{Sin[θ], Cos[θ], 1}, mat2.{Sin[θ], Cos[θ], 1}}, {θ, 0, 2 Pi},Epilog -> {Point[{.1, .2}]}]; start1 = ...


2

Actually since version 9 there is ParametericNDSolve and NDSolveValue which both make the mentioned idiom even more attractive and doesn't even need the pattern matching you are struggling with: model = Module[{x, y, a, t}, ParametricNDSolveValue[ {a*(y'[x] t - y[x]) == 7, y[0] == 0}, y, {x, 0, 1}, {a, t} ] ] data = {#, model[0.5, 0.6][#] + ...


1

It is enormously faster to use x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] Then, given the space of roots for Im[x] DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}], SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0 || z > 50, Infinity] finds all positive roots less than 50 (* {1.42102, ...


2

The function checks if the input is a number (NumberQ), otherwise it prints out an error. The function is only defined if the input is a number. Please check this alternate example: f[x_?OddQ] := "Here the function is defined for an odd number"; f[3] But the function it is not defined for an even number: f[2]


5

Just to summarize my understanding: First of all, the documentation states that Simplify assumes that variables are real when they occur algebraically in inequalities. Clearly, there are no inequalities in the logical expression y == 0 && x^2 == -1, and therefore x and y should be assumed to be general complex numbers. If they were real, then the ...


1

Some progress can be made using Eliminate. Eliminate[ h1*w1 == c1 && h2*w2 == c2 && h3*(1 - w1 - w2) == c3 && h1*h2*y12 == c12 && -h1*h3*y11 - h1*h3*y12 == c13 && -h2*h3*y22 - h2*h3*y12 == c23 && h1^2*y11 + y0 == c11 && h2^2*y22 + y0 == c22 && h3^2*(y11 + y22 + ...


3

Without using SolveAlways, you can use ForAll and Resolve. Resolve[ForAll[x, a x + b == 0]] (* a == 0 && b == 0 *) You might find this tutorial on Quantifiers quite useful.


2

My initial response would have been that a number that is not positive or zero, and that is only negative if certain conditions are met, may still be complex if those conditions are not met. In that case it is neither zero nor positive, nor negative. So, let's see whether we can find an example of a parameter set that makes the last condition false while ...


2

Although this is not an answer to the question as put, the problem can be solved completely with Mathematica as follows. This is also a hint to try alternative formulations in mathematica if a specific one does not succeed. Assuming, of course, that the problem is in the center of interest. The easiest way to obtain the values of a[n,m] is to start with ...


1

I will not answer the failure of in-built functions but present an alternative approach: f[m_, u_] := With[{r = {{-1, 0}, {0, -1}, {-1, -1}}}, ReplacePart[m, u -> Total[(Extract[m, u + #1] &) /@ r]]]; sa[m_, n_] := Module[{s, p}, s = Normal@SparseArray[{{i_, 1} -> 1, {1, j_} -> 1}, {m, n}, "x"]; p = Position[s, "x"]; Fold[f[#1, #2] ...


1

I may have misunderstood. My interpretation is trying to find (orthogonal) basis vectors for a plane given a normal. Obviously there are an infinite number. This is rather ugly but: vec = {1, -1, -1}/Sqrt[3]; bas1[x_, y_] := Normalize[{a, b, c} /. First@Quiet[Solve[vec.{a, b, c} == 0, {a, b, c}]] /. {a -> x, b -> y}]; bas2[x_, y_] := ...


1

As said in the comment, the number of vectors $\vec{m},\vec{n}$ is infinite. Here, you can use the FindInstance to find some instances. Maybe this is you need rules= FindInstance[{{x, y, z}.{-1, 1, 1} == 0, {a, b, c}.{-1, 1, 1} ==0}, {x, y, z, a, b, c}, Integers, 5] { {x -> -148, y -> -43, z -> -105, a -> -220, b -> 47, c -> ...


1

There is, of course, no closed-form solution for the eigenvalues and eigenvectors of a 16 x 16 matrix (or, more generally, for the roots of an $n$th-order polynomial with $n > 5$.) So you're going to be stuck with numerical methods no matter what you do. The easiest way to create a graph of the eigenvalues as a function of W will be to define a function ...


2

Some more ways: Restricting the domain helps Solve out. Over a real interval: Solve[{x^5 - Sin[x] == 0, -1 <= x <= 1}, x] (* {{x -> 0}, {x -> Root[{-Sin[#1] + #1^5 &, -0.96103694149677306152}]}, {x -> Root[{-Sin[#1] + #1^5 &, 0.96103694149677306152}]}} *) Over a complex rectangle: Solve[{x^5 - Sin[x] == 0, -1 <= Re@x ...


3

Try Reduce[x^5 - Sin[x] == 0, x, Reals] or if you want the two roots that are close to -1 and 1 you could do something like Table[FindRoot[x^5 - Sin[x] == 0, {x, i}], {i, {-1, 1}}]


6

Using your definition of eq, if you try Solve even without imposing conditions on ω, you obtain the following error: Solve[eq[1, ω] == 0, ω] Solve::inex: Solve was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Solve ...


1

If you already know the interval on which you want to find one of your solution, you may use the instruction FindRoot[f[x]==0,{x,xmin,xmax}] Here, Mathematica will use Brent's algorithm (a combination of the bisection and secant methods) restricted to the interval [xmin,xmax]. With the example FindRoot[Sin[x]==0, {x, .1, 10}] where one searches for a ...


3

Just post as another method. Considering the two parametric equations are polynomials,we can obtain the implicit equation by eliminate the parametric $t$. Using the function GroebnerBasis. f[x_, y_] := Evaluate@GroebnerBasis[{x - (162/10 - 7 t + t^2), y - (13 t - 2 t^2)}, {t, x, y}][[1]]; g[x_, y_] := Evaluate@GroebnerBasis[{x - (26 - 131/10 t ...


0

To see why this happened, we can firstly factor the polynomial in $\mathbb{Q}$. Factor[x^16 + x^3 + x + 1] (1 + x) (1 - x + x^2) (1 + x - x^4 + x^7 - x^10 + x^13) So -1 is a real root. The roots of 1 - x + x^2 are complex, now we consider the last polynomial. We need The Fundamental Theorem of Algebra: Every $f\in\mathbb{R}[x]$ of odd degree has ...


1

Clear[v0, v, dist, t, a, vInit, vFinal]; dist = Quantity[700, "Meters"]; t = Quantity[30, "Seconds"]; a = Quantity[.05, "Meters per second^2"]; vInit = NSolve[dist == v0*t + 1/2 a*t^2, v0][[1]] {v0 -> Quantity[22.5833, ("Meters")/("Seconds")]} Put the ReplaceAll inside of the NSolve (in both instances you could use Solve rather than NSolve). vFinal = ...


1

According to Mathematica Documentation, Root[f,k] gives the $k^{th}$ root of the polynomial function f[x]==0. Try to see if you get the numerical values with the following: sol=Solve[x^16+x^3+x+1==0,x,Reals] N[sol]



Top 50 recent answers are included