Summary: different methods give different results. They are not consistent.
Summary: different methods give different results. They are not consistent.
I use two different methods to detect whether a matrix is singular. The result of calculating the determinant of a 9-order square matrix is...
Hi PF
The following ODE
$$\ddot x + x - x^3 = 0\\
x(0)=0,\,\,\,\dot x(0) = \frac {1}{ \sqrt 2}$$
is solve exactly with ##\tanh (t/\sqrt 2)##. However, when I try to solve this with MATLAB ode45 (ode23t looks identical) or Mathematica NDSolve I get an oscillatory numerical solution (see...
So as stated, I am calculating the pressure and drag forces on an obstacle, but have trouble with which velocities to take. This is my geometry: http://shrani.si/f/3l/13P/2Tihb3iM/projekt2.png . I am guessing that I have to take pressure just before the obstacle and just after the obstacle and...
Just finished my Bs.c with a minor in CS. At the end of my degree I did a reserch project where I numerically solved a nonlinear PDE and enjoyed the numerical simulation work. What is the best path to do similar work in the industry? I don't mind simulating models from outside of physics, such...
Dear all,
For an assignment, I am trying to find the relationship between the Sherwood number and the Reynolds number in a channel for different laminar velocity profiles, where there is a concentration of a species at both the top and bottom wall which is transported to the fluid. For this, I...
As part of my project I was asked to use the finite difference method to solve Schrodinger equation. I see how you can turn it into a matrix equation, but I don't know how to solve it if the energy eigenvalues are unknown. Are there any recommended methods I can use to determine those...
In fact I'm working on a condensed matter physics paper, where I stumbled with an integral that I need to visualize.
The function, Ls I need to visualize is equal to:
$$Ls=4\nu^4 \dfrac{\int_{-1}^{1} \dfrac{( 1-u^2)}{(u+\sqrt{u^2-\nu^2})^3} \, du}{\int_{-1}^{1}-u \Big...
With respect to the following posts from a now closed thread,
https://www.physicsforums.com/threads/copenhagen-restriction-on-knowledge-or-restriction-on-ontology.968982/post-6169047...
Consider an integral of form $$\int_a^b dx f(x) g(x).$$ Is it possible to tell a numerical integrator to spit out the value of ##x \in [a,b]## that maximises the value of ##f(x)g(x)##? I'm mostly interested in incorporating this into some code I have for adaptive integrator gsl_qags in C++...
Homework Statement
[/B]
Design an afocal Keplerian telescope to imagine an object of ##L = 5\, mm## with a resolution of ##R = 2\, \mu m## and a magnification of ##M=-2##; assume that the wavelength is ##\lambda = 500\, nm##.
Don't use lenses faster than ##F/1##.
Using the optical invariant...
Hello. I need help to understand why my code is not giving me double numerical precision.
In this piece of code, I create a function that is analytically normalized, but when I calculate the numerical normalization factor, it seems to be with single precision. Here it is:
program dyna...
Homework Statement
I need calculate the points (##x_i##) and weights (##w_i##) with Gauss Lobatto seven points on the interval [a,b]. With the points and the weights I am going to approximate any integral at this interval.Homework Equations
I have found the relevant points and weights at the...
When estimating an integral using trapezoidal approximation, we can find the error or uncertainty in the estimation by:
##Error~in~T_n \leq \frac{M(b-a)^3}{12n^2}## where ##M## is the maximum value of the absolute value of f''(x) over [a,b], ##n## is the number of intervals, and ##T_n## is the...
Hello,
I am contacting you because I would like to know if there is a way to simulate quantum loop theory. Indeed, the S-Knots are much more complex objects than graphs because between the points there is a curve that can be knotted. S-Knots are graph embeddings in 3D and I do not see how such...
Hi,
I am trying to figure out how to solve the Mukhanov equation numerically in Mathematica, but have some problems dealing with it. In terms of the number of efolds, the Fourier modes satisfy the following ODE in terms of the Hubble slow roll parameters:
$$...
Hi PF!
The following function is long but only 3 command lines: first defines the function ff, second numerically integrates the function, and third plots the function. As you'll see the integral is zero yet clearly that is not the case (seen from the plot). Any idea what's happening?
ff =...
Greetings,
I am desparately trying to solve a double integral via Monte Carlo integration. I integrate over two probability densities, the Beta distributions. Python can easily draw samples from these densities and calculate its function values. The integral can be seen here:
Now my idea was...
Hello,
I try to solve a system of ODE's by Runge-Kutta method from here: https://websites.pmc.ucsc.edu/~fnimmo/eart290c_17/NumericalRecipesinF77.pdf, page 704 in the book (not pdf). Bellow is also a code. In function rk4dumb I don't understand how are implemented differential equations. Input...
I am very new too Matlab and how it all works but I am having trouble understanding at what axis the numerical integration is occurring from on the graph that I plotted.
So I am currently doing an experiment in gamma ray spectroscopy and due to issue with the software we found it hard to...
the problems/challenges that you have to face daily are mostly related to code issues with the physics itself?
Is there room to improve our knowledge of fundamental physics while working on it?
Do you enjoy doing it? why?
I'm asking this because I'm considering working on numerical relativity...
Hi PF,
Suppose I numerically solve a nonlinear system of differential equations. How can I know if my solution is correct (if there is no known analytic solution)? What are the standard practices people do? I have a couple of ideas, but I want to know what people are already doing.
Danke!
Hi PF!
Let's say a boundary condition for an ODE is ##f'(1)+f(1) = 0##. If we solve the ODE numerically, how can I tell if this BC is satisfied "good enough". Let's suppose the numerics generate ##f'(1)+f(1) = 0.134##; is this close enough to zero?
I want to find the numerical solution to the following nested integral in Python
\frac{K!}{(K-M)!}\int_{x_1=0}^{y}\int_{x_{2}=x_1}^{\max(x_1,\,y-x_1)}\cdots
\int_{x_M=x_{M-1}}^{\max(x_{M-1},\,y-\sum_{m=1}^{M-1}x_m)}
\frac{1}{(1+x_M)^{K-M+2}}\prod_{m=1}^{M-1}...
Hello all,
I may get a contract to teach numerical analysis. I did quite a lot of numerical work during my PhD but that was a while ago. Now when I look at most books on the topic, I get the feeling that a lot is outdated, and I also feel that a lot of what I knew is outdated as well...
I am using the "knife-edge" technique to find the intensity profile of a rectangular laser beam. The data that is obtained using this method is power, the integral of intensity. Therefore, to get the intensity profile we must differentiate the data.
So, as expected, my data looks like a ramp...
Hi. I was trying to test a code for the diffusion equation, using the analytical solution for infinite media, with a Dirac delta source term:
##q(\mathbf{r},t)=\delta (\mathbf{r}) \delta (t)##.
The code is not giving the analytical solution, and there might be several reasons why this is so...
Hi,
I am trying to evaluate the following integral numerically in MATLAB
\int_0^{\infty}\frac{e^{-jt}E_1^2(-jt)}{t}\,dt
where ##j=\sqrt{-1}##, and ##E_1(x)## is the exponential integral.
My code is
fun = @(x) (exp(-1i*x).*(expint(-1i*x)).^2)./x;
q = integral(fun,0,Inf)
but I get the...
Hello,
I am trying to refresh my knowledge, and so I dug out my copy of Marion and Thornton to look through. I came across an example problem, 10.2, that involves a hockey puck sliding on a flat, frictionless and rotating surface. The example problem shows some solution plots for the puck...
So I want to write a short code to solve the diffusion equation and I want to be lazy and use the gradient function for the spatial differences, so for the second order derivative:
\frac{f(i+1)-2*f(i)+f(i-1)}{h^{2}}=\textrm{gradient}(\textrm{gradient}(f,h),h)
So the code I wold use is...
Hi there.
I have a question about the damped pendulum. I am working on an exercise where I have already numerically approximated the solution for a simple pendulum without dampening. Now, the excercise says that I can simply change the code of this simple situation to describe a pendulum with...
It's rare to encounter concrete, numerical examples of what is being taught about Relativity, Quantum Mechanics.. On the other hand there's plenty of numerical examples in the undergraduate general physics textbooks, for instance problems of mechanics.
As for General Relativity I did find only...
I have the pdf of a random variable found from the characteristic function given by
f_X(\alpha)=\frac{1}{2\pi}\sum_{m=0}^Mj^m{K\choose m}\int_0^{\infty}e^{-jt(m+\alpha)}E_1^m(-jt)\,dt
where ##j=\sqrt{-1}## and ##E_1(x)## is the exponential integral. I need to find the CDF of the random...
Hi PF!
I am trying to compute ##d_t y = d_x u^2##. Following standard RK4 procedure outlined by wikipedia as https://en.wikipedia.org/wiki/Runge–Kutta_methods
I am forced to compute ##k_2##. If the RHS is analytic, the fractional stepping is direct. However, the RHS gradient is finite...
Hi everyone. My book (Smith's "An Introduction to Goedel's Theorems") defines the numerical domain of an algorithm as the set of naturals that, when input individually to the algorithm, result in its "working", that is to terminate and output some result. In the book it is also stated that any...
Homework Statement
∫ e1000((sinx)/x) dx [0 to 1000 : bound of integration]. Solve this integral of a sharply peaked function without a calculator.
Homework Equations
I'm doing this in relation to statistical thermodynamics - I think I need to use Sterling's Approximation or a gamma function...
Whilst studying symplectic integrators (as a hobby!) I accidentally stumbled on http://www.maia.ub.edu/~angel/taylor/taylor.pdf, which contains a link to GPL source code for the method described. I found it fascinating, especially since searching around the topic (Taylor Series Methods)...
The literature mentions "functions that are effectively computable in the informal sense". What is meant by that? It would be helpful to have an example involving "informal sense" vs. "formal sense" for some numerical function.
All help appreciated. am
Hi all, I am new to the Maplesoft software and have been experiencing trouble computing numerical integrals.
I defined a few mathematical functions in terms of a few variables like so:
I then used "subs" to input values to anything that isn't already a defined constant (like ##\hbar,\pi## and...
Homework Statement
Suppose we have the standard rectangular potential barrier in 1D, with
$$
V =
\left\{
\!
\begin{aligned}
0 & \,\text{ if } x<0, x>d\\
V_0 & \,\text{ if } x>0,x<d\\
\end{aligned}
\right.
$$
The standard approach to solve for tunneling through the barrier is to match the...
Suppose I have some experimental data on the diffusion of some concentrate into a cylindrical medium. I don't a priori know the initial concentration or diffusion constant. I have some code to solve the PDE given in the cylindrical domain which solves the equation for given initial...
As neural networks are 'universal approximators' for nonlinear functions, in general how do they perform in comparison to traditional numerical methods for nonlinear PDEs? Just googling, I can find papers on applications to Navier Stokes and other problems, but I don't really have the...
Hello everyone,
I've encountered a bit of an interesting problem; a 6th order PDE in 2D + time resulting from a phase-field type physics model (mathematically it comes from a mass conservation equation (two orders)coupled to the Euler-Lagrange equation for variational calculus when the function...
I have defined a series of functions below with the end function `fA` being inserted for a numerical integration. The integration is with respect with one variable so the other arguments are passed as numeric so that the integration method (quad) may proceed
import numpy
import...
So in my future numerical analysis class the recommended book i liked the most was Numerical mathematics by Quarteroni :
https://books.google.pt/books/about/Numerical_Mathematics.html?id=m-bHBAAAQBAJ&printsec=frontcover&source=kp_read_button&redir_esc=y#v=onepage&q&f=false
Since i like this...
I was wondering if anyone has worked with non-Hermitian wavefunctions, and know of an approach to derive real and trivial values for their observables using numerical calculations?
Cheers
I'm a bit lost in all the numerous methods for solving differential equations and I would be very grateful if someone could point me to some direction.
I want to solve the following boundary conditioned differential equation:
$$a_1+a_2\nabla f(x,y)+a_3\nabla f(x,y)\cdot \nabla^2...
Hi PF!
Suppose I have two functions ##f(x),\,g(y)## that are numerically defined as vectors (i.e. ##g(y) = [0,1,4,9,16]:y = [0,1,2,3,4]## and say ##f(x) = [0,1,8,27,64]:x = [0,1,2,3,4]##) and am trying to compute $$\int_0^1 f(x) \int_x^1 g(y)\, dydx.$$
How would I do this in MATLAB? I could be...