Questions tagged [numerics]

Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

Filter by
Sorted by
Tagged with
4
votes
3answers
142 views
+100

Embedding non-orthogonal vectors in a vector space

Consider unit vectors $|v_i \rangle$ on an $n$ dimensional vector space, which obey the following relation: $$\langle v_i|v_i \rangle =1 \quad \& \quad |\langle v_i|v_j \rangle| \leq \epsilon, \...
3
votes
1answer
28 views

Nonlinear differential equation with unknown parameter and integral form boundary condition

I'm trying to solve numerically a non-linear problem in order to determine the velocity field ($U$) and the film thickness ($h$) of a non-Newtonian fluid over an inclined plane. The equations are, $$\...
6
votes
2answers
282 views

Integral Too Hard For Mathematica

I have a monstrous integral that I desperately want to solve with Mathematica. It takes the form of: ...
7
votes
2answers
813 views

Solving stiff boundary value problem

Im trying to solve a nonlinear ODE with boundary conditions, the simplified problem reads for example $$ k \frac{\mathrm d^2 T}{\mathrm d x^2} = T^4\, , \quad x \in[0,\, 1]\, , \\ T(0)=0.9\,,\quad T(1)...
1
vote
2answers
101 views
9
votes
3answers
247 views

FindRoot evaluates the exact same point multiple times. Why?

This is a follow-up question to this question. Let's say we want to minimize the following function f wrt. x and ...
4
votes
1answer
63 views

Using preconditioners efficiently

I am trying to numerically solve a linear system of equations of the form A x = a where A is really ill-conditioned and ...
0
votes
1answer
45 views

Solving two equations with logarithmic terms with NSolve

I want to solve the following set of equations for $M$ and $\epsilon$ : ...
0
votes
1answer
123 views

Solving a Reaction-diffusion system

I'm just a beginner in Mathematica software. I have version 12. I am looking for a program that will solve a prey-predator system with diffusion. My problem is that I tried a previously posted ...
1
vote
0answers
58 views

Why did LinearSolve give me two different results?

Given that I have a sparse array as follows: ...
0
votes
1answer
63 views

Plot a family of solutions of ODE with singularity

In the post Use Mathematica to plot the flow of an ODE with discontinuity, the following ODE with discontinuous coefficient was solved ...
14
votes
1answer
433 views

“ParametricSensitivity” in ParametricNDSolve

"ParametricSensitivity" is listed as a Method in the documentation for ParametricNDSolve, ...
3
votes
1answer
72 views
2
votes
1answer
90 views

Why does trying to plot the solution to this system of ODEs this way lead to errors?

I would like to plot the curve $\alpha(s) = (l(s), h(s))$, where $l$ and $h$ are the solutions to the system $l'^2 + h'^2 = 1$ and $l'h''-l''h'=h'\tan(l)$. Here's what I tried: ...
7
votes
1answer
169 views

Nonlinear elasticity PDE in Mathematica 12

Mathematica 12, Windows 10. I am trying to solve a PDE in one spatial dimension $R$ and time $t$. I need a solution for displacement $r(R,t)$, radial Cauchy stress $T_{RR}(R,t)$, and radial growth $\...
2
votes
1answer
40 views

Plot solution of ODE with singularity

I wish to plot the solution of the following ODE: ...
6
votes
1answer
74 views

How to help NDSolveValue handle the addition of another dependent variable in a set of reaction-diffusion equations

I am trying to use NDSolveValue to solve a system of coupled reaction-diffusion equations in a 2D space (technically 3D cylindrical coordinates, but due to radial ...
1
vote
0answers
34 views

Problem with an infinite sum

I need to calculate a coefficient as follows coef[a_, j_] := E^(-a^2/2) NSum[(a/Sqrt[2])^n 1/Sqrt[((n - j)!) (j!)], {n, j, Infinity}] This coefficient is an ...
8
votes
2answers
1k views

Integration of a rapidly oscillating function

I have a function F which behaves like you can see on the plot shown below. I need to calculate ...
1
vote
1answer
36 views

Problem when using NMinimize in a RecurrenceTable

I have a problem when I'm trying to use NMinimize in my RecurrenceTable, like in this example : ...
2
votes
2answers
114 views
0
votes
0answers
27 views

Is there a Stirling's approximation of the Multivariate gamma function? [migrated]

Is there a Stirling's approximation or (something similar) of the Multivariate gamma function?
3
votes
1answer
53 views

About the accuracy of Method -> FiniteElement in NDSolve, version 12.0

In this question, the equation $uu'=\nu u''$, $x\in (-1,1)$, $u(-1)=1+\delta$, $u(1)=-1$, was considered. The question asked about how to solve this differential equation problem in Mathematica. There ...
3
votes
2answers
639 views

How to find the area between 3 curves?

I have three equations: $y=3/x$, $y=12x$, and $y=x/12$, $x>0$. I am not sure how to go about integrating an equation once I find the intersections. Do I need multiple integrals?
0
votes
1answer
62 views

Problem with {table values} when plotting

I have a Piecewise and Nintegrate both defined with NumericQ. The NIntegrate part of the Piecewise operates when first inserted into a working program, but not when called from inside a table. Their ...
1
vote
2answers
107 views

Draw characteristic lines of ODE $\dot \gamma(t) = \sqrt{|\gamma(t)|}$ and highlight some of them

Consider the ODE $$\dot \gamma(t) = \sqrt{|\gamma(t)|}$$ with initial data $\gamma(0) =x_0 = -c^2$. The solutions of the ODE are not unique because one has $x(t) = -(t/2 - c)^2$ for $0 \le t \le 2c$, ...
3
votes
1answer
132 views

How to solve a matrix PDE and stop solving when solution becomes singular?

My question consists of two parts: How do I get mathematica to solve a PDE Matrix system and plot the result? See below for the PDE matrix system. (By plot the result I mean plot the region ...
0
votes
0answers
21 views

NMaximize scrambles constraints

There have been lots of questions around regarding the issue that NMaximize/NMinimize may give results - or at least evaluate ...
15
votes
3answers
7k views

Creating a 3D List Line Plot From Discrete Points

Given the following Runge-Kutta ODE solver and the graphical output below, how do I get a 3D line plot instead of a 3D point plot? I see that there is no ListLinePlot3D function, so I thought it might ...
1
vote
0answers
54 views

Getting NSum to go to the right depth in recursive definitions

I wanted to produce some plots of the action of the Gauss shift map on cumulative distribution functions. This means I wanted to plot functions $F_n(x)$, for $0 \leq x \leq 1$, defined by $F_1(x) = x$ ...
2
votes
1answer
95 views

Help in finding a good guesses for ode

This problem solved in 1 by @bbgodfrey. However, when I changed the parameters, the ode becomes very stiff and I did not know which best guess I need to use for y0. ...
14
votes
2answers
453 views

Can Mathematica provide a reliable estimate of the numerical error from NDSolve?

In the Details section of the Mathematica documentation for PrecisionGoal, one is told that Even though you may specify ...
9
votes
2answers
287 views

How to detect underflow/overflow (post 11.3)?

This old trick used to work before 11.3: SetSystemOptions["CheckMachineUnderflow" -> True] But no longer... so how can we explicitly check for this in v12+?? ...
12
votes
4answers
694 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: ...
1
vote
2answers
251 views

Need help in plotting a function with two variables in ODE

The solution of this ODE was given in this link Here I am asking, if L is a function of tot, g, Z and ...
1
vote
1answer
91 views

Use Mathematica to plot the flow of an ODE with discontinuity

How can I use Mathematica to plot the flow of the following ODE in $\mathbb R$? $$\frac{d}{dt} X(t,x) = \chi_{\{x>0\}}(X(t,x)), t \in [0,T],$$ $X(0,x) = x, x \in \mathbb R$ where $\chi$ denotes ...
3
votes
3answers
192 views

Extracting solutions from ContourPlot

I am dealing with a complicated equation,involving trigonometric expressions, and I would like to solve it numerically (I gave up trying to obtain a closed form solution). The equation: ...
0
votes
0answers
98 views

Numerical methods to solve an ODE with discontinuous coefficient

Consider the ODE $$\partial_t \Phi(t,x) = \mathbf b(\Phi(t,x)), \qquad t \in [0,T], \quad x=(x_1,x_2) \in \mathbb{R}^2$$ $$\Phi(0,x) = x, \quad x \in \mathbb R^2,$$ where $\mathbf b = (0,\chi_{\{x_1 \...
5
votes
3answers
248 views

How to evaluate theta function's derivative numerically?

I ran into this derivative that Mathematica won't evaluate: ...
0
votes
2answers
82 views

Abs[]^2 , Conjugate[], ComplexExpand[], and Simplify

I think this is a numeric problem but would like to see where it occurs. I create a complex rational polynomial as follows and make it a function of f ...
1
vote
1answer
71 views

Numerically solve of a system of PDEs

I am studying the vibrations of a beam which is coupled to piezoelectric strips. This system is described by the following system of DEs: ...
1
vote
1answer
47 views

How to get an equation to take in a list of points

I am trying to solve and plot a vector which is equal to (xi,yi)+gradientf(xi,yi). I solve for the gradient by finding the derivative. I am struggling with how to write/get the function to take in my ...
3
votes
1answer
3k views

Numerical integration converging too slowly

I must solve this integral which I suppose to be a very small number. How can I do? When I wrote this code: ...
1
vote
0answers
31 views

Changing machine precision notebook-wide leads to peculiarities

For a project of mine it is preferrable to set notebook precision globally. I have done so by using the answer in Global precision setting. The idea is to dynamically create a ...
31
votes
3answers
4k views

Numerical solution of coupled ODEs with boundary conditions

I have to solve the following set of ODEs and just can't get good results using Mathematica $$ r\frac{d}{dr}\left(\frac{1}{r}\frac{d}{dr}A(r)\right)-\xi^2F(r)^2\left(A(r)-1\right)=0 $$ $$ \frac{1}{r}\...
3
votes
1answer
58 views

Getting a stable solution for a simple first-order PDE

I have what is in my estimation a pretty simple PDE. It's the Liouville equation for the density of points in phase space with a hyperbolic secant potential. But when I try to solve it with NDSolve, I ...
3
votes
2answers
129 views

Efficient way to list zeroes of an oscillating function

From "The First 50 Million Prime Numbers" by Don Zagier: primes are integral roots of$$ 1-\frac{\sin(\frac{\pi\Gamma(s)}s)}{\sin(\frac\pi s)}. $$ The graph of this function looks like I would like to ...
10
votes
3answers
527 views

Wrong results from NSolve on coupled polynomials. WorkingPrecision -> Automatic fails

OP UPDATE: I received an email from WR on 1-18-2016: "...It does appear that the NSolve function is not behaving properly in this case and I have forwarded an incident report to our developers with ...
3
votes
3answers
125 views

Zeros of high degree polynomials

I am working with Hermite polynomials in Mathematica with the built-in function HermiteH. I want to compute the zeros of the polynomial ...
2
votes
1answer
112 views

Testing the accuracy of numerically computed derivatives - alternative method

So I have asked this question earlier today: Testing the accuracy of numerically computed derivatives, This method works well for DifferenceOrder methods but upon reading https://reference.wolfram....