Questions tagged [numerical-methods]

Algorithms which solve mathematical problems by means of numerical approximation (as opposed to symbolic computation).

Numerical methods include the study of algorithms that use numerical approximation (as opposed to general symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). Numerical methods naturally find applications in all fields of science and engineering, and include implementations of many important aspects of computation including: solving ordinary and partial differential equations, numerical linear algebra, stochastic differential equations, Markov chains, and so forth.

Numerical methods use several approaches to calculate observables. For example, iterative methods that form successive approximations that converge to the exact solution only in a limit. A convergence test, often involving the residual, is specified in order to decide when a sufficiently accurate solution has (hopefully) been found. Examples include Newton's method, the bisection method, and Jacobi iteration. Another example is the use of discretization, a procedure that is used when continuous problems must sometimes be replaced by a discrete problem whose solution is known to approximate that of the continuous problem.

The field of numerical methods includes many sub-disciplines. Some of the major ones are:

  • Computing values of functions

  • Interpolation, extrapolation, and regression

  • Solving equations and systems of equations

  • Solving eigenvalue or singular value problems

  • Optimization

  • Evaluating integrals

  • Differential equations

2104 questions
0
votes
0 answers

different errors in rjava usage

This question might be asked but I have been working on it for the whole day and I didn't solve and understand the other solutions. Until today my code was clearly working. I didn't change anything however today in the same code I got different…
sessen
  • 3
  • 3
0
votes
0 answers

Solving differential equations in two different domains using the bvp solver in python

I am trying to solve the following set of coupled differential equations ( variables are p,n and psi) using the bvp solver in python :- 1. d2n/dx2-(d2psi/dx2)n-(dpsi/dx)(dn/dx)=k1 in domain 1 2. d2p/dx2+(d2psi/dx2)p+(dpsi/dx)(dp/dx)=k2 in domain…
0
votes
0 answers

Logistic Regression in Scipy optimization problem TNC vs CG

I'm doing the Coursera Machine Learning MOOC by Andrew Ng Exercise 2: Logistic Regression in Python here: https://github.com/dibgerge/ml-coursera-python-assignments/blob/master/Exercise2/exercise2.ipynb I have worked through all the logistic…
0
votes
1 answer

comparison of analytical derivative and approximative derivatives of a sine function

I try to compare the analytical derivative of a sine function and approximative derivative using backward,forward,central,3.order backward difference method.I have huge difference between them. It must be mistake. Could you give me a hint where I…
alimuradpasa
  • 135
  • 1
  • 10
0
votes
1 answer

How to understand this efficient implementation of PageRank calculation

For reference, I'm using this page. I understand the original pagerank equation but I'm failing to understand why the sparse-matrix implementation is correct. Below is their code reproduced: def compute_PageRank(G, beta=0.85, epsilon=10**-4): …
0
votes
1 answer

Finding a solution of a differential using the Euler method in python

I am trying to find the solution of a differential equation at a point using the Euler method but I am getting a wrong answer. See my code below: #Intial conditions x0, y0 = 0, 1 h = 0.1 #step size x_end = 1.0 #the value of x for which we want to…
0
votes
1 answer

rounding, logical error in approx.df in R Program

I am trying a solve a question. When I run this code I achieved what did I want.(.8372e-03 1.8372e-06 1.8372e-09) truncation.error <- function(f, x) { steps <- c(0.1, 0.01, 0.001) n <- length(steps) fdx1 <- vector(length = n) for (h in…
0
votes
0 answers

Finding max- average error in R programming

It's a simple question but I can't seem to figure it out. I have a data set. I found the least-square line .when I write summary(lm(data_y~data_x)) I can find std.error but I don't know how to find max error or average error in R programming. Is…
sessen
  • 3
  • 3
0
votes
0 answers

Solving a linear system with the Gauss method returns wrong results

Thank you guys, all your advices are relevant, but I gave up of Fortran and translated my code to Python. There, with just 1 or 2 little bugs my code worked perfect I wrote a program to solve a linear system using the Gauss method. I wrote all the…
0
votes
1 answer

Mapping a numerical function with two inputs onto one with one input

I‘m quite bad at programming, so please bear with me. I‘m not even sure what the concept I need right now is called, so i don’t know what to google for or write in the title of this post. My issue is, I numerically integrated a function on…
0
votes
1 answer

Python solve_bvp fourth order differential equation

I'm trying to apply scipy's solve_bvp to the following problem T''''(z) = -k^4 * T(z) With boundary conditions on a domain of size l and some constant A: T(0) = T''(0) = T'''(l) = 0 T'(l) = A So far, I've reduced the fourth order equation to a 1st…
Clemson
  • 478
  • 5
  • 20
0
votes
0 answers

How do i do an error analysis for the numerical approximations of the code?

I want to find the errors that might happen from doing this numerical approximation for the transport equation. I am having a difficult time on calculating the error through programming. I'm pretty new to this and don't understand how I can…
mehek
  • 27
  • 2
0
votes
1 answer

Is it beneficial for precision to calculate the incremental mean/average?

In the question "What's the numerically best way to calculate the average" it was suggested, that calculating a rolling mean, i.e. mean = a[n]/n + (n-1)/n * mean might be numerically more stable than calculating the sum and then dividing by the…
Felix B.
  • 905
  • 9
  • 23
0
votes
1 answer

How to turn this plot into an animation? I have a plot but would like to turn this into an animation somehow

I've been struggling for the last few nights how to turn my waves in the graph here into some sort of animation after each time step or after each x step. How can I modify and write the code so that my program animations each time step of the wave…
0
votes
1 answer

How to come out with this Overflow in my code?

So, im trying to solve an EDO using Bulirsch-Stoer adaptative method, but im getting an overflower warning. How to solve this? from math import sin,cos,pi from numpy import arange, array, empty, shape,float64 import matplotlib.pyplot as…