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
1answer
55 views

Can I force `NSum` to sum exactly for many terms? [closed]

Is there a way to have NSum perform an exact term-by-term summation, when the number of terms is finite? I have a complicated infinite sum in which each term ...
4
votes
0answers
56 views

Computing log-determinant?

Mathematica does-not have a function to compute the log-det of matrix? Naively computing Log[Det[M]] can be numerically unstable.
3
votes
1answer
93 views

Mathematica unable to evaluate function which it can write explicitly in simple form

I have a function $\psi(x,n)$ in mathematica which is quite complicated. However, plugging in $n=0$ gives a simple form. Mathematica knows this (see below), however it is still unable to even evaluate ...
0
votes
0answers
64 views

Solving equations using Implicit-Runge-Kutta method

I am trying to solve the system of equations using Implicit-Runge-Kutta method but mathematica is showing error "NDSolve::ndcf: Repeated convergence test failure at [Tau] == 4.9`; unable to continue."....
2
votes
2answers
53 views

How to use NIntegrate inside FindRoot?

I am trying to use FindRoot on functions that involve NIntegrate, and Mathematica is throwing undesirable errors even when it ...
3
votes
4answers
71 views

RecurrenceTable for systems of linear difference equations

I'm working on a project that involves developing a financial forecasting model. The equations used in the model will largely be linear difference equations (estimated via some form of regression ...
0
votes
0answers
43 views

How to solve this system of coupled differential equations (numerically) [duplicate]

I am trying to solve this system of coupled differential equations, code: enter link description here The problem is when I run the code, it appears: NDSolve::ndode: The equations {True} are not ...
0
votes
0answers
67 views

How to solve numerically this system of coupled differential equations

I am trying to solve this system of coupled differential equations, ...
1
vote
0answers
20 views

Numerical evaluation of derivatives of pair

I have a set of ordered pairs. How can I take calculus action on that like derivative or integration? $$ N(E) = \{(2, 3), \cdots \} : N=2 , E=3\\ \mathrm dN(E)/\mathrm dE = ? $$
0
votes
0answers
48 views

gradient of a numerical function

Is there a way other than interpolation to evaluate the numerical differentiation using Mathematica? I have a function A(x,y) and I want to obtain the gradient of this function. ...
0
votes
1answer
101 views

Solving a system of Non-linear equations by Fixed Point method or Newton Raphson method

I have a system of five equations with ten variables, i.e., the radial distance $r$, polar angle $\theta$; four spin vector components ($St, Sr, S\theta, S\phi$) and four momentum components ($Pt, Pr, ...
3
votes
0answers
42 views

Evaluating Lauricella functions of Third kind numerically in Mathematica

Let's consider the Lauricella function of third kind, denote as $F_{C}(a,b;c_1,...,c_n;x_1,...x_n)$ in MathWorld. Is anyone aware of an algorithm that allows to numerically evaluate such a function ...
2
votes
2answers
164 views

How to merge two or more curves smoothly?

I have plotted three curves. For each range of $x$, one of those curves is true. On the other hand, finally, the result must be a unified curve. Is there any command to unify these three curves? ...
0
votes
2answers
40 views

Truncating digits after calculation

I am working on numerical solutions to PDEs. I get some outputs which I then place back into the original equation to check my answers against expected values which are the original inputs. The ...
0
votes
0answers
39 views

Plotting Interpretation

...
1
vote
0answers
77 views

NDSolve issue, potential singularity or stiff system

I have the following parameters, equations, and NDSolve solution set up as such: ...
0
votes
1answer
79 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
101 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
109 views
7
votes
3answers
259 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
60 views

Why did LinearSolve give me two different results?

Given that I have a sparse array as follows: ...
0
votes
1answer
132 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
65 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 ...
4
votes
1answer
75 views

Solving a transcendental equation with FindRoot and making a contour plot

I have the following functions, ...
2
votes
1answer
40 views

Plot solution of ODE with singularity

I wish to plot the solution of the following ODE: ...
7
votes
1answer
184 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
118 views

Error test failure when solving two coupled ODEs

by NDSolve; this is work until y=6.22 ...
3
votes
1answer
55 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
38 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
109 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
121 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
137 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
458 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
75 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
49 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
32 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
257 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
289 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
61 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 ...

1 2 3 4 5 30