Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mathematica]

A powerful mathematical programming software with high level symbolic manipulation capacity.

0
votes
1answer
36 views

ISING2D with Mathematica. Searching a correct way to compute the heat capacity (mean values over several iterations)

I'm trying compute the heat capacity $C_v$ out of my simulation for the 2D-Ising model which is given by $C_v = \frac{\langle E^2 \rangle - \langle E \rangle^2}{T^2N^2}$ ($E$: Energy, $T$: ...
1
vote
1answer
126 views

Can a second-order ODE be “inconsistent” with its boundary conditions?

I am trying to solve a set of coupled, nonlinear ODEs. The only dependent variable is a 1-dimensional spatial coordinate, let's call it $x$. For now, I've managed to approximate away some of the ...
8
votes
1answer
154 views

What are these oscillations?

I have a function $g(x)$ defined numerically that is sort of in between a Gaussian and a Lorentzian. It decays much slower than a Gaussian, but still faster than a simple inverse power. I need to ...
11
votes
1answer
143 views

Numerically Recovering Imaginary Part of Analytic Continuation from Real Part

My situation. I have a function of a complex variable $f(z)$ defined through a complicated integral. What I am interested in is the value of this function on the imaginary axis. I have numerical ...
2
votes
0answers
130 views

What could be causing multi-dimensional numerical integration inconsistency?

I'm trying to numerically integrate a multi-dimensional expression. The integrand is complicated; for example this is the integrand for $N=4$: $$\begin{aligned}&x_1^6x_2^5x_3^3x_4^2(x_1-x_1x_2)(...
1
vote
0answers
89 views

Band structure of nonlinear Schrodinger equation with one dimensional potential

I have a nonlinear Schrodinger equation which reads: $$ \frac{1}{2} \frac{d^2u}{dx^2}+ |u|^2u + V(x)u = -i \frac{du}{dz},$$ where $V(x)=\cos(wx)+ i a \sin(wx)$ and $w$, $a$ are numbers. How to ...
3
votes
2answers
226 views

Writing a programming code directly from the mathematical formula?

For using any programming language, a mathematical formula should be written in the corresponding code. I wonder if there is any service (for any programming language, Matlab, Mathematica, Python, etc)...
0
votes
2answers
216 views

Matlab, Mathematica & LAPACK returning 3 different eigenvectors

(I'm not sure which of math.se / stackoverflow / scicomp.se is the right place to ask this question) I have a C++ code which generates a complex matrix and then calculates its eigenvalues and ...
1
vote
0answers
120 views

Nonlinear 2D thermoconductivity equation(numerical solution) [closed]

I have to write a solver for 2D equation: $$\partial_t u = u^2(\partial_x ^2 u + \partial_y ^2 u)$$ I try to use explicit method: $$\partial_t u = \frac{u_{i,j}^{k+1} - u_{i,j}^k}{\tau}$$ and $$\...
3
votes
1answer
1k views

How to compute the Helmholtz decomposition of 2D and 3D vector fields?

I have a sample of 100 particles with their 3D positions and velocities. I want to decompose the velocity vector field to its curl free and divergence free components. Is it a feasible to do so for ...
0
votes
1answer
159 views

Numerical solution of nonlinear thermoconductivity equation

I have to find and plot a numerical solution for the following equation (I have to write a solver): $$u_{t} = (u^2 u_x)_x$$ with the following conditions $u(0,t) =0, u(1,t) = \sqrt{\frac{2c-2}{t}}, u(...
2
votes
1answer
127 views

How does Mathematica compute 'Reduce'?

I submit a Reduce command and get results like this: ...
1
vote
0answers
429 views

Numerical Double integration with endpoint singularity in scipy Python gives incorrect answer

I am trying to integrate the following function in Python, $\int_{0}^{\infty}\int_{0}^{\infty} \dfrac{e^{-x-y}}{B(x,y)}dx dy$, where $B(x,y)$ is the beta function - $B(x,y) = \int_0^{1}a^{x-1}(1-a)^{...
-2
votes
2answers
118 views

Numerically solving differential equations, the domain is very long, [0, +10^6), so the calculating time is very long

Is there any method to deal with this problem? I am using Mathematica to solve the differential equations, but the calculating time is so long because of the large domain $x\in[0,10^{6})$. In fact I ...
3
votes
2answers
205 views

Solving coupled PDEs numerically on a semi-infinite domain with no-flux boundary conditions

I have the following system of PDEs for which I have given parameters $\gamma, \tau$ and $\mu$, $$\begin{align} T_t = &\ \gamma\,(L +\tau F-T)\\ F_t = & -F_x-(F-LT)\\ L_t = &\ \mu L_{xx}+...
0
votes
2answers
189 views

How to interpolate a set of points with a continuous closed B-spline curve?

I have been learining the NURBS theory by the classical textbook "The NURBS Book" this year. In the chapter 9, the author introduced the method of non-rational B-spline curve interpolation with a open ...
1
vote
0answers
52 views

CAS Problem with integrals

I got this problem thrown at me, unfortunately I lack context at the moment but I thought Maple or Mathematica would solve it anyways. I have a function $f$ over $x$ and $y$ such as this (Maple) <...
1
vote
0answers
134 views

Symplectic Partitioned Runge Kutta method in Mathematica [closed]

I tried to solve Hamiltonian system ($Q$ is a vector of all generalized coordinates, $P$ - of generalized momentum) $$ \frac{\mathrm{d} Q}{\mathrm{d} t}=\frac{\partial H}{\partial P} \\ \frac{\mathrm{...
1
vote
0answers
72 views

fixed point iteration to find out second order non-linear diff equations

I am working on some model analysis, getting two diff equations and after I convert them into matrix form, I have equations looks like $$ [A][X]=C\times\big(\exp([B][X])-1\big), $$ where $C$ is a ...
1
vote
0answers
34 views

How can i get this number set to be recooperated from a product sum? [closed]

W==a(x)=2*(W* x)/41; I'm attempting to make a new type of compression algorithm. A rubber band ball type. I'm trying to make a software that extracts, from that formula, the secret volumes of number ...
2
votes
1answer
262 views

Mathematica NIntegrate function in C++

I am working on computing a challenging integral. I am working with someone else who wrote some code in Mathematica to compute it. I do not have mathematica so I am trying to do the same thing in C++. ...
3
votes
1answer
143 views

Approximate $h$ in $F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$

Consider $$F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$$ $$|z|\le L$$ $$0 \le \theta \le \pi$$ By having knowledge of $F(\theta)$, how can one approximate $h(z)$? In addition, I ...
0
votes
2answers
2k views

Most efficient library to diagonalize exactly large hermitian or unitary matrices

I am working on a physics problem which requires obtaining the exact eigenvalues and eigenvectors of Hermitian and Unitary matrices numerically. Naturally I would like to ask the experts what are the ...
3
votes
1answer
884 views

Comparing Eigenvectors, Mathematica vs. Matlab

I am trying to create the same outputs in Mathematica and Matlab, however I am running into trouble aligning the eigenvectors with the eigenvalues, I think the Matlab is doing something slightly more ...
1
vote
0answers
136 views

Stationary phase approximation for an integral with infinity saddle points?

I need a hand with the numerical evaluation, in Mathematica, for this integral: $$f(t)=\int_{-\infty}^\infty Exp\{it(\omega_H-\omega_l-\omega_k) - \sum _{j\neq(l,k)} S_j [1-e^{-it\omega_j}]\}\, dt$$ ...
2
votes
1answer
312 views

A programming model for Quantum Mechanics angular momenta in Mathematica

I'm writing prototypes for solving the Liouville Equations with Mathematica and C++. Perhaps the question about this may not be suited for this forum in a strict way, but it suits the people here ...
1
vote
0answers
50 views

Malliavin Derivative with Mathematica is it possible? [closed]

From mathematica.stackexchange: Is it possible to define a Malliavin calculus with Mathematica 9? Consider a random variables on the Wiener-space $\Omega=\mathcal{C}([0,1])$ of the form $$F=F(\...
5
votes
1answer
2k views

Laplace's equation problem in Polar Coordinates (Edit)

Is there public code in Matlab for solving the Laplace equation in polar coordinates in a circular domain? I tried a lot but my level of Matlab and Mathematica is not good enough, but still not ...
7
votes
2answers
514 views

Numerical Green functions for a nonlinear wave equation

I am trying to put down some code to get numerically the solution of the following PDE: $$ \partial^2_t\phi-\partial^2_x\phi+\lambda\phi^3=\delta(x)\delta(t). $$ Of course, there are several ...
2
votes
2answers
312 views

Numerical solution of fractional integro-diffrential equ. using collocation method?

problem comes from "Numerical solution of fractional integro-differential , equations by collocation method , E.A. Rawashdeh, Department of Mathematics, Yarmouk University, Irbid 21110, Jordan" $D^...
5
votes
3answers
9k views

Solving two coupled non-linear second order differential equations numerically

I have encountered the following system of differential equations in lagrangian mechanics. Can you suggest a numerical method, with relevant links and references on how can I solve it, and the ...
4
votes
2answers
2k views

Implementing a finite difference method in Mathematica

I am trying to iterate the following equation $$ x_{k}(n+1)=x_k (n)-\epsilon (x_{k+1}(n)-2x_k(n) +x_{k-1}(n))+\sqrt{\epsilon}\; \eta_{k}(n) $$ where $n$ denotes which time step I'm on and $k$ is the ...
4
votes
1answer
72 views

Migdal Recursion and Mathematica

I am studying $SU(2)$ lattice field theory, and I am attempting to use migdal recursion for renormalization. The main equation for Migdal recursion for my case is $$e^{-S_p(U,\lambda a)}=\left[ \...
2
votes
2answers
42 views

The region of allowed values ​​for solving the equation in Mathematica

In[2]:= Solve[sqrt(2x-9) == sqrt(4x+3), x] Out[2]= {{x -> -6}} But mathematically there is no solution, since sqrt (-21) is not defined. There is a flag that ...
12
votes
1answer
834 views

Replacing Mathematica's QuasiMonteCarlo integration in C++

I have a Mathematica program which performs some integrals in 3 or 4 dimensions using the QuasiMonteCarlo method. The problem is, it takes an annoyingly long time ...