Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
73 views

Why does Mathematica store numerical values in a fresh kernel?

For some reason, when I try to do a computation in a fresh kernel, MM remembers the "old" values from the old kernel, is there a way to stop this?
1
vote
0answers
122 views

How to numerically solve this system?

Our system: \begin{align} \dot S &= \mu -\beta_1 S I_2 -\beta_2 S J-\beta_3 S A - \nu S\\[2ex] \dot {I_1} &= p \beta_1 S I_1 +q \beta_2 S J +r \beta_3 S A + \xi_1 J- b_1 I_1 \\[2ex] \dot{...
1
vote
0answers
142 views
+100

Optimization for numerical integration of Airy function and using NIntegrate inside NDSolve

Sorry for the long post. I need to integrate a function which uses the trajectory data given by the Lorentz force equation. We have the electromagnetic field: $$ \vec{E}=E_0 \cos{\omega(t+\bar{z})}\...
0
votes
1answer
34 views

NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.` [closed]

I am unable to get a numerical solution to a system of two coupled second order differential equations using NDSolve. These coupled ODEs are for a physical phenomenon known as a looping pendulum, and ...
0
votes
1answer
73 views

Two problems with ConjugateGradient

I am trying to solve a maximization problem for which I give you the code and try to step by step show you were it broke down. The first issue is that I have a constrained problem, which I try to ...
1
vote
0answers
24 views

N on equation with numbered variables [duplicate]

Say I have a system of polynomial equations in the variables x[1],...,x[n]. Sometimes want to make such equations numerical (as in: the coefficients become floats) ...
0
votes
0answers
27 views

Passing Erfc function through Reduce?

I have the following function. ...
0
votes
1answer
66 views

Solving Second Order Differential Equation with Discrete Time Data

Given the Second Order Differential Equation: $$ m\ddot{x}+c\dot{x}+kx = \mathrm{F}_{external}^{} $$ where $ m, c, k $ are constants and $\mathrm{F}_{external}^{}$ is buffer of external force taken ...
0
votes
0answers
27 views

Mean error of finite differences derivative

I wrote a module that computes the 4-th order finite difference derivative of a function at $N$ equidistant points of an interval and the difference between the exact and numerical value at those ...
-1
votes
1answer
94 views

A No-linear differential equation

I'm recently figuring out how to make this equation solved but Mathematica does not solve this??!! DSolve[{ y'[t]== ((3 a)/2 (y[t] - b/(2 a))^2 + k ((3 a)/2 - 1) t^-2 - ((a f)/2 + (3 b^2)/(8 a)))/(t ...
4
votes
3answers
163 views

How to use Findroot in a loop

Consider: i = 0.1; While[ i < 0.9, y[x_] := y /. FindRoot[{u/(1 - u) (x + Log[y]) - 1 /. u -> i}, {y, 3}]; Plot[y[x], {x, 0, 4}]; i = i + 0.1] I want ...
0
votes
0answers
30 views

Problem with numerical ConjugateTranspose?

Suppose I have a normalized numerical array, B1, ...
4
votes
1answer
70 views

Using the result of NIntegrate as a potential in NDEigensysem

I am trying to find the eigenvalues and eigenstates of a Hamiltonian with a potential which cannot be analytically defined. In particular, it is the integral of the product between two functions: <...
2
votes
1answer
60 views

Strange behavior of NDSolve (Error NDSolve::ntdvdae)

i discovered a weird behavior using ```NDSolve``` to solve a set of differential equations. Let me outline my problem: I need to solve a set of differential equations. These are equations of motion ...
0
votes
0answers
36 views
0
votes
0answers
55 views

A case for matrix multiplication (a.b).c unequal to a.(b.c) in mathematica 12.0.0.0, why?

The motivation of my calculation is to get the inverse for the following matrix ...
1
vote
2answers
75 views

How to Plot an Equation, based on another plot [closed]

I've been struggling with this problem That I have an equation with two variables. One of them has a defined interval. Like this: ...
0
votes
1answer
75 views

Plotting a phase plane portrait of an oscillatory system?

I am trying to plot a phase plane portrait of the following system: dQ/dt = v*(z - Q)*(w^2 + Q^2)/(1 + Q^2) - Q dz/dt = k - Q where v = 1, k = 0.2, and w = 0.05. So far, I have the following: ...
4
votes
1answer
212 views

Fit: Experimental`NumericalFunction error when fitting a black-box function

Bug appearing in at least 12.0.0 and 12.3.1 I'm trying some multidimensional Chebyshev fits. First, define a wrapper to prevent premature symbolic evaluation (I don't want a power series result): <...
-1
votes
1answer
102 views

How to solve that logarithmic equation? [closed]

I mean an equation $$ \log _{2 \sqrt{\sqrt{3}+2}}\left(x^2-2 x-2\right)=\log _{\sqrt{3}+2}\left(x^2-2 x-3\right).$$ The result of ...
27
votes
1answer
696 views

Efficient multidimensional optimization while constraining some coordinates

I have a function f[x] with a high-dimensional vector input and a scalar output. I am looking to minimize this function while constraining some of the components of ...
1
vote
2answers
101 views

NMinimize incorrectly says "The problem is unbounded"

I am solving some quadratic optimization problems in Mathematica 12.2 using NMinimize. Mathematica incorrectly gives the error ...
5
votes
4answers
256 views

Any Mathematica techniques to calculate time takes to reach the equilibrium of a PDE solution

I am solving this PDE numerically (dimensions: spatial variable x and time t). I know how to solve my problem numerically (for a given range of time). The solution reaches its equilibrium after a ...
0
votes
2answers
188 views
1
vote
0answers
67 views

How does Mathematica numerically evaluate Gaussian Hypergeometric function $_2F_1(a,b,c,z)$ where $a,b,c \in \mathbb{C}$ [closed]

Gaussian hypergeometric function $_2F_1(a,b,c,z)$ usually takes $a,b,c \in \mathbb{R}$ and $z \in \mathbb{C}$. But using Barnes integral representation, one can analytically continue the $_2F_1(a,b,c,...
0
votes
2answers
47 views

Numerical problem with error function

...
0
votes
0answers
53 views

Is it possible that NSolve gives the roots that the function is not (well-)defined at those points? (an example is given)

I have this function for reals values of $x$ for $2<x<3$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-...
1
vote
1answer
85 views

Is there any alternative for NSolve or Solve to obtain all the roots of the given function?

I have this function for reals $0<x<\pi$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-8 \pi x+5 \pi ^...
0
votes
0answers
39 views

How can I make sure if the given function has any roots which are not rational multiples of $\pi$?

I have this function for $0<x<\pi$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-8 \pi x+5 \pi ^2}\...
1
vote
2answers
87 views

NSolve unable to solve system of equations with domain specification

I have a system of two equations in two unknowns that I would like to solve with NSolve within a specified region. However, while Mathematica solves the system if I omit the domain specification, it ...
0
votes
1answer
59 views

Issues with Nintegrate - different methods yielding different values (both giving warnings)

I am integrating the following function \begin{equation} \frac{1}{2d^{2}}\times\frac{\sqrt{\omega_{c}\left|t_1-t_2\right|}-\sqrt{\pi}e^{\frac{1}{\omega_{c}\left|t_1-t_2\right|}}\text{erfc}\left(\frac{...
0
votes
1answer
73 views

Plotting with NMaximize

I have the following: ...
2
votes
2answers
62 views

surprised Rationalize will sometimes leave a Real unchanged [closed]

I was surprised that Rationalize will sometimes leave a Real unchanged even if the fractional part of the Real is well above zero. ...
1
vote
1answer
99 views

Solving non-linear BVP with NDSolve and shooting method [closed]

I'm trying to solve a set of non linear DAE with global constraint $$k(x) \left(\frac{1}{40} \omega ^4 n(x)^2+\frac{2}{3}\right)-L \lambda (x)-\frac{2}{3}=0,\ \ n(x) \left(\frac{1}{40} \omega ^4 k(x)^...
2
votes
0answers
40 views

JordanDecomposition not evaluating

When there are very small differences between entries in a diagonal matrix, sometimes JordanDecomposition does not evaluate and gives an error message: ...
0
votes
3answers
322 views

Python recursive bisection algorithm to Mathematica

I've been sitting on this problem for a while and i am kind of stuck. I am pretty new to Mathematica and have been trying to implement a recusive Algorithm, which splits/bisects a list of items in ...
0
votes
1answer
34 views

Indeterminant numerical value of summation

I have the following two-fold summation. ...
7
votes
1answer
181 views

Around workaround

I'm testing Around for error propagation (v12.2), but it seems to be inconsistent. Error results depend on the form. Am I missing something here? Edit Same results ...
2
votes
1answer
62 views

Custom Normalization for NDEigensystem

I am trying to solve the Laplace equation in polar coordinates $$-\left(\frac{\partial^2\psi_n(r,\theta)}{\partial r^2}+\frac{1}{r}\frac{\partial\psi_n(r,\theta)}{\partial r}+\frac{1}{r^2}\frac{\...
1
vote
1answer
109 views

FindRoot with a big range

I have a variable sig that is related to the variables (b,zQ,zh) given by torootsig, so I ...
2
votes
1answer
126 views

How to think about the answer to Rationalize[-11.5, 1]

In the open source Mathematica implementation called Mathics, an issue was raised where Mathics computes Rationalize[-11.5, 1] as -12 rather than Mathematica which ...
0
votes
0answers
55 views

Numerical Investigation of two Component Reaction-Diffusion System with Perturbative Advection

I am given two coupled differential equations and try to analyze them numerically because as far as I know, there is no analytical solution known(only the steady-state on an infinite domain is known, ...
0
votes
2answers
86 views

Nested NIntegrate over a region: Numerical Integration not converging

I need to computed two double nested numerical integrals, of which one is defined over a specific region (e.g. a pentagon). I've tried to use a single NIntegrate with four variables, but the result is ...
0
votes
1answer
64 views

Composite function derivatives

I would like to calculate the numerical partial derivatives (numerical gradient) of this function: ...
3
votes
1answer
76 views

MeijerG function: numerical evaluation of its derivative

Mathematica does not evaluate the derivative of the following MeijerG function. ...
1
vote
1answer
160 views

NonStandard finite difference for BMBB equation

I am trying to implement the following scheme mentioned in the paper "NUMERICAL SOLUTIONS OF BENJAMIN-BONA-MAHONY-BURGERS EQUATION VIA NONSTANDARD FINITE DIFFERENCE SCHEME " What is ...
2
votes
3answers
300 views

How to ask Mathematica to subtract each adjacent pair in a list, and then, sum them?

If I have a list of numbers as (the number of elements in this list is even) list={1,23,32,54,65,76,87,98,109,110,...} How can I ask Mathematica to subtract each ...
1
vote
0answers
54 views

logit ScalingFunctions

Having learned how to make symlog axes in this question, I was interested in the logit scale, the transforms of which are ...
0
votes
0answers
44 views

Indexing of NDEigensystem Result on a Cluster

I am trying to run on a cluster (where the version 11 of Mathematica is available) a code involving the following calculation: ...
1
vote
0answers
50 views

NDSolveValue BVP that encounters infinity

Problem setup: I'm trying to solve the following, quite hairy, first order BVP problem, with four unknown functions $\phi, \theta, p_\phi, p_\theta$, and boundary conditions at $\phi(0), \phi(1), \...

1
2 3 4 5
37