Questions tagged [equation-solving]

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

Filter by
Sorted by
Tagged with
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: ...
BillyJean's user avatar
  • 1,273
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?
PFD's user avatar
  • 247
-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. ...
Zolt's user avatar
  • 99
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 ...
ASBO Allstar's user avatar
  • 1,106
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: ...
xzczd's user avatar
  • 66k
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 ...
Aegon's user avatar
  • 769
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 <...
minthao_2011's user avatar
  • 4,503
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?
Saket Kumar's user avatar
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] : <...
Per Alexandersson's user avatar
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)\,...
Aegon's user avatar
  • 769
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\\ ...
jon jones's user avatar
  • 465
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 ...
minthao_2011's user avatar
  • 4,503
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 ...
Jānis Šmits's user avatar
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 $...
Alex's user avatar
  • 755
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: ...
xaxXos's user avatar
  • 77
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 ...
John's user avatar
  • 61
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 ...
glynn's user avatar
  • 21
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 ...
user16023's user avatar
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 ...
Steve's user avatar
  • 153
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. ...
Zero's user avatar
  • 727
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" ...
Tom De Vries's user avatar
  • 3,758
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 ...
Chris K's user avatar
  • 20.1k
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 ...
chyanog's user avatar
  • 15.5k
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 ...
stevenvh's user avatar
  • 6,866
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 ...
Bob Lin's user avatar
  • 445
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\...
Black Milk's user avatar
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 ...
martin's user avatar
  • 8,678
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. ...
KAD's user avatar
  • 51
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 ...
Ali184's user avatar
  • 75
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 ...
Tim's user avatar
  • 317
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 ...
Tang Laoya's user avatar
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 <...
Elisa's user avatar
  • 41
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{...
obareey's user avatar
  • 143
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: ...
MKh's user avatar
  • 61
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 ...
user5131's user avatar
  • 145
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. ...
4208's user avatar
  • 33
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 ...
Ambrose Chau's user avatar
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, ...
S. Maths's user avatar
  • 203
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\...
Jonathan Geesr's user avatar
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 ...
Divyajyoti's user avatar
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 ...
Alex Trounev's user avatar
  • 44.3k
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: ...
anderstood's user avatar
  • 14.3k
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: ...
wolfies's user avatar
  • 8,722
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 ...
J. M.'s missing motivation's user avatar
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 ...
minthao_2011's user avatar
  • 4,503
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 &...
ABCDEMMM's user avatar
  • 1,816
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: ...
dbm's user avatar
  • 1,239
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 ...
Matthew Brunetti's user avatar
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: ...
407PZ's user avatar
  • 1,441
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 ...
kirma's user avatar
  • 19.1k

1
2
3 4 5
19