Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
59 views

NDSolve issue, potential singularity or stiff system

I have the following parameters, equations, and NDSolve solution set up as such: ...
0
votes
1answer
74 views

Calculate sensitivities of differential algebraic equation

I would like to calculate sensitivities for a DAE. The DAE can be solved in Mathematica by: ...
5
votes
1answer
94 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, $$\...
1
vote
2answers
107 views
7
votes
3answers
255 views

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, \...
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$ : ...
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
126 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 ...
0
votes
1answer
64 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 ...
3
votes
1answer
72 views
2
votes
1answer
40 views

Plot solution of ODE with singularity

I wish to plot the solution of the following ODE: ...
7
votes
1answer
174 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 $\...
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 ...
2
votes
2answers
117 views

Error test failure when solving two coupled ODEs

by NDSolve; this is work until y=6.22 ...
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 ...
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 : ...
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$, ...
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 ...
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
112 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. ...
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 ...
1
vote
1answer
93 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
193 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: ...
14
votes
2answers
456 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 ...
1
vote
1answer
72 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 ...
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 ...
1
vote
2answers
253 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 ...
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+?? ...
3
votes
1answer
59 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 ...
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....
1
vote
2answers
76 views

Testing the accuracy of numerically computed derivatives

I am calculating approximate derivatives by using NDSolve`FiniteDifferenceDerivative, so this works: ...
2
votes
1answer
78 views

More elegant/efficient numerical WKB implementation for 1D Schrödinger Equation

I'm trying to figure out a better way to implement numerical WKB quantization of a spectrum. WKB quantization is the condition that $$\oint_{E}p \, \mathrm{d}q = \pi \hbar (n+1/2)$$ So the idea to ...
0
votes
1answer
62 views

Allow Mathematica to solve the differential equations with larger than 16 digits parameters

Consider the system of differential equations ...
0
votes
0answers
41 views

Numerical maximization

I am facing a numerical maximization problem with constraints. Using Method -> {"RandomSearch", "SearchPoints" -> 3}, AccuracyGoal -> 2 often does not find ...
-2
votes
2answers
128 views

Find the square root using a recursive formula [closed]

I want to approximate the square root x=Sqrt[a] for $a>0$ using the the formula $x_{n+1}=\frac{1}{2}(x_n+a/x_n)$. How can I do this?
0
votes
1answer
51 views

Power towers Power towers from x to n [closed]

How can I make Mathematica calculate a power tower for a succession of numbers, but instead of writing them, Mathematica does the iterative calculation. ...
0
votes
0answers
30 views

Constrain values to numeric during Minimize

I understand, that similar questions have been asked before, but I am absolutely new to Mathematica and can not solve it myself: In nuce it is the following: I want to calculate ...
10
votes
2answers
509 views

Morphing between two functions

Assume we have 2 peaked positive functions f[x_] := Exp[-(x + 3)^2] g[x_] := 1/2 Exp[-(x - 3)^2/4] that look like Would it be possible to numerically find a ...
5
votes
3answers
362 views

How to calculate an infinite sum to 100 exact digits with NSum?

In the discussion https://math.stackexchange.com/a/3419778/198592 I stumbled of the question how to calculate the sum $$s= \sum _{n=3}^{\infty } \frac{n \cot \left(\frac{\pi }{n}\right)}{4^{n-2}}$$ ...
5
votes
3answers
250 views

How to evaluate theta function's derivative numerically?

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

Solving a steady-state viscous Burger's equation with NDSolve

A steady-state viscous Burger's equation is given by $$ u\,u'=\nu \,u'', \quad x\in (-1,1), $$ $$ u(-1)=1+\delta,\quad u(1)=-1.$$ Here $\nu>0$ is the viscosity, $\delta>0$ is a small ...
2
votes
1answer
67 views

Problem with numerical evaluation of a Hankel identity

There an identity with the Hankel functions of both types (https://dlmf.nist.gov/10.11 eq. 10.11.4 or http://apps.nrbook.com/bateman/Vol2.pdf pg. 80 eq. 43): $$ \sin\left(\nu\pi\right){H^{(2)}_{\nu}}\...
16
votes
1answer
210 views

When does NDSolve parallelize ODE system solving?

I've long believed that NDSolve cannot make use of multiple cores to solve ODE system, but things seem to be different at least since v12. Consider the following ...
1
vote
1answer
43 views

ODE solving and NDSolveValue error depending on parameters

Given the two sets of $2N$ equations ...
2
votes
0answers
27 views

What kind of performance should I expect out of Eigensystem using FEAST?

I'm numerically solving a time-independent Schrödinger equation using Eigensystem's FEAST method. It takes a lot longer than I ...
0
votes
2answers
83 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 ...
0
votes
1answer
54 views

NDSolve for Complex Algebraic-Differential Equation

Let consider the following complex equations: $$ \frac{i x(s)}{2\pi} - \frac{\log(1+ e^{-y(s)}) - \log(1 + e^{y(s)})}{\dot x(s)} $$ which I will cal eq1 and $$ \...