Questions tagged [equation-solving]
Questions on the analytic and numerical equation solving functions of Mathematica (Solve, Reduce, NSolve, FindRoot, DSolve, RSolve, etc.).
927
questions
7
votes
1
answer
5k
views
Error/warning when using NSolve for simple equation
I am using NSolve to solve an equation, as shown here:
...
2
votes
4
answers
5k
views
Solve trigonometric equation
I'm looking for a solution (graphic, numeric or analytic) for a function of the form:
$$a^2\tanh(x)=\tan(ax),\quad a ≥ 1,\ x > 0$$
preferably using Mathematica. Any advice?
-1
votes
3
answers
7k
views
How do I determine the maximum value for a polynomial, given a range of x values?
I need to determine the maximum value for y = a x^2 + b x + c, where I know the coefficients and the upper and lower x values. ...
22
votes
2
answers
4k
views
How do I split up a curve into chords of equal length?
I have a curve that is defined as f[x] and what I'm attempting to do is to divide the curve into equal straight lengths for a number of segments of my choosing that I've defined as nSeg.
I've created ...
16
votes
2
answers
660
views
Does NRoots own an abstract counterpart? If not, can we write one?
We know when solving linear algebra equations, despite its abstract syntax, LinearSolve is much faster compared to Solve:
...
15
votes
1
answer
1k
views
Numerically solving a system of many coupled non-linear ODEs efficiently?
I'm studying a fairly typical problem: a chain of $n$ coupled, non-linear oscillators. Since I want to look at open boundary conditions, the equations of motion for the position of the first and the ...
14
votes
2
answers
1k
views
How do I solve this equation?
I want to solve the equation $$ f(f(-1)) = \sqrt{2} + g(f(2)), $$
where $$f(x) = \dfrac{a}{x^2} - 3x + 2, \quad g(x) = a\cdot \sin 2x$$
$a$ is unknown. The solution is $a \approx{-5.81}$. I tried
<...
14
votes
6
answers
7k
views
How to find lattice points on a line segment?
How do I find points on the line segment joining {-4, 11} and {16, -1} whose coordinates are positive integers?
11
votes
3
answers
1k
views
How do I make Reduce yield all solutions explicitly?
Say I want to do the following:
Reduce[ x+y+z==1, {x,y,z}, Modulus -> 7 ]
then I get a solution with parameters, C[1] :
<...
10
votes
3
answers
841
views
Labeling solutions of an Eigenvalue equation involving Bessel functions
I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation:
$$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
10
votes
2
answers
919
views
Initial time as parameter in ParametricNDSolve
I need a help with the function ParametricNDSolve. My goal is solve the equation
\begin{array}
&&\dot{x}(t) = y(t) \\
&\dot{y}(t) = x(t)-1-\varepsilon Cos(\omega t) \\
&x(t_0) = x_0\\
...
8
votes
1
answer
3k
views
How to substitute the following conditions into an expression?
I have an expression: $p=a\;b\; x + b^2\; y + a\;c\; z$. I want to substitute $a\;b=1$, $b^2 = 2$ and $a\;c = 4$ to obtain $p = x + 2y + 4z$.
How can I tell Mathematica to do that? I dont know how to ...
7
votes
2
answers
3k
views
Methods for NSolve
I've been using NSolve a moderate (50-100 equations) size system of linear equations and it has been working splendidly (Solve ...
5
votes
2
answers
928
views
Roots of Whittaker W function
I am interested in finding the roots $u$ of the equation
$$
W_{1,\imath b}(a)=0,
$$
where $W_{\kappa,\mu}(z)$ denotes the Whittaker $W$ function, $a>0$ is a fixed parameter, $\imath=\sqrt{-1}$ and $...
5
votes
3
answers
3k
views
Using DSolve to solve for x[t,parameter]
I'm trying to solve an ODE with two independent variables (a cannon firing from a cliff incorporating wind resistance dependent on velocity). I've tried the following for the x-component:
...
4
votes
2
answers
1k
views
NSolve for high degree univariate polynomials
I am trying to solve a high degree univariate polynomial using Mathematica's NSolve command. But when I plug the solutions generated by Mathematica back to the equations, the equations are massive ...
2
votes
2
answers
149
views
Sum not recognized as a linear operator by Solve
When I try to solve an equation with a constant under the summation sign, Mathematica does not factor the constant out of the summation and fails to solve a simple equation.
How do I make Mathematica ...
1
vote
2
answers
3k
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 ...
15
votes
3
answers
5k
views
NDSolve with vectors
I'm stumped. I'm trying to write this using vectors, but the 2nd derivative isn't being expanded like I expected it to be. This is a system of equations for a projectile with quadratic drag and ...
14
votes
3
answers
717
views
FindInstance with a Diophantine equation seems to go on forever
I tried to find a non-trivial integer solution to the equation
$$2012^2=a^2+b^2+c^2+d^2+e^2$$
with Mathematica but the computation takes minutes; I might be doing something wrong.
...
10
votes
5
answers
1k
views
Create filling between two trig functions
Working with trig functions, period, amplitude, etc.
I found a worksheet at a calculus website, with some nice questions related to interpreting trig functions, at least, they provide some "fun" ...
9
votes
4
answers
2k
views
Transform an InterpolatingFunction
I'd like to transform an InterpolatingFunction from NDSolve but can't figure out how. Here's an example. The equation I want to solve is
...
9
votes
3
answers
766
views
Efficient code for solve this equation
We have $a*b*c=-1$, $\frac{a^2}{c}+\frac{b}{c^2}=1$, $a^2 b+a c^2+b^2 c=t$
What's the value of $a^5 c+a b^5+b c^5$?
I tried
...
7
votes
3
answers
4k
views
Why won't Mathematica Solve a set of two equations for one variable? [duplicate]
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 ...
7
votes
1
answer
346
views
Instability, Courant Condition and Robustness about solving 2D+1 PDE
After several discussions, I would like to focus on the robustness of solving 2D+1 PDE by considering all suggested methods from @xzczd (see here)
I found that the Ratio between the convection term ...
6
votes
3
answers
366
views
How do I generate a set of n-tuples containing integral solutions to a linear equation provided certain constraints?
Let $m,k,p$ be fixed positive integers. I want to create a table of k-tuples $(x_1,x_2,\ldots,x_k)$ comprised of solutions in positive integers to the equation below:
$$x_1+x_2+\cdots+x_k=m\quad\...
5
votes
2
answers
12k
views
Find all roots in range
Is there any way to check for all roots in a range? Jens' findAllRoots function is pretty good, but runs at approx. 10% of roots missed when I ran a quick check on ...
5
votes
1
answer
334
views
Simple Solve[{y == 5 + 2 x + x^a}, {x}] not working?
I am trying to find a general expression for x, for the following equation y = 5 + 2 x + x^a, but Solve cannot accomplish this.
...
4
votes
2
answers
480
views
While loop with infinitesimal steps is too time consuming
I have two ODEs with initial conditions. I want to solve the system such that $10^{-4}<z[x]<z_{0}$. The difficulty of problem is here that the initial conditions in not fixed but the boundary ...
4
votes
2
answers
3k
views
How to find regions that satisfy this inequality?
I am new to Mathematica and would like to find the set $$\{ (x,y)
\in \mathbb{R}^2: (3x+y\exp(xy))(x-a) + (6y + x \exp(xy))(y-b) < 0
\}$$ for some constants $a$ and $b$. How can I do ...
4
votes
2
answers
4k
views
Can mathematica solve this equation?
I have the following Mathematica code to solve an equation coming from isoparameteric finite element for quadratic tetrahedron element. I need to get the iteroplation fast and accurate. I only find ...
4
votes
2
answers
533
views
find where 3 inequalities are simultaneously greater than zero
I have 3 functions: f11[l], f12[l] and f13[l], and I would like to know for which values of <...
4
votes
3
answers
1k
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
\end{...
4
votes
3
answers
2k
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:
...
4
votes
1
answer
6k
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
1
answer
2k
views
How to guess initial complex value for FindRoot
I have to solve a transcendental equation for a parameter, say $\beta$. Now, the $\beta$ has a range from $ik$ to $k$ where $i$ is the usual imaginary root $\sqrt{-1}$ and $k$ is a real number. ...
2
votes
3
answers
894
views
Find all roots of a function with parabolic cylinder functions in a range of the variable
I want to find all roots of a function involving Parabolic Cylinder Functions. In what follows, I define 2 variables $\xi1$ and $\xi2$, which in turn depend on $\omega$. My function is then defined as ...
2
votes
2
answers
1k
views
boundary conditions involving time derivative
Can we solve the following PDE by Mathematica,
where $\Omega$ is a bounded domain of $\mathbb{R}^n$, $\Gamma =\partial \Omega$ is the boundary of $\Omega$, $\partial_\nu$ is the normal derivative, ...
1
vote
1
answer
1k
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 R^2\...
0
votes
3
answers
387
views
Solving equations involving integrals
I need to find the value of $z$ for a particular value of $D_c$ (eg. $500$), but $z$ is inside an integral, and I'm not able to use Solve since the integral is ...
24
votes
2
answers
991
views
3D Elastic waves in a glass
Take an empty glass, hit the side, the glass will make a sound that can be recorded using
...
23
votes
1
answer
2k
views
Is Mathematica `ContourPlot` function really so efficient?
I wanted to find the roots of the function $f(x,y)=\sin(3.2x)\sin(1.3y)-2.1 \sin(1.3x)\sin(3.2y)$. This is what the function looks like:
...
22
votes
1
answer
961
views
Bug in Solve (Mathematica 9)
The issue seems to be fixed as of Version 10.1.
Just came across the strangest bug under both Mathematica 9.0.0 and 9.0.1. If one enters:
...
19
votes
1
answer
2k
views
How do I find all the solutions of three simultaneous equations within a given box?
Sometimes, one needs to find all the solutions of three simultaneous nonlinear equations in three unknowns
$$\begin{align*}f(x,y,z)&=0\\g(x,y,z)&=0\\h(x,y,z)&=0\end{align*}$$
within a ...
16
votes
5
answers
4k
views
How to get exact roots of this polynomial?
The equation $$ 64x^7 -112x^5 -8x^4 +56x^3 +8x^2 -7x - 1 = 0 $$
has seven solutions $x = 1$, $x = -\dfrac{1}{2}$ and $x = \cos \dfrac{2n\pi}{11}$, where $n$ runs from $1$ to $5$. With ...
15
votes
2
answers
1k
views
Solving Cahn-Hilliard equation: LinearSolve: Linear equation encountered that has no solution
I have built the Cahn-Hilliard Eqs. in MMA (Mixed Formulation, second order), However, it doesnot work in MMA using Finite Element.
LinearSolve: Linear equation encountered that has no solution.
And &...
15
votes
3
answers
2k
views
NSolve gives additional solutions that don't satisfy the equations!
I am trying to solve the following polynomial equations in Mathematica:
...
14
votes
1
answer
2k
views
NDEigensystem returns incorrect eigenvalues for 2D coulomb problem, eigenfunctions contain discontinuity
I posted a similar question a short time ago regarding the 3D Coulomb problem. Jens' excellent answer to this thread allowed me to obtain the correct eigenvalues and eigenenergies for that system.
I ...
13
votes
5
answers
1k
views
NDSolve DAE with Constraints
I'm trying to make some numerical simulation with NDSolve. I have encountered a few problems. Here is a simplified version of the equations:
...
11
votes
4
answers
1k
views
How to find the next root larger than a specified value, numerically?
I would want to have a general-purpose, reasonably robust method of finding the next numerical root above a specific value of x. I'm stumped by the fact ...