Tag Info

Hot answers tagged

25

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


22

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


19

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


17

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


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]} == #], ...


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


4

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[#] & /@ ...


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


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


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.


3

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_] = ...


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


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]


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


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


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


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

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


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



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