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

learn more… | top users | synonyms (4)

10
votes
4answers
2k views

Why does Mathematica struggle with solving this equation?

Consider the evaluation of the following expression In[20]:= Reduce[ 1000 * 1.0609^t == 1500, t] ...
9
votes
1answer
369 views

Mathematica implementation of Earth Movers Distance?

Has anyone implemented in Mathematica the Earth Mover's Distance (EMD)? A concept dating back to Monge 1871, used to compare histograms and images, e.g., the CIEDE2000 Color Difference algorithm. ...
7
votes
2answers
132 views

Behavior of Reduce with variables as domain

When using Reduce, I accidentally put a set of variables as the domain. To my surprise, it not only seems that Reduce expects ...
7
votes
2answers
2k views

Inverse of a complicated function

Mathematica is struggling to find the inverse of this function f(r): ...
7
votes
1answer
705 views

How to find the smallest root

I have a continuous, differentiable, monotonic, bounded function called F[t]. If t -> Infinity then ...
6
votes
1answer
152 views

The third argument of the Root function

Consider the roots of an arbitrary indecomposable polynomial: sol = Solve[x^5 + 2 x + 1 == 0, x] The returned expression is ...
4
votes
2answers
466 views

How do I solve N simultaneous equations for N variables?

I have a function: f[x_] := x + 31 x^3 + 5 x^25 Which I want to find an expansion for: ...
3
votes
1answer
921 views

NDSolve does not respond

For some sets of constants, NDSolve gives me true solutions, but when I try for example, T = 1/(2*2200), Mathematica does not respond. What can I do? The code below ...
3
votes
1answer
737 views

Solve pair of recurrence relations

[Corrected equations and added simple example] Can you solve a system of (loosely) coupled recurrence relations like this in Mathematica somehow? ...
2
votes
1answer
206 views

FindRoot giving false roots with Bessel Functions

I have read in some places about the errors associated with FindRoot, but the closest thing I can find on this website seems to be due to the imaginary unit. I am dealing with what should be a ...
2
votes
3answers
1k views

Solve and plot an equation that is dependent on a transcendental equation

I am trying to plot a function that uses the values of a transcendental equation as its input values: y = Tanh[(2 y + x)/2.5] z = 2.5 * Log[2*Cosh[(2 y + x)/2.5]] ...
2
votes
2answers
945 views

Why doesn't Mathematica solve $x=\cos\,x$ properly? [duplicate]

Why doesn't Mathematica solve x == Cos[x] properly? Both Solve and NSolve fail with the ...
1
vote
0answers
96 views

Nonlinear FEM and FindRoot

I'm trying to develop a kind of nonlinear FEM application using mathematica to solve a bvp like the following: $$ \gamma(u') ~u^{iv} + 2 \gamma'(u') u''' u''+ u''^3 = f(x) $$ where $u = ...
7
votes
1answer
176 views

How to plot inequalities taking into account that points must be integers and not reals?

I have solved with Mathematica 9 the following integer inequalities using Reduce: ...
6
votes
1answer
141 views

Why is FindInstance failing when I relax a set of constraints?

I'm attempting to use FindInstance to generate coordinate sets for plausible triangles with edge length distance constraints. E.g.: ...
6
votes
3answers
369 views

Why don't I get numeric values from this Solve?

Solve[ a^2 + b^2 == c^2 && a < 100 && b < 100 && c < 100, {a, b, c}, Integers] gives me this result ...
6
votes
1answer
566 views

Getting an InterpolatingFunction from a ContourPlot

I have a function, say minimizeme[Ω_][β_][ϵ_] = ϵ^2 Ω - Log[2 (Cosh[2 β] + Cosh[2 β ϵ])]/(2 β); I want to find its critical points in $\epsilon$ for a given ...
6
votes
1answer
538 views

How to Simplify equations over a Ring with Mathematica?

For example, when we work over a ring, the equation x^3=0 does not imply x^2=0 or x=0, but ...
6
votes
3answers
617 views

Arithmetic operation on the value returned by Solve

I want to modify the value that is returned by Solve. Example: SolC1 = Solve[Sin[ π x / L] == 1, x] {{x -> L/2}} I need to add n to x so that x becomes ...
5
votes
2answers
108 views

What are the Method options Solve command accepts?

What are the Method options Solve command accepts? Solve has the Method option, however documentation contains no methods that it accepts...
5
votes
2answers
336 views

Equation solving with GroebnerBasis

I have a system of quadratic equations defined below ...
4
votes
2answers
186 views

Why doesn't Roots work on a certain quartic polynomial equation?

In everything that follows I am using Roots to get the solutions to the equations. I start off with this equation: $$ \frac{A}{3}x^4 - x^2 + 2ax - b^2 = 0$$ Now ...
4
votes
3answers
278 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
2answers
392 views

Why doesn't FindRoot work correctly?

I'm trying to find the roots of the following equation: I need to find λs for different values of ξ. I know that for all ...
4
votes
4answers
776 views

recursively solve equation and saving the values

I am new to Mathematica. I am trying to recursively solve an equation and saving the values into a Table. Since I need the real solutions only I use ...
3
votes
1answer
170 views

Strange behavior of Reduce with a cubic equation

This equation: $(\frac{-a}{x})^2=\sqrt{\frac{1}{x}}$ at $a > 0$ and $x > 0$ has a clear solution $x=a^{4/3}$, doesn't it? However, ...
3
votes
1answer
283 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
307 views

Tips for efficiently solving large system coupled (nonlinear) ODEs

I'm trying to solve a system of nonlinear, coupled ODEs, where the governing equation for the $n-th$ ODE is of the form: $\sum_k^M Q_{nk} \ddot{a}_k -\sum_{\ell}^M\sum_k^M S_n(\ell,k) \dot{a}_{\ell} ...
3
votes
3answers
194 views

Speed up Eliminate

I have a set of trig equations, c1,c2,c3 are constants, I excepted the result is c1 c2 c3 r^2 + (c1^2 + c2^2 + c3^2 - 1) r + c1 c2 c3 == 0 but following code ...
3
votes
1answer
170 views

Finding the largest integer that cannot be partitioned in a certain way

I want to use Mathematica to solve the problem: Find the maximum $k$ such that $6x+9y+20z=k$ does not have a non-negative solution. I tried FrobeniusSolve. ...
3
votes
3answers
602 views

Solving Integrals

Here's a problem that I don't understand. f[x_] := Exp[Cos[3*x]] g[x_] := (1/3)*x^3 - x^2 + 2 When I try to find the limit: ...
3
votes
1answer
1k views

Finding the Minimum value of an interpolating function

I can't seem to use FindMinValue to find the min. value of a curve represented by an interpolating function. For instance the below code generates an interpolating ...
3
votes
1answer
381 views

wrong use of _?NumberQ?

I am having trouble with a numerical exercise. Here's a simplified version of my problem. I define two functions to find the solution to two constrained maximization problems: ...
3
votes
3answers
378 views

Animate a position change along the curve for every iteration

I've only had few previous experiences on Mathematica before. So basically an entry-level question that harasses a rookie like me. I made the following attempt using bisection method to calculate ...
2
votes
1answer
74 views

Aborts and beeps without error warning

I have a piece of code that generates a figure, performing a calculation to generate each pixel. At a certain resolution it runs fine, but after a high enough resolution it fails. Mathematica beeps ...
2
votes
3answers
134 views

Solve works with numbers but not number stored in variable

I have the code: ...
2
votes
1answer
332 views

Solve[Tan[theta] == (b*Sin[t])/(a*Cos[t]), theta] breaks when “Reals” is added?

Mathematica solves this equation fine: Solve[ Tan[theta] == (b*Sin[t])/(a*Cos[t]), theta] // InputForm ...
2
votes
1answer
114 views

Compact form for domain ranges of many variables

When one sets up an equation to solve one often needs to specify conditions on the variables such as { x>0 && y>0 && z>0 } This is not ...
2
votes
1answer
565 views

How could I define a function as the solution of equations in Mathematica?

I have posed a specific question yesterday but it may be too trivial to answer. I think the question could be asked in a more general way so it is easier to answer. Then I could solve the original ...
2
votes
1answer
106 views

Finding the root of a nested function with small values

I have reduced an error in my program to this line of code: FindRoot[Nest[# (1 - #) k &, 1/2, 2^4] - 1/2, {k, 3.5}] It works for $2^1, 2^2, 2^3, 2^4,$ but ...
2
votes
1answer
124 views

How to transform an expression using algebraical instead of pattern rules [duplicate]

I would like to transform rules algebraically. A very simple example would be: - k^2 - 2 k x + x^2 /. {2*k -> 1} This transforms to: - $$k^2-2 k x+x^2$$ ...
2
votes
2answers
386 views

FindRoot errors

I'm trying to solve a system of two equations in two variables for some range of parameter values. I use ContourPlot to see where I should look for a solutions and ...
2
votes
1answer
563 views

'not a valid variable' error when trying to solve 13 equations with 13 variables

I want to solve 13 variables by 13 equations. And here is my program: ...
2
votes
1answer
532 views

Linear Solve with Modular Arithmetic

I am interested in using LinearSolve[m,b] which will find a solution to the equation $m.x=b$, where I am in mod 2 arithmetic. Is there any way to perform this ...
2
votes
1answer
489 views

FindRoot Infinite expression 1/0 encountered error

I have 1 equation in 1 variable, which when I use Plot, looks like this: ...
2
votes
1answer
397 views

Inconsistent initial and boundary conditions

I have a 4th order nonlinear PDE with the following BCs and IC: ...
1
vote
1answer
46 views

Numerically Integrating to find a Maximum using NDSolve

I am trying to numerically find an equilibrium (maximum) of a function using its differential. The following is a simplified version. ...
1
vote
1answer
103 views

Find all roots in the interval of nonlinear equation

I am struggling on how to find all the roots of 1+1/2^x+1/3^x==0 which lie in a given of real and imaginary interval. Solve ...
1
vote
1answer
103 views

Having trouble assigning the result of a Solve to a function

Can anyone see what is wrong with my syntax? It looks like I have successfully assigned the result of Solve to a function. I want Mathematica to return me an numeric value of the function ...
1
vote
2answers
135 views

intersection between function and plane

I try to solve a ODE system of equations and i want to plot the intersection of the 3D solutions with a costant plane. To do this i use the follow code: ...