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
45 views

NDSolve throws LinearSolve::mcovl for the uncompressible N-S equation of the flow around a cylinder

I am trying to solve the uncompressible N-S equation to simulate the flow around a cylinder, following the vorticity-streamfunction approach. (All code supplied both as a picture and a copiable code ...
0
votes
1answer
91 views

_?NumericQ inside NDSolve to speed up code

I've seen some people using _?NumericQ to prevent symbolic calculation and speed up NDSolve. Why in this simple code is not ...
0
votes
1answer
26 views

Numerical derivative (ND) not working for orthonormalized eigenvectors of a matrix

I have problem making ND work. Define relevant needs and vectors ...
0
votes
1answer
129 views

NDSolve problem with maxit, ndsz, and impsagpg [closed]

I'm trying to solve a system of 24 non-linear differential equations using Implicit RK method. My code works perfectly for simple case, i.e., BB=0, but for non-zero BB, Mathematica gives errors: ...
2
votes
1answer
262 views

Improvement of code precision using NDSolve for Differential-Algebraic equation

I'm trying to solve a system of 24 non-linear Differential-Algebraic equations (DAE). I'm using the command NDSolve in Mathematica to solve this system, using this command, the error is too much large....
4
votes
0answers
151 views

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
102 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
62 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
79 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
62 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 ...
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: ...
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) ...
0
votes
2answers
44 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 ...
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 ...
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 ...
3
votes
2answers
327 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
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 ...
51
votes
3answers
4k views

Is manual adjustment of AccuracyGoal and PrecisionGoal useless?

This is a problem confusing me for years. AccuracyGoal and PrecisionGoal are two options that I never truly understand and, to ...
0
votes
1answer
47 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
133 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 ...
5
votes
3answers
352 views

My evaluation is taking a lot of time

I was evaluating the roots of a transcendental equation, when I noticed that Mathematica never finishes but stays in the running state. The following is the code that I was using: ...
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^{(...
4
votes
4answers
453 views

Finding the “least” singular solution for NDSolve

I need to solve a ODE for a function $f_\sigma(x)$, where $\sigma$ is a free parameter to tune. All the solutions are supposed to be singular for some value of $x$, except one for a given value $\...
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 ...
1
vote
2answers
75 views

Numerical Integration convergence

...
1
vote
4answers
518 views

Find zeros of a transcendental function

Mathematica 10 can not give me solution of this equation ...
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
1answer
66 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
1answer
29 views

Using NSolve with an interporlated function

I have defined the interpolation function below ...
1
vote
2answers
90 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: ...
13
votes
5answers
989 views

NDSolve DAE with Constraints

I'm trying to make some numerical simulation with NDSolve. I have encountered a few problems. Here is a simplified version of the equations: ...
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
100 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 ...
22
votes
2answers
2k views

Eisenstein Series in Mathematica?

Mathematica doesn't seem to have built-in tools to deal with the Eisenstein series: $$\begin{align*} E_{2}(\tau)&= 1-24 \sum_{n=1}^{\infty} \frac{n e^{2 \pi i n \tau}}{1-e^{2 \pi i n \tau}}\\ E_{...
3
votes
1answer
152 views

Find an appropriate algorithm for certain type of first order nonlinear PDE

I am trying to solve a first-order nonlinear PDE of the form $$ \partial_t z(t,x) = f(t, x, z(t,x), \partial_x z(t,x)) $$ with the boundary condition $$ z(0,x) = \phi(x) $$ for some finite domain $x \...
83
votes
4answers
42k views

Why round to even integers?

According to the Mathematica help: Round rounds numbers of the form x.5 toward the nearest even integer. For example: Round[{0.5, 1.5, 2.5, 3.5, 4.5}] gives ...
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 ...
8
votes
4answers
1k views

ListPlot very large numbers

Suppose we have the following function: NN = 150; W[n1_] := NN!/(n1 ! (NN - n1!)) (1/2)^n1 (1/2)^(NN - n1) Then we can Plot ...
11
votes
2answers
460 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 ...
22
votes
3answers
9k views
0
votes
1answer
89 views

Newton's Method plot [closed]

I'm trying to do c. So far I tried, ...
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 ...
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 ...

1
2 3 4 5
36