Questions tagged [numerics]

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

Filter by
Sorted by
Tagged with
3
votes
0answers
68 views
+100

Numerical backward induction — Solving sequential Cournot

I'd like to numerically solve a sequential Cournot competition in which supplier 1 moves before supplier 2, then the manufacturer sources from them, and finally sells the item at market clearing price....
1
vote
1answer
94 views

WhenEvent how to handle events at the same time and detection order

I need to use WhenEvent inside NDSolve in which events happen simultaneously. I show simple code to better explain my question: ...
0
votes
0answers
37 views

Free boundary condition for American Option using Mathematica NDSolveValue

Was wondering if there is a Mathematica example solving the free boundary condition for American Option using NDSolveValue (free boundary condition is continue to hold v.s. early exercise of the ...
0
votes
0answers
32 views

Solving for a few roots in the neighborhood of an initial point for an eigen-equation with many roots

I have a system that is described by a complex matrix, $U$, which is a function of two parameters $f, \beta$ (a dispersion eigen-relation in wave physics). We are interested in the solutions ($f,\beta$...
1
vote
3answers
57 views

How to ask Mathematica to do the given operation for a set of parameters?

I have a set of numbers like this s = {a, b, c, d, e, f, ..., g, h} and I would like to ask Mathematica to do the following operation (to sum the subtractions of ...
1
vote
3answers
78 views

Infinite double sum with exclusion

I would like to evaluate the following sum (numerically will suffice): $$ \sum_{m,n=-\infty,(m,n)\neq(0,0)}^{\infty}\frac{1}{m^{4}+n^{4}} $$ I first tried to do $$ \sum_{m,n=1}^{\infty}\frac{1}{m^{4}+...
1
vote
1answer
61 views

NDSolve needs multiple executions to work and is very slow

I just simulate a system and use an Extended Kalman Filter to estimate the state. Everything works, but I don't understand why I need to execute the Ndsolve command two times before it can run without ...
0
votes
0answers
33 views

How can I plot the stability region of two different methods in one plot? [closed]

I am trying the following ListPlot[Plot1, Plot2, {x,-0.5,10},{y,-0.5,10} ]
1
vote
0answers
43 views

Large and infinite sums evaluated numerically

I am interested to learn when and how Mathematica is able to evaluate large/infinite sums numerically in reasonable time. I have found that it can evaluate $$ \sum_{l=1}^{\infty}e^{il/2}H_{0}^{(1)}(l) ...
1
vote
1answer
75 views

Optimization of second order ODE with more than one parameter

I want to optimize a second order ODE with more than one variable: ...
0
votes
1answer
55 views

Is it possible to ask Mathematica to give all the roots of the given function?

I have this equation $$ 36 \cos \frac{3 x}{4} \cos \frac{27 x}{20} \left(\cos \frac{3 x}{5} +2 \cos \frac{21 x}{10} \right)=0 $$ Is it possible to ask Mathematica to give all the roots of the ...
0
votes
2answers
43 views

Subscript to replaced parameters

I'm trying to manipulate numerical scheme's indexes: $$ T=D-N \\ \frac{T_i^{n+1}-T_i^n}{\Delta t}=\frac{D_i^{n+1}-D_i^n-(N_i^{n+1}-N_i^n)}{\Delta t} $$ But I don't know how to do the transition on the ...
3
votes
2answers
325 views

Suggest an irrational number from decimal one

I want to know is there any function in Mathematica that suggests a simple irrational number combination for decimal one? For example, if I give 0.804738 then I get ...
2
votes
2answers
102 views

NIntegrate results different when using 0 or 0.0

i was trying to compute a convolution numerically, but got unexpected results. In the end i was able to reduce it to the code below. As you can see, the results are different, depending on whether i ...
2
votes
1answer
53 views

Numeric solution of ODEs oscillates strongly and stops halfway?

I tried to reproduce the results of a paper. The differential equations are given by ...
0
votes
1answer
46 views

NSolve missing solutions

I'm having trouble solving the transcendental equation. For some values ​​of bi, NSolve obtains 6 roots, however when changing the value, it obtains 5. Graphing the function clearly shows that the ...
0
votes
1answer
60 views

How to use parallel computation in mathematica for numerical Integration

I have a multi dimensional integral and I need to integrate it numerically and than plot it over an extra variable for zeta = 0.5. ...
1
vote
3answers
130 views

How to approximate the harmonic sum $\sum_{n=1}^\infty\frac{{4n\choose 2n}\overline{H}_{2n}}{n 2^{4n}} ?$

How to approximate $$\sum_{n=1}^\infty\frac{{4n\choose 2n}\overline{H}_{2n}}{n 2^{4n}} ?$$ Where $\overline{H}_n=\sum_{k=1}^n \frac{(-1)^{k-1}}{k}$ is the skew harmonic number. The mathematica ...
1
vote
0answers
53 views

Solving these set of equations with complex parameters

For $\{a,b,c\}\in \mathbb{C}$ and $\{\gamma,N\}\in \mathbb{Z}^+$, I have an equation ...
0
votes
0answers
56 views

Assumptions for special functions - dirac delta confusion

I wasn't able to express dirac delta function for the below advection-diffusion-reaction function. (Dirac delta term is useless, either a3 = 0.9; or ...
3
votes
0answers
70 views

Numerical Mixed Partial Derivatives: How to Choose Scale?

For illustration purposes, consider the function $$ f(x, y) = (x - 1)^2 + (y - 1)^2 + \sin[25(x+y)] . $$ The mixed partial derivatives at the origin are $f^{(x,x)}(0,0) = f^{(y,y)}(0,0) = 2$ and $f^{(...
1
vote
2answers
75 views

Numerical Integration convergence

...
0
votes
1answer
65 views

Diffusion equation with non uniform diffusion constant

I am trying to numerically solve a 3D diffusion type equation with a spatially varying diffusion $\nabla\cdot(K \nabla T)=\partial T/\partial t$ with K a given function of space with different ...
0
votes
0answers
25 views

Error using ParallelMap to evaluate NIntegrate of numerical derivative ND

I want to evaluate a numerical integration in which the integrand is constructed out of a function f and its derivative f'. <...
0
votes
0answers
117 views
0
votes
1answer
27 views

Using NSolve with an interporlated function

I have defined the interpolation function below ...
1
vote
2answers
88 views

How do you overcome recursion limits when using DSolve?

I have the following program to solve for the neutron to baryon ratio during BBN. I've replaced many of the derived values with constants in order to focus on the problem: ...
0
votes
2answers
37 views

Warning when confluent hypergeometric function HypergeometricU is wrong?

From the definition as an integral (HypergeometricU/details), this function must be positive. However, it gives negative numbers in some cases with no warning of a potential error. For example, In[...
2
votes
0answers
98 views

NDSolve big system non linear coupled ODE's Method Residual Stiff System

I'm trying to develop a continuous time unscented Kalman filter for a dynamic system inspired to this article: "On Unscented Kalman Filtering for State Estimation of Continuous-Time Nonlinear ...
0
votes
0answers
31 views

Tolerance issue with MatrixExp

When I use MatrixExp[m,v] to compute, the error given by mathematica is ...
1
vote
0answers
36 views

Defining general recurrence expression and extracting coefficient

I'm new to Mathematica and I wish to solve a difference equation which is defined by the relation: $y_{i-1}-2y_{i} +y_{i+1} = f(x_i,y_i),\\y_0 = a, y_n = b.$. Where $x_i$ is given for all $i$. I want ...
11
votes
2answers
459 views

Numerically solving Helmholtz equation in 2D for a Guitar

Hi I am new to using Mathematica, so am not too confident. I am essentially trying to model vibrations of a guitar sound board for a project. It would be great to get some visualisations of the ...
0
votes
1answer
31 views

Contradictory results of numerical evaluations of a function

I have the following function: ...
0
votes
1answer
58 views

NDEigensystem does not evaluate

I am trying to obtain the eigenvalue of a certain $4\times 4$ matrix differential operator. The region I consider is a rectangle of size $5\times 200$. At left and right side, I applied the periodic ...
0
votes
1answer
88 views

Newton's Method plot [closed]

I'm trying to do c. So far I tried, ...
22
votes
3answers
9k views

Why am I getting that $0.999999999999988 \geq 1.0$ is True?

I am getting these results: ...
1
vote
0answers
35 views

NArgMax solutions' intersection plotted but not solved for

Defining two functions via NArgMax and plotting, there is an intersection and the Plot function works. But trying to solve for ...
1
vote
2answers
123 views

Why can't Mathematica express a minus operation between two decimal numbers with several places? [closed]

A example of the problem. This is a print from mathematica with the demonstration of the issue.
2
votes
0answers
49 views

Generalizing technique to handle General::munfl error?

In contrast to earlier versions of Mathematica, in versions 11.3 and later Mathematica no longer switches to arbitrary precision when it detects a MachineNumber underflow. While this behavior is ...
1
vote
1answer
43 views

NMaximize seems not to work with a plottable function

I am trying to use maximum likelihood for estimating a parameter for a model based on some experimental data. The likelihood function I am trying to maximize calls a number of custom functions I have ...
2
votes
1answer
30 views

NProduct fails strangely

For {n, 1, 24} I get an instantaneous answer for {n, 1, 25} runs without stopping! Then I tried ...
8
votes
2answers
166 views

Why does ReliefPlot not have a version for functions?

To plot bivariate functions, we typically either use Plot3D, whose dynamic effects allow flexible investigation, or DensityPlot, ...
1
vote
1answer
90 views

Solving multiple differential equations parametrically

I have the following code, where I am trying to solve one set of differential equations parametrically. I then want to use this solution to solve another equation parametrically. However, I get the ...
8
votes
1answer
125 views

Meshing an inclusion in an inclusion

I do have FEM mesh related question. I am trying to mesh some inclusion from a png file using ToElementMesh. Thats working quite nicely even for more complex structures. ...
0
votes
0answers
33 views

List of eigenvalues not exceeding a given number

I am interested in computing the eigenvalues of Laplacian numerically. Consider the $\textbf{LAPLACE'S BOUNDARY VALUE PROBLEM ON A UNIT SQUARE:}$ Let $\Omega = [0 , 1]^2$. Now the eigenvalue problem ...
1
vote
1answer
33 views

using a list of parameters in NSum [closed]

I am trying to make a function that uses NSum, that takes a list of parameters. But NSum doesn't appear to play nicely with lists. A minimum working example is: ...
7
votes
1answer
145 views

Fast Evaluation of a series of dot product

Context I have a function that depends on 3 real variables x,y and z and that is defined by a series of matrix products. The evaluation of f for a specific (x,y,z) is fast ~0.02 sec but I want to ...
4
votes
2answers
194 views

How to get the right approximation for a series involving the harmonic number?

The right numerical value of the closed form of $\sum_{n=1}^\infty\frac{4^n H_n^2}{{2n\choose n}n^2}$ is $40.66752074791188333...$. I tried to verify this result on Mathematica using the command: <...
1
vote
0answers
77 views

Computation of infinite series containing Zeta function

(this is my first question on this forum I'm totally inexperienced in mathematica) Consider the given alternating series: $$f(x) =\sum_{n=0}^\infty \frac{2a_n(x-1)^{2n+1}}{\zeta(-2n-1)}$$ Here, $a_n= (...
2
votes
2answers
71 views

Solving a recursive equation iteratively (including PolyLog function)

I have the following equation which I want to solve: $$ I_D = [Li_2(-e^{V_D-I_D})-Li_{2}(e^{I_D})] $$ Here $Li_2(x)$ is the PolyLog function of order $2$. Is there a way to solve this equation ...

1
2 3 4 5
36