Questions on the analytic and numeric equation solving functions of Mathematica (Solve, Reduce, NSolve, FindRoot, DSolve, RSolve, etc.).

learn more… | top users | synonyms (4)

8
votes
2answers
155 views

How to correct this, `f[a_] := FindRoot[eq == 0, {x, 0.5}]`, where `eq` contains a parameter $a$, without using `eq[a]`?

I want to solve an equation with a parameter $a$, and define the result as a function of $a$. It is something like this: ...
4
votes
1answer
1k views

Solve system of equations related to perspective projection

I'm trying to solve system of equations. I have 4 points before perspective projection and after and I whant to obtain matrix of perspective projection $m_{i,j}$ ($x,y,u,v$ are known , $m_{i,j}$ ...
3
votes
1answer
429 views

How do I solve $1 - (1 - (A x)^2)^\frac{3}{2} - B(1 - \cos(x))= 0$?

Consider the equation $$ 1 - (1 - (A x)^2)^\frac{3}{2} - B(1 - \cos(x)) = 0 $$ where $A,B \in \mathbb{R}$ are constants. What is the analytic solution?
7
votes
1answer
731 views

Handling failed FindRoot calls

I want to handle FindRoot calls which did not converge (e.g "thrown" error message FindRoot::cvmit) ...
3
votes
2answers
664 views

How can I solve an equation with symbolic coefficients?

I want to try to solve the following a x^(17/6) - b x^2 - 1 == 0 where a and b are ...
2
votes
1answer
2k views

Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
15
votes
1answer
337 views

Strange behaviour of Reduce for Mod[x,1]

For every integer $x$ the equation Mod[x, 1] == 0 holds. While Simplify[Mod[x, 1] == 0, Element[x,Integers]] gives ...
12
votes
1answer
222 views

ToNumberField won't recognize Root as an explicit algebraic number

In Mathematica 9.0.1, it appears that ToNumberField will not always recognize a Root object as an explicit algebraic number. ...
12
votes
2answers
358 views

Is there a way to use functions like Prime[n] within Solve[]?

I'm trying to see if a number can be written as the sum of two prime numbers. Ideally, I would like to use Solve[ Prime[n] + Prime[m] == 100, {n, m}] But that ...
9
votes
4answers
582 views

Finding the roots of Hypergeometric1F1[]

I am trying to find the roots, λ, for this equation: Hypergeometric1F1[1/4 (2 -  λ /β), n + 1, β] for certain ...
4
votes
1answer
463 views

How do I use RSolve to solve a system of recurrence relations?

I am trying to solve a system of recurrence relations as follows. ...
3
votes
1answer
534 views

Solving Simultaneous Equations

I am trying to solve two equations that take the form: $W_0 \sqrt{1+\left(\dfrac{z}{\lambda\,\pi\, W_{0}^2}\right)}=W_1\;\,\quad \ldots(1)$ $W_0\sqrt{1+\left( \dfrac{z+0.1}{\lambda\, \pi\, ...
3
votes
2answers
3k views

How to convert a system of parametric equations to a normal equation?

For example, I have a system of parametric equations (R is a constant number) : ...
1
vote
1answer
218 views

How do I get all possible solutions in an underdetermined system? [duplicate]

I have two problems which I'd like to solve with Mathematica. If I have a system of two equations with three unknowns, how can I get to list all possible solutions for the unknowns? Here is what I ...
1
vote
1answer
426 views

Using previous two solutions as a start point in FindRoot

I need to solve a sequence of equations and I want the starting point of each new FindRoot to be the solution of the earlier FindRoot, increased or decreased by a a bit in the following way: Some ...
16
votes
1answer
668 views

Bug in Solve (Mathematica 9)

Just came across the strangest bug under both Mathematica 9.0.0 and 9.0.1. If one enters: Solve[m == p Sin[x] && -Pi/2 < x < Pi/2, x] ... then ...
8
votes
2answers
760 views

Find the parameter values satisfying conditions for all roots of an equation

Hi I'm very new at Mathematica. My real problems concerns a much more difficult equation with many parameters, but I want to check that the method is good, so I made up a test equation. My test ...
5
votes
2answers
273 views

Intersection of two splines

I have a collection of sets of points, each set defining the segment of a (nice) curve on the unit sphere $S^2 \subset \mathbb{R}^3$. The points are computed numerically. I now want to compute the ...
4
votes
3answers
286 views

Finding parameters making real part of eigenvalues vanish

I have the following $\;3\times3$ matrix: $\left( \begin{array}{ccc} 0.04 -0.4 b & 0 & 0.04 -0.4 b \\ 0 & -0.08-1.2 b & -0.06-0.9 b \\ 1.04 -0.4 b & 2.08 -0.8 b & 0 ...
4
votes
3answers
199 views

Why the inequality does not take into account the domain?

I have this inequality: Reduce[(4000-1000k)/(k-4) < 0] and the answer is k ∈ Reals I would expect ...
4
votes
1answer
325 views

Eliminating functions from system of PDE in Mathematica

Mathematica users, Let's see an example of three PDEs: How can I eliminate variables q1[x,y,z] and q2[x,y,z] from a system of ...
3
votes
1answer
300 views

Solving a differential equation with initial conditions

I want to get a solution to an ordinary differential equation with imposed initial conditions. I'm confused about why my following code doesn't work: ...
3
votes
1answer
557 views

Finding intersection of two graphs

Here is a toy problem: I have a (directional) line that starts from {2,0} and goes through {1.8, 0.01}. Also I have a ...
3
votes
3answers
587 views

How can I solve Tan[t] - t == F[x] for t as a function of x?

How can I solve the equation Tan[t] - t = Ax, where A is a constant for t[x]? I know that ...
2
votes
1answer
349 views

Solution given by Wolfram Alpha but not _Mathematica_

Why will Mathematica not give a soluion to Solve[Log[x] == Log[j, Log[j, x]], j], but Wolfram Alpha will?
2
votes
1answer
767 views

NDSolve two PDE plus one ODE, together

I have a couple of PDE (time and space/length) that are correctly managed by NDSolve, but to which I’m adding an ODE on which the acc “accumulates”, through time, a ...
2
votes
1answer
1k views

Solve matrix equation A*X=X*B using LeastSquares

I want to solve matrix equation A*X=X*B using LeastSquares method, but it is suited for equation like A*X=B. All matrices are 3x3 ...
1
vote
2answers
133 views

Mathematica can't minimize a function

Mathematica seems not to be able to minimize this univariate function over integer arguments, $r>2, r \in \mathbb{Z}$. ...
1
vote
1answer
205 views

General form of a linear transformation

Let $v_1 = \begin{bmatrix} 2 \\ -1 \end{bmatrix}$ and $v_2=\begin{bmatrix} 1 \\ -1 \end{bmatrix}$ and let $A= \begin{bmatrix} 3 & 2 \\ -2 & 1 \end{bmatrix}$ be a matrix for $T\colon \Bbb ...
1
vote
2answers
310 views

solving for one solution to a system of polynomials

I'm trying to solve a system of equations: ...
0
votes
1answer
111 views

How to solve this nonlinear 2 by 2 equations?

I have a equation (x^2 + q1^2 - y^2)/2*(x + q1 - y) + (1 - 2*a)*q + 2*F = 2*(1 - a)*c[q] in q(variable) with parameters q1,a,F and function c(in variable q also, and I define it outside Solve so I can ...
0
votes
2answers
435 views

Classification of a linear system of equations with a parameter

I need to get every possible value of k that returns infinite number of solutions or no solution to this system: ...
17
votes
5answers
722 views

Fitting points to tilted, off-center ellipse

I have 24 x-y points that are supposed to form an ellipse. ...
9
votes
2answers
2k views

FindRoot Domain restriction

I am solving a system of four non-linear equations in four variables using FindRoot. I have some sense of the relationship between the variables so I don't want Mathematica to do its computations in ...
17
votes
1answer
997 views

The Orbit and Perigee of the Flamsteed comet

Historical context This year we have the 330-th anniversary of the Battle of Vienna - one of the great formative events of European history, it took place on September 12, 1683. Kara Mustafa, Grand ...
12
votes
3answers
520 views

How can I simulate this toggle mechanism?

I've been introduced to Mathematica very recently. Basically, I haven't actually "solved" anything in my Mathematica lifetime, but I've done some simulations. With my fractional knowledge, I tried ...
7
votes
3answers
365 views

1D quasicrystal: points on a line nearest to points on a lattice

I have a simple lattice / line manipulation: ...
16
votes
2answers
783 views

Using the Krylov method for Solve: Speeding up a SparseArray calculation

I'm trying to implement this Total Variation Regularized Numerical Differentiation (TVDiff) code in MMA (which I found through this SO answer): essentially I want to differentiate noisy data. The full ...
8
votes
1answer
193 views

Unexpected behaviour of Solve applied to two equations in two variables

I have a simple Mathematica expression Solve[{a(a-1)Sqrt[1+a^2+b^2] == b(a^3-1), b(b-1)Sqrt[1+a^2+b^2] == a(b^3-1)}] which returns (on version 8.0, and also ...
7
votes
1answer
397 views

Issue with the NDSolve code

With this procedure, one may determine an eigen-value function $R(a)$ for any given $\Xi$ (say 0, 25, 50, 75, 100) ...
6
votes
3answers
962 views

Why won't Mathematica Solve a set of two equations for one variable?

For example, if I try to Solve this set of equations Solve[y == 3 x + 5 && y == -x + 7, {x, y}] Mathematica gives the right values for ...
4
votes
1answer
407 views

How to solve this equation with integers as a solution?

I want to solve the equation $$x^y + y = y^x + x$$ with $x$, $y$ are integer numbers. I tried Solve[x^y + y == y^x + x, {x, y}, Integers] How to solve the ...
4
votes
3answers
380 views

How to obtain a fixed number of solutions to $x+y=1$?

How to obtain a fixed number of solutions to $x+y=1$? For example, I want 4 solutions: $(1,0),(2,-1),(3,-2),(-2,3)$ I want to do this also on bigger equations such as $x+y+...=1$ and then I want to ...
13
votes
2answers
780 views

Suppressing negative roots in Mathematica

Problem Using Mathematica's Solve operator can sometimes lead to an output involving a positive and negative root (say when solving for a variable such as ...
12
votes
1answer
172 views

Solve[ ] with Method -> Reduce gives a different result than Reduce[ ]

Why does Solve[Sqrt[x + Sqrt[x]] - Sqrt[x - Sqrt[x]] == m Sqrt[x/(x + Sqrt[x])], x, Reals, Method -> Reduce] give a different result than ...
11
votes
2answers
572 views

Google Code Jam: Mountain View code review

After participating in Google Code Jam 2012 Round 2, it occurred to me that the Mountain View problem boiled down to solving a set of linear inequalities, which could be done in Mathematica. I've only ...
8
votes
2answers
262 views

Trouble getting FindInstance to return multiple results for certain constraints

I'm having a hard time getting FindInstance to return multiple results. Consider this simple example: ...
6
votes
1answer
500 views

What are the algorithm details of FindRoot?

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system". But I ...
5
votes
4answers
270 views

Symbolically solve and Plot equation involving Tan

I currently have the equation below for a beam with a hinge at various locations, the variable a can vary between 0 and 0.5. $$ Tan\left( {a\sqrt \alpha } \right) + Tan\left\{ {\left( {1 - a} ...
4
votes
4answers
304 views

An easier way to find the properties of an ellipse from its equation?

In this Q&A about fitting an ellipse to a set of points, there are multiple answers that generated general equations of the ellipse, like this one by @ubpdqn: However, the steps to find out the ...