Questions tagged [numerics]
Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.
2,144
questions
0
votes
0
answers
200
views
How to include impulses in differential equations?
I have two coupled differential equations as follows:
$$S'(t) = - \frac{a}{1 + B(t)} S(t),$$
$$B'(t) = \frac{c}{1 + S(t)} B(t) (1 - B(t)) - d B^2(t) \Big( \frac{1 - B(t)}{B(t)} \Big)^n,$$
where $a$, $...
0
votes
1
answer
46
views
Plotting an integral with solving for a specific constant [closed]
Given an Integral I(t) which is a function of a constant tc, this constant is determined with the condition I(tc)=0, how can I add this condition?
0
votes
0
answers
47
views
Method to make this complicated integration from interpolating function? [closed]
Hello I want to do this integral
Mu[Psi_, R_] = Integrate[ D[Integrate[Rp f[Psip, Rp]/Sqrt[R^2 - Rp^2], {Rp, 0, R}], R]/ Sqrt[Psi - Psip], {Psip, Psi0, Psi}]
...
0
votes
1
answer
71
views
Triple Summation Calculation Which Includes an Integral
I am a beginner in Mathematica. I have to calculate the following summation:$$C_3(\alpha)=\frac{1}{3}\sum_{j,k,l=3}^{\infty}(2j+1)(2k+1)(2l+1)(C_jC_k+C_kC_l+C_lC_j)f_{jkl}$$ where $$f_{jkl}=\frac{1}{4\...
0
votes
1
answer
160
views
Using ParametricNDSolveValue and MultiNonlinearModelFit to fit an ODE system to datasets
I asked a question here about fitting an ODE system to given datasets. The great answer of @ydd solved the problem nicely. In the mentioned answer, the initial values are taken as the initial points ...
0
votes
1
answer
81
views
When does arithmetic with approximate numbers not follow basic properties?
Consider this:
x = Exp[3.5*^15]
(* OVerflow[] *)
The above is well documented and so is the next result.
...
2
votes
2
answers
331
views
Modeling experimental data with differential equations
I have the following two sets of experimental data, which show the dependencies of two quantities, namely, $S$ and $B$, on time ($0$ h, $3$ h, $6$ h, $9$ h, $15$ h, $18$ h, $21$ h, and $24$ h):
...
1
vote
0
answers
153
views
+500
How to solve the following integrodifferential equation by generic approach?
Consider the following equation:
$$
\frac{\partial f}{\partial t} - p H(t)\frac{\partial f}{\partial p} = \mathcal{I}[p,t], \tag 1
$$
Here, f = f[p,t], with p being ...
0
votes
0
answers
73
views
Possible bug in Eigensystem
I'm getting some very strange behavior when running Eigensystem on a 8000 by 8000 matrix of Real numbers (stored as a dense matrix ...
0
votes
0
answers
66
views
Why dont I get the numeric value? [closed]
For the given expression:
...
2
votes
1
answer
141
views
How to solve this integral equation numerically?
I am encountering difficulties while trying to numerically solve an equation in Mathematica that involves an unknown function and an integral. Specifically, the equation takes the form of
\begin{...
3
votes
2
answers
98
views
Solving A System of Two Implicit Equations
I am solving a system of 6 equations, and I am interested to know the solution for different rhoBar values. Here is the input parameters:
...
2
votes
3
answers
129
views
Multiple solutions from NSolve
I have a list of polynomial equations which I can solve using NSolve. However, it gives me a large number of similar solutions. The solutions are largely identical ...
1
vote
1
answer
100
views
Plot after applying NIntegrate
I'm trying to integrate and graph $I$ vs $b$ the following integral (eq. 24 in this paper) in wolfram mathematica
$$ I = \int_{2}^{\infty} \frac{g_i^3 \mathcal{K}_t \mathrm{~d} r}{r^2\left|\mathcal{K}...
1
vote
1
answer
62
views
Find an instance satisfying equation
I have the following equation with two variables xi and nu.
...
3
votes
1
answer
141
views
Solving system of first order PDEs
I am trying to solve the 1st order PDE system
\begin{align}
\xi_u^2+\eta_u^2&= \left(1+\frac{\xi^2+\eta^2}{4} \right)^2\\
\xi_v^2+\eta_v^2&=\left(1+\frac{\xi^2+\eta^2}{4} \right)^2
\end{align}
...
-1
votes
1
answer
135
views
Galactic rotation speed and density research
Rotation speed of Milky Way looks like this until about 25 kpc
I know the following points to describe this curve
...
1
vote
0
answers
86
views
Attempt to find a solution (out of potentially many) to a system of equations with FindInstance runs forever or crashes
I have a system of equations that in principle should have a solution (I would think not a unique one), which I want to solve. I am not interested in all solutions; I just want to locate one, assuming ...
1
vote
1
answer
77
views
Minimization of an implicitly specified function
exp - an experimental data, where expT - temperature, expChi - magnetic susceptibility
I ...
1
vote
0
answers
132
views
How to calculate and plot this integral? [closed]
Any help to integrate this equation:
$$
\begin{eqnarray}
p(k,q)&=&-16 H^2 q^2\int_{q_a}^q \int_{q_a}^q \frac{1}{\sqrt{H^2-k_1{^2}}}\sinh(\sqrt{H^2-k_1{^2}}(q-b))\frac{1}{H b}
\...
2
votes
0
answers
100
views
Training a neural network for solving PDEs and doing some predictions [closed]
I have been following the discussions presented in Teaching neural networks regarding the use of neural networks for solving PDEs. In their second example, they adjust the coefficient of a 1D heat PDE ...
2
votes
2
answers
102
views
NDSolve of a non-linear ODE
I am trying to solve the following non-linear ODE numerically:
...
0
votes
0
answers
74
views
Plotting complex roots in complex plane
I want to visualize the spectra (roots) of a quasipolynomial in Mathematica, for example: $$f(x) = x^2+x e^{-x}.$$
I know that it works nicely in MATLAB with the extended library, but I want to try it ...
0
votes
0
answers
91
views
Why doesn't NMinimize work with NSolve?
Why does NMinimize throw the error and how to fix it?
...
2
votes
1
answer
52
views
Event control in delay differential equations
A delay-differential system for variables {y[t],z[t]} is defined by time-lag w
{y'[t] == (r (1 - y[t] - z[t]) - 1) y[t],
z'[t] == (y[t] - y[t - w])};
The ...
3
votes
1
answer
166
views
Numerical solution of the Richards' equation
I am trying to solve Richards' equation to model fluid flow in soil. The governing partial differential equation, initial condition, and boundary conditions are:
The analytical solution of the ...
0
votes
2
answers
100
views
Why can't NSolve find values that FindInstance can?
I am trying to solve for \[Epsilon], given three input paramters n, x and ...
3
votes
1
answer
130
views
Solve Differential Equation Numerically
I investigated my system and encountered differential equation such as
$y''(x) = e^{y(x)}-e^{-2y(x)}-e^{y(x)-y(x+d)}$,
where $d$ is a constant. The boundary condition is
$y'(0) = 30$
$y'(\infty)=0$.
I ...
1
vote
1
answer
57
views
`FindMinimum` can't evaluate `Nearest` numerically
I'm trying to use Nearest as a function to minimize over: a toy example is
...
1
vote
1
answer
88
views
A code for producing system of equations for central difference method
I am trying to solve the differential equation $y''(x) = y(x)+\sin[y'(x)]$ numerically over the interval $[0,1].$ Now using central difference method I arrived at the equations of the type
$$ y_k = \...
1
vote
1
answer
108
views
Extend the code for more variables (at least 100)
I have this code (not in best shape) for a problem in 3 variables. It does the job. The problem is I want to extend this to more number of variables around 100 at least. It is very painful to extend ...
1
vote
1
answer
77
views
What are some ways to speed up calculations
Below is the code for calculating the eigenfunctions and eigenvalues of the following system:
$HC[u(\rho,z)]=-\frac{1}{2}\Delta u(\rho,z)-\frac{1}{\sqrt{\rho^2+z^2}}u(\rho,z)+\frac{B^2}{8}\rho^2 u(\...
0
votes
0
answers
66
views
NSolve can't solve a system of 2 equations with 2 unknowns
I've been trying to solve a system of 2 equations with 2 unknowns using NSolve. But It's been too slow. I waited for more then an hour without any results.
The code is:
...
2
votes
2
answers
120
views
5
votes
1
answer
183
views
Numerically finding a curve that satisfies an underdetermined set of equations
I am trying to determine a phase diagram along the lines of Fig 3. or Fig 4. of this pubilcation.
The curves plotted are binodals and are determined by the conditions of equality of chemical ...
0
votes
1
answer
54
views
NMinimze cant find points that satisfy constraints
NMinimize cant find solutions for a function which clearly has one. Setting a working precision resulted in some output, however with error messages about tolerance and precision.
Heres my code. The ...
1
vote
0
answers
65
views
Numerical Error using compile
I'm trying to compile a function and I'm running into the following error
CompiledFunction::cfne : Numerical error encountered; proceeding with uncompiled evaluation.
I think I have succeeded in ...
1
vote
2
answers
62
views
NDSolve for Coupled ODE with parameters
Here I solved sys1 using NDSolve for the parameter m. I want to solve sys2 using NDSolve. But in sys2 I have a term consisting of the derivative of the solution obtained from sys1. I am stuck on how ...
0
votes
1
answer
110
views
Performance improvements using Table and Compile
I'm converting a code from MatLab to Mathematica. It takes MatLab less than a second to compute it while its more than ten minutes in Mathematica. I was hoping to improve the performance.
Here's a ...
0
votes
0
answers
35
views
Dealing with Precision Issues in FindRoot for Complex Equations
I'm currently working on a Mathematica code that involves using the FindRoot function to find the poles of the scattering matrix in an one dimentional potetial well and for that, I need to find the ...
0
votes
2
answers
96
views
Finding the Minimum of a Four-Variable Function
Greetings esteemed colleagues. I had previously posted regarding the minimisation of a function using Mathematica, and colleagues were kind enough to provide some useful suggestions that proved quite ...
-1
votes
2
answers
439
views
Calculating a limit using Wolfram cloud or otherwise
Using Wolfram cloud or otherwise, I need to show $$\lim_{n\to\infty} \frac{n\ 4^{2n}}{e^{2n}}\ \left\{\binom{2n}{n} d_{2n}a_n\right\}\leq \frac{3}{4}$$ where $$a_n:= -\sum_{j=0}^n\binom nj^2(2(H_{n-j}-...
1
vote
2
answers
131
views
NDSolve "Coupled differential equation"
I am trying to solve the given coupled differential equation using NDsolve.
$$
\begin{array}{c}
n''(r)+\frac{n'(r) T'(r)}{T(r)}+\frac{n'(r)}{r}+\frac{n(r) T''(r)}{T(...
8
votes
1
answer
752
views
To Chop or not to Chop
If I run the command
ResourceFunction[ "GlobalMaxima"][{x*y + 2*y*z + 6*x, x^2 + y^2 + z^2 == 36}, {x, y, z}]
This returns a closed form solution of
...
6
votes
1
answer
156
views
Result of numerical computation representing a real physical quantity still contains a small imaginary components [closed]
I have been grappling with a physics calculation pertaining to thin film optics. I have been endeavouring to use transfer matrix calculations to determine optical reflectance. Attached below is the ...
4
votes
1
answer
111
views
FindRoot error in NDSolve
I have two coupled differential equations as follows
$$
\frac{\partial }{\partial x}U(x,y) =2V(x,y),
$$
$$
\frac{\partial }{\partial y}V(x,y) =V(x,y)U(x,y)+1,
$$
with ...
0
votes
1
answer
130
views
Why do the eigenvalues periodically change with successive increase in the consideration region?
When finding the eigenvalues and eigenfunctions of the system Hc[r, z] using NDEigensystem, the following issue arises: When ...
0
votes
1
answer
73
views
How could a function in a cylindrical coordinate system be plotted? [duplicate]
Below is the code for finding the eigenfunctions and eigenvalues of a particle in the Coulomb field using NDEigensystem. The problem is solved in cylindrical coordinates ($\rho,\theta,z$; $\rho \in [0,...
5
votes
2
answers
154
views
Numerical integration of a list
I have a list, p, obtained by a complex numerical procedure. Its element has the structure: {k,fi,z}. Below I give a simplified ...
3
votes
3
answers
210
views
Solving a one-dimensional free-boundary problem with a singular boundary condition
Addendum (orginial question below). Thank you for the responses! After thinking some more about this problem, and thanks to @bbgodfreys helpful comment, I realised that the problem as posted below is ...