Numerical Definition and 775 Threads

  1. N

    How to judge the singularity of a matrix in numerical method?

    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...
  2. M

    I ODE Fail: Numerical Solution Oscillations - Possible Solutions | Hi PF

    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...
  3. J

    Calculating drag and pressure forces from numerical simulations

    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...
  4. B

    Physics Jobs in numerical simulations with a BSc in Physics?

    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...
  5. B

    Mass transfer coefficient from a numerical model

    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...
  6. patrykh18

    I Numerical solution to the Schrodinger eqn. using Finite Difference Method

    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...
  7. pj96

    Help with Numerical Problem: Pointers Needed!

    I'm really stuck on this and have no solution only a numerical answer! Any pointers in the right direction would be really appreciated!
  8. amjad-sh

    Numerical method to solve an integral that contains a singularity?

    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...
  9. A. Neumaier

    I Numerical simulations in Bohmian mechanics

    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...
  10. C

    Value of x that maximises the integral in a numerical integrator

    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++...
  11. M

    Numerical aperture of a Keplerian telescope

    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...
  12. Cayo

    Fortran Help with fortran numerical precision

    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...
  13. S

    Numerical integration - Gauss Lobatto

    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...
  14. opus

    I Determining an n for Numerical Integration

    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...
  15. kroni

    A Simulating Quantum Loop Theory: Can S-Knots Be Represented Numerically?

    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...
  16. Rafid Mahbub

    A Numerical solution of the Mukhanov-Sasaki equation

    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: $$...
  17. Delta2

    Insights A Numerical Insight for the Fundamental Theorem of Calculus - Comments

    Greg Bernhardt submitted a new blog post A Numerical Insight for the Fundamental Theorem of Calculus Continue reading the Original Blog Post.
  18. M

    Mathematica Why is the Numerical Integration Resulting in Zero for a Non-Zero Function?

    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 =...
  19. SchroedingersLion

    Python Solving Double Integral with Monte Carlo Integration

    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...
  20. V

    Fortran Runge-Kutta using Numerical Recipes

    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...
  21. T

    MATLAB Numerical approximation of the area under curve

    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...
  22. M

    Physics How is it to work in numerical relativity?

    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...
  23. M

    I How can you know if a numerical solution is correct?

    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!
  24. Ziezi

    Discrepancies between numerical and analytical solutions

    The analytical solutions are: \begin{equation} \psi(x) = \begin{cases} Ce^{\alpha x}, \text{if } x < -\frac{L}{2}\\ Asin(kx) + Bcos(kx), \text{if } -\frac{L}{2} \leq x \leq \frac{L}{2}\\ Fe^{-\alpha x} , \text{if } x > \frac{L}{2} \end{cases} \end{equation}...
  25. M

    I Metric for knowing when numerical BC is "good"

    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?
  26. E

    Python Numerical Integration in Python

    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}...
  27. N

    Your thoughts on numerical analysis teaching

    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...
  28. R

    I Smoothing Numerical Differentiation Noise

    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...
  29. Telemachus

    Correct numerical modeling of the 3D Dirac Delta function

    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...
  30. E

    MATLAB What does a maximum number of intervals warning mean in numerical integration?

    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...
  31. D

    I Help getting started with a numerical solution

    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...
  32. H

    MATLAB A lazy numerical solution to the diffusion equation

    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...
  33. M

    Coding a numerical approximation for a damped pendulum

    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...
  34. K

    B Lack of Numerical Examples in Relativity & Quantum Mechanics: Exploring Reasons

    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...
  35. E

    MATLAB How Can I Perform Double Numerical Integration in MATLAB or Mathematica?

    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...
  36. M

    A Efficient Computation of k2 in RK4 for Numerical RHS | PF Discussion

    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...
  37. A

    MHB What is the Numerical Domain of an Algorithm and How is it Determined?

    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...
  38. S

    Numerical integration of sharply peaking functions

    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...
  39. m4r35n357

    I Is this numerical techique for solving ODEs widely known?

    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)...
  40. A

    MHB Formal vs. informal - Numerical Functions

    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
  41. W

    Maple Computing Numerical Integrals with Maple

    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...
  42. C

    (Numerical) Boundary Value Problem for Schrodinger's Equation

    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...
  43. H

    MATLAB Parameter fitting with a numerical solution

    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...
  44. BWV

    I Neural Networks vs Traditional Numerical Methods

    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...
  45. H

    A Numerical solution techniques for 6th order PDE's

    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...
  46. C

    Python Numerical integration 'quad' error

    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...
  47. J

    Applied Numerical Analysis book question

    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...
  48. SemM

    I Non-Hermitian wavefunctions and their solutions

    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
  49. Dor

    A Numerical solution for a two dimensional 3rd order nonlinear diff. eq.

    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...
  50. M

    MATLAB Numerical Integration with variable limits MATLAB

    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...
Back
Top