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
0 answers
88 views

Discrepancy in eigenvalues [closed]

I need to calculate the eigenvalues of a matrix and the parameters are such that there is a large difference (several orders of magnitude) between the entries. Theoretically, the matrix has only one ...
user avatar
4 votes
1 answer
88 views

Solving a nonlinear integral equation

I wonder if Mathematica can be used to numerically solve the following nonlinear integral equation? $\lambda^2(t)-\frac{1}{\lambda^4(t)}+\frac{2}{R_0^2} \int_{R_0}^{R_0+u_0t} R \left[\frac{\lambda^...
user avatar
  • 41
1 vote
0 answers
57 views

Numerical solution for multi-step PDEs

I am trying to numerically solve the following PDEs in MMA (v12.0) $$\partial_u f(x,u) = \left\{\begin{matrix}&-a f(x,u) + b \, \partial_x^2 f(x,u), & 0<u<T\\ &r(x;\alpha_1) \, f(...
user avatar
  • 193
0 votes
1 answer
87 views

Finding local minimum of a 2D potential

I tried to find a local minimum point of a 2D potential U[\[Chi],\[CurlyPhi]] with both FindMinimum and ...
user avatar
  • 13
0 votes
0 answers
59 views

Why won't NIntegrate just return 0 for a zero integral? [closed]

When evaluating integrals numerically that are extremely close to zero, I just want to Mathematica to return zero instead of an error. (After all, this is numerical, so "close to zero" means ...
user avatar
  • 233
0 votes
0 answers
45 views

NDSolve overdetermined but I can't see how

Edit: partial answer This confuses me but it is due to some behaviour of pattern matching which just seems wrong to me. An example of the behaviour ...
user avatar
0 votes
0 answers
45 views

Prime sign ` followed by numerical values [duplicate]

Here are 2 lines of the numerical output of Mathematica: -0.0021055211287945152282575757575757575812.493743372412704 0.0282098170963017582537878787878787878913....
user avatar
3 votes
1 answer
100 views

Inconsistent results between NIntegrate and Integrate

I get these inconsistent results What is going wrong? Fast oscillating terms? Small exponential factors? But then, why the result seems to toggle between values 1 and 2, rather than being a real ...
user avatar
  • 315
9 votes
4 answers
717 views

Solving Burger's equation with NDSolve at large time

I want to solve the following Burger's equation $$\partial_tu+\partial_x\left(\frac{u^2}{2}\right)=0,~~x\in[0,2\pi],~t>0\\u(x,0)=\frac{1}{3}+\frac{2}{3}\sin(x)$$ with mathematica. Here's my code: <...
user avatar
  • 193
1 vote
1 answer
99 views

Nonlinear Schrödinger Equation With Periodically Varying Function

I am trying to solve Equation. 42 from https://labsites.rochester.edu/agrawal/wp-content/uploads/2019/08/paper_2019_03.pdf The equation I am trying to solve is a nonlinear Schrödinger equation More ...
user avatar
0 votes
0 answers
32 views

Giving a scalar and vector function to ND solve?

I'm trying to solve a coupled system of ODEs using NDSolve. In this system, one function is a scalar and another is a vector i.e. it contains multiple components. <...
user avatar
  • 1
3 votes
1 answer
74 views

Is it possible to solve a differential equation with a user-defined variable mesh in NDSolve?

For some differential equations, its solution may evolve to a cusp, for example, singular behavior. One may want to introduce additional mesh points near the cusp to accurately follow the solution ...
user avatar
0 votes
1 answer
30 views

How to import a file with 3 columns of numerical data and visualize it with ListPointPlot3D? [closed]

The file is plain ascii. e.g. 100 rows, each row like "1.23 2.34 3.45". I'm a complete novice with Mathematica, I assume this will be trivial.
user avatar
4 votes
2 answers
125 views

Numerically solving nonlinear PDE $u_t = G(u,u_y,u_{xy},u_{xx}u_{yy})$ with unbounded initial condition

I am trying to numerically solve some nonlinear partial differential equations similar to the example given below, for which I have been unable to obtain stable numerical solutions due to some ...
user avatar
  • 141
0 votes
2 answers
110 views

Solving System of six Non-Linear Equations in Six Unknowns

I've been trying to solve the following system of equations using NSolve and the code has been running for close to 24 hours already. Is this normal? Is there a quicker way to solve these equations? ...
user avatar
4 votes
1 answer
120 views

Nonlinear higher-order equation with fractional derivative in 1d

How can I use Mathematica to solve the following higher order and nonlinear fractional equation? $$\partial_t u(t,x) +\partial_x(u^k(t,x)\partial_x(-\Delta)^su(t,x)) = f(t,x) \quad t >0, \ x \in (\...
user avatar
  • 269
2 votes
0 answers
96 views

Nested numerical integration strategies

I have the following space time integral ...
user avatar
  • 320
0 votes
1 answer
82 views

How do I get the following to be in numerical form? [closed]

How to get this to be a numerical result Here is sample code that produces the same kind of problem; the 10^3 in the square root does not get simplified ...
user avatar
3 votes
4 answers
279 views

Numerical_integration

I have this integrand Clear[IntegrandEq10]; IntegrandEq10[x_,x0_] := (x*Sqrt[((x/x0)^2)*(1 - (1/x0)) - (1 - (1/x))])^(-1) and I need to solve it numerically. I ...
user avatar
  • 61
0 votes
0 answers
37 views

Selecting a set of points from a region to maximize the smallest pairwise distance

Suppose, we have a region (say, for simplicity, a unit cube) and a distance function that, given the coordinates of any two points in the region, calculates the distance between them. It is not simply ...
user avatar
1 vote
1 answer
126 views

How to numerically solve an equation

I would like to solve for $r_2$ the following two (independent) equations: $x_{Min}(a,b,c,r_1,F)=x_{Max}(a,b,c,r_2,F)$ (1) and $x_{Min}(a,b,c,r_2,F)=x_{Max}(a,b,c,r_1,F)$ (2) where $a$, $b$, $c$, $r_1$...
user avatar
3 votes
1 answer
68 views

Solve hyperbolic fractional problem in 1d

Inspired by the solution of a fractional parabolic problem presented in https://mathematica.stackexchange.com/posts/266475/, I wonder if we can also use Mathematica to solve the following fractional ...
user avatar
  • 269
3 votes
1 answer
119 views

Solve 1d fractional parabolic equations with Mathematica

How can we use Mathematica to solve the following fractional parabolic problem? $$\partial_t u(t,x) +a(-\Delta)^su(t,x) + bu(t,x)= f(t,x) \quad t >0, \ x \in (\alpha,\beta),\\ u(t,x) = u_c(t,x)\...
user avatar
  • 269
5 votes
1 answer
109 views

Solve 1d fractional equation with Mathematica

How can we use Mathematica to solve the following fractional elliptic problem? $$a(-\Delta)^su + bu= f(x) \text{ in } (0,1),\\ u = c \text{ in } \mathbb{R} \setminus (0,1), $$ for $a,b,c\ge0$ and a ...
user avatar
  • 269
0 votes
1 answer
66 views

Confusion about precision [duplicate]

When I evaluate x = 1.0000000000000000001 (* Precision of 20 digits *) Mathematica returns ...
user avatar
  • 928
1 vote
1 answer
48 views

Solve PDE via Mathematica [closed]

Here is my code,but it did not work, how to solve this equation with numerical method. I donnot know the problem ...
user avatar
1 vote
1 answer
79 views

How to optimize the $L^{2}$ norm in Mathematica for an iteration scheme and How to plot its 3D graph?

Consider the BVP $y^{\prime\prime}(t)=\frac{3}{2}y(t)^{2}$ with boundary conditions $y(0)=4$ and $y(1)=1$. The initial iterate is in this case $x_{0}=4-3t$. The higher iterates are given by the ...
user avatar
  • 169
2 votes
1 answer
126 views

Nonlinear differential equations - follow- up question

I have never solved numerically differential equations and in an optimal control problem I got this one that I cannot solve: $$1-f’(x)^2+f’(x)(x +1)+f’’(x)-f’’(x)f’(x)-f’’(x)f’(x)^2=f(x)$$ The initial ...
user avatar
0 votes
0 answers
28 views

Compiling functions with unit conversions

I have a numerical function that incorporates many units that I would like to speed up by using Compile. Here is a toy example of what I mean, doing it manually by ...
user avatar
  • 1,448
5 votes
2 answers
162 views

Best way to handle numerical integration and power series with large numbers

Due to the fact that almost everything I do in my research is analytic, I am quite unfamiliar with numeric calculus, so I was wondering if anyone could give me some advice on the most efficient way to ...
user avatar
2 votes
3 answers
121 views

How do I NIntegrate solutions to Differential Equations?

How do I use NIntegrate solutions to Differential Equations? ...
user avatar
3 votes
1 answer
83 views

Understanding a machine-underflow error

I am struggling with some puzzling machine-underflow errors that I can't reduce to a form that makes sense to me, and I would like some help understanding what Mathematica is doing and what it is (or ...
user avatar
1 vote
0 answers
74 views

Mathematica doesn't simplify 1.` x

I'm debugging a program that uses polynomials with numerical coefficients and it turns out that mathematica does not simplify 1.` x[1]^2 x[2]^2 to ...
user avatar
  • 928
1 vote
1 answer
42 views

How to get a function out of NDSolve

I solved a function using NDSolve and got a result. I also have a plot of the function. Could someone point me in the right direction how I can print the explicit data points and/or generate a fit ...
user avatar
  • 39
0 votes
0 answers
49 views

Solving numerically Pdes and Odes and Iteration processes

Dears, I have the following equations: $x^{\prime\prime}(t)=\frac{3}{2}x(t)^{2}$ with $x(0)=4$ and $x(1)=1$. The exact solution is $x(t)=\frac{4}{(1+t)^{2}}$. Now the corresponding operator is $ Px=x+\...
user avatar
  • 169
1 vote
1 answer
63 views

Syntax Problem In NDSolve with Free Boundaries

I am considering a problem with two free boundaries. When I consider the equation: ...
user avatar
  • 11
0 votes
0 answers
99 views

Solving a differential equation with Shooting

So I have a differential equation that I do not expect to solve analytically. I have been trying a few numerical methods, most recently shooting, without any luck. Appologies for showing the equation ...
user avatar
  • 39
1 vote
1 answer
119 views

Mathematica gives a solution to a differential equation that does not verify it

The equation I want to solve numerically with WolframCloud is: ...
user avatar
0 votes
2 answers
127 views

NMinimize does not reach the minimum

I need to minimize numerically an expression with constraints. The expression also includes a numerical integral (called 'PNoninteract'). The minimization apparently stops prematurely (I know roughly ...
user avatar
1 vote
3 answers
116 views

Is the result given by NSolve sufficiently reliable to claim that there is such a solution for the equation?

I use this code for ContourPlot ...
user avatar
  • 463
0 votes
0 answers
34 views

How to obtain the most accurate maximum value of the given equation? Changing WorkingPrecision gives different results

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1.56 <x< 1.6$ and $3<y<\pi$. ...
user avatar
  • 463
0 votes
0 answers
31 views

Which result is more reliable in NMaximize in the given code? with `WorkingPrecision` or without it?

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
user avatar
  • 463
0 votes
2 answers
109 views

How to calculate the maximum value of $x $ which satisfy the conditions $g(x,y)=0$ and $f(x,y)>1$?

I have two functions $ f(x,y) $ and $ g(x,y) $ over the domains $ 1<x< 2$ and $0<y<\pi$. I use ContourPlot to ses those values of $(x,y)$ for which $g(...
user avatar
  • 463
1 vote
2 answers
91 views

NSolve and FindRoot give a value which is not correct; how can I obtain the exact solution of the given equation? [closed]

I have two functions $ f(x,y) $ and $ g(x,y) $, I use this code ...
user avatar
  • 463
1 vote
1 answer
54 views

Why the substraction of two big numbers does not yield 0, but taking their quotient yields 1?

I have two series, generated as, ...
user avatar
1 vote
2 answers
75 views

How to use NIntegrate with symbolic parameters? [closed]

I am trying to evaluate an integral that has two symbolic parameters, $x$ and $y$ in it $$-\int_0^1\frac{\log (u)}{\sqrt{1-u^2}} \exp \left(\frac{2 u}{u+1}xy-\frac{u^2 (x-y)^2}{1-u^2}\right) \; du$$ ...
user avatar
2 votes
2 answers
157 views

One dimensional wave equation -numerical vs analitcal solution? [closed]

Recently I have been experimenting with one dimensional wave equation with Dirichlet boundary conditions. So the problem goes like this: I found this formulas in: Qiong-Gui Lin "Yet another ...
user avatar
4 votes
1 answer
192 views

Memory use buildup when solving PDE multiple times

Mathematica V 13.0 Mac OS X ARM (64-bit) - MacBook Pro 13" M1 processor macOS Big Sur 11.6.2 I am solving a PDE numerically and have noticed that memory use keeps piling up if I execute the same ...
user avatar
7 votes
1 answer
110 views

Is it possible to have a plot without any endpoints markers in NumberLinePlot?

I am using this code ...
user avatar
  • 463
2 votes
1 answer
66 views

Is it possible to change the endpoints marker in NumberLinePlot in the given code?

I use this code ...
user avatar
  • 463

1
2 3 4 5
39