The Stack Overflow podcast is back! Listen to an interview with our new CEO.

All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
49 views

Remove +0Is from Root function

I'm trying to find the zeros of the eigenvalues (functions of $k_x$) of a self-adjoint $4\times4$ matrix H: ...
1
vote
1answer
73 views

WhenEvent error in NDSolve ODEs

I wish to change the term, T'[t] to 0 when S[t]<=0 when I solve ODEs. I have used WhenEvent in my NDSolve part, but it seems not work. The code is ...
0
votes
0answers
67 views

Calculating forces on a truss

I need to find certain forces of the truss shown above, and I am asked to calculate the forces with a matrix. The given values are ...
5
votes
1answer
289 views

Integrating Hamilton's equations for the Schwarzschild metric

Part 1 I am trying to integrate Hamiltons equations for the Schwarzschild geometry using NDSolve, these equations must all be integrated simultaneously and are nice ODE's. A similar task is done in ...
3
votes
1answer
412 views

Interpreting Mathematica code on black holes

I am trying to understand the code written down on page 7 of this document (code is in Mathematica) I understand pretty much all of the code on the previous page needed to setup the page 7 code (...
0
votes
0answers
88 views

Solving a differo-integral equation [duplicate]

I've the following equation for x(t): $$x'(t)\cdot\text{a}+\text{b}\cdot\frac{x'(t)}{x(t)+\text{c}}+\frac{\partial}{\partial t}\left\{\int_0^tx(\tau)\cdot\mathcal{...
0
votes
1answer
68 views

Finding the minimum points of a discrete trigonometric equation

Basically I'm trying to solve the equation $$A\Big(\sin(\theta_a-\theta_{a+1}) + \sin(\theta_a-\theta_{a-1})\Big) + B\Big(n_a^z \sin(\theta_a) - n_a^x \cos(\theta_a)\Big) = 0$$ subjected to the ...
4
votes
1answer
321 views

Solving the eigenvalue problem for a double well potential using a 1D particle in a box as a basis set

My first question is how would I go about getting the 1D particle in a box eigenfunctions using matrix techniques and how would I use the particle in a box eigenfunctions as a basis set for the ...
0
votes
1answer
35 views

NSolve cannot work with MinValue?

I am trying to solve the following problem: find the smallest value of $b$ such that the inverse of the solution u[p] given by ...
1
vote
1answer
68 views

Taking the limit of a parametric function produced by ParametricNDSolveValue

I'm working on a project for hard-sphere scattering, and to solve the for the phase function $\overline{\delta}_l(k,r)$ I use the variable phase equation $$ \frac{d\overline{\delta}_l(r,k)}{dr} = -\...
0
votes
1answer
52 views

Trying to evaluate NDSolve inside of FindRoot

I want to find the equation for the range of a projectile as a function of its elevation angle at launch. Currently, I am stuck in my effort to calculate the time. What I have doesn't work right ...
8
votes
2answers
227 views

Proper use of NDSolve in the context of the reduced 3 body problem

I am currently trying to solve the reduced three body problem in Mathematica. I have the equations of motion $\ddot{x}-2\dot{y}=-\frac{\partial\Omega}{\partial x } $ $\ddot{y}+2\dot{x}=-\frac{\...
0
votes
1answer
47 views

How can I calculate all of the points of my functional at once and export the results to a file?

I have the following functional, it depends of n, m and U, so I want to automatize the calculations for all the regimes and be able to export it in a way I can copy and the past the values easily. <...
0
votes
1answer
66 views

Add more than one condition to my equation

I have the following code to solve for a bunch of n, m e U, but I need different conditions for n=0 and m=n, already explicit in my code, but I don't know how to make it work. I know I have to make it ...
1
vote
1answer
258 views

Finding intersection points from contour plot

The Left hand side of the equation has only real part. But the right hand side has real and imaginary parts. So i am using a contour plot. The intersection of lefthand side and righthand side of ...
4
votes
2answers
262 views

Solving a nonlinear system of ODE with DSolve

I have been trying to solve the following system of ODE with initial values using the function DSolve. My code is : ...
5
votes
1answer
406 views

Position dependent Neumann condition on boundary mesh

I am trying to solve Laplace equation over a time-dependent region using cylindrical coordinates. My system is independent of the angle coordinate, and so the equation looks like: The region ...
3
votes
0answers
395 views

Solve PDE over time-dependent region

I have some experience with C++ programming, but I am quite new to Mathematica and I think the latter requires a different mindset which I am still not used to. I would like to simulate the effect ...
6
votes
1answer
747 views

Solving the nonlinear Cahn-Hilliard equation

I am trying to solve the Cahn-Hilliard equation with a "random" initial condition and boundary conditions as described below: $$h_t = \nabla^2\left(-\gamma \nabla^2 h + h^3 - h\right)$$ Boundary ...
1
vote
0answers
83 views

Dynamical Evaluation error and infinite loop? [closed]

I'm trying to set up a solver to solve for the chemical potential given the constraints (particle number and magnetization). The function MuandShift finds the ...
12
votes
3answers
501 views

NDSolve's output ignores multiple valid solutions

I'm looking for solutions to a boundary problem involving a non-linear Hamiltonian $$ H(q,p) = \frac{1}{4}\left(q^{2}+p^{2}\right)^{2}, $$ whose solutions are oscillatory but have a complex time ...
3
votes
2answers
967 views

How to solve time dependent pde?

I have set out to try and solve a time dependent wave equation with specific boundary conditions, but I am running into a bit of a snag. As you can see, I am trying to solve for the wave function u[t, ...
2
votes
1answer
1k views

Why does the integral not converge?

I am trying to solve for $\Omega$ this nonlinear integral equation: $$1+\dfrac{z}{k^2}-\dfrac{z^2}{K_2(z)} \dfrac{\Omega}{k^3} \displaystyle\int_{1}^{\infty} \gamma^2\, \text{ArcTanh} \left(\sqrt{\...
4
votes
1answer
102 views

Recycle boundary condition

I'm having the following issue that can not find a solution , by using this boundary condition u[0, t] == 2 u[1, t] that Mathematica does not understand, someone ...
0
votes
2answers
240 views

Free-fall air resistance problem

I´m working on a free fall problem and I got an equation with variable $k$ when the situation has air resistance. Then I compared with no air resistance equation ($-4.9$, considering t variable). So, ...
0
votes
1answer
91 views

Solve returns empty list on system of 62 linear equations with undeclared known variables

Context: I am trying to solve a set of equations generated by hand from a complicated, but not particularly strange system via Newton's Second and Third Laws, and a few constraints. All the resulting ...
9
votes
3answers
569 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
5
votes
2answers
526 views

Solve numerical differential equations at `t->Infinity`

I have a first order non-homogeneous system of differential equation (100+ equations, so no hope to solve them analytically, due to the Abel–Ruffini theorem). If I solve them using ...
4
votes
2answers
2k views

Solve 2D diffusion equation in polar coordinates

I am trying to solve the diffusion equation in polar coordinates: $\frac{\partial u}{\partial t} = D \left( \frac{\partial^2 u}{\partial r^2} + \frac{1}{r} \frac{\partial u}{\partial r}\right)$ ...
2
votes
1answer
921 views

How can I use Mathematica to solve a Stefan Problem using an explicit scheme?

I would like to plot the temperature distribution for a particular case. the problem is stated in the paper, behind a paywall here, summarized as Consider a one-dimensional container of length l, ...
13
votes
3answers
892 views

Time evolution/dynamics of circular plate with hole (Biharmonic equation and stiffness)

On this Mathematica.SE form, there exists information on how to use Mathematica to demonstrate the vibration of a circular membrane and the deflection of an orifice plate (the latter I had raised ...
5
votes
1answer
253 views

Help needed for understanding NDSolve architecture -Vacuum Heating Simulation

I am a beginner in mathematica and I am facing a problem that is way bigger than my knowledge.. I am tryng to simulate a semplificated version of Brunel Effect, wich is a Laser-Plasma interaction ...
8
votes
1answer
945 views

Potential flow over cylinder with FEM: Pressure field is flipped

Much in the fashion of a few problems already answered on Mathematica.SE (1, 2), I am trying to solve the Laplace equation in velocity potential $\phi$ to simulate irrotational, inviscid flow over a ...
0
votes
1answer
182 views

Find all degenerate eigenvalues of a cubic equation

I have an equation that is cubic in w. The three solutions correspond to bands in a bandstructure, and are a function of wavevector ...
7
votes
3answers
465 views

Finding the conditions for degenerate solutions to a cubic equation

I have a cubic equation (corresponding to the band structure of a physical system) given by w in the code below. ...
12
votes
1answer
605 views

Synchrotron Radiation and ListDensityPlot

I'm trying to reproduce the following plots: As described by this blog entry: Synchrotron radiation As you can see in the linked article, the task is essentially to make a ...
3
votes
0answers
258 views

How can I improve the solution of my PDE?

I want to improve the last code to find a better solution for umi. For now I'm using only MaxStepFraction. Also, when I put no ...
1
vote
0answers
227 views

Tracking solutions over a Brillouin zone

Thanks to @bbgodfrey I have a function that finds the two solutions to a set of equations bounded by a hexagonal region (corresponding to the Brillouin zone). It takes the angle ...
8
votes
1answer
633 views

Diverging solution to coupled second order ODEs from NDSolve

For a physics application I am considering the radial Bogoliubov-de Gennes equations in two dimensions. In dimensionless form they read as follows $$ \begin{cases} \bigg[\frac{1/4-m^2}{r^2}+2(E-1)\...
1
vote
1answer
514 views

NSolve fails to solve a nonlinear equation

Mathematica can not solve this: g = 9.82; ω = 0.5; h = 5; y0 = 1; v = 0; τ = 0; NSolve[h + v t - (g t^2)/2 == y0 Sin[ω t], t]; The error code is: NSolve::...
12
votes
3answers
1k views

1D quasicrystal: points on a line nearest to points on a lattice

I have a simple lattice / line manipulation: ...
18
votes
3answers
1k views

How can I simulate this toggle mechanism?

I've been introduced to Mathematica very recently. Basically, I haven't actually "solved" anything in my Mathematica lifetime, but I've done some simulations. With my fractional knowledge, I tried ...
5
votes
1answer
591 views

How to find the roots of an equation which is almost singular everywhere

I'm trying to find the roots of the equation as a variable of k: ...
46
votes
5answers
20k views

Find eigen energies of time-independent Schrödinger equation

I'm trying to get the eigenvalues of a one dimensional time-independent Schrödinger equation, $-\frac{h^2}{2m_0}\frac{d^2\psi}{dx^2}+U(x)~\psi=Ei~\psi$ where U(x) is some potential and Ei is the ...
36
votes
2answers
3k views

The Orbit and Perigee of the Flamsteed comet

Historical context This year we have the 330-th anniversary of the Battle of Vienna - one of the great formative events of European history, it took place on September 12, 1683. Kara Mustafa, Grand ...
1
vote
2answers
400 views

Reduce on equations involving integrals

Here's part of problem from a college physics text: A time-dependent force F = (8.00 i - 4.00 t j) N (where t is in seconds) is applied to a 2.00-kg object initially at rest. (a) At what time ...
7
votes
1answer
2k views

Efficient implementation of cubic equation of state

...In this case the Peng Robinson Equation of State. Equations of state are empirical equations with parameters derived from experimental data. They are used to predict pure component and mixture ...