Questions tagged [numerical-analysis]

Numerical analysis is the study of algorithms that use numerical approximation, as opposed to general symbolic manipulations.

263 questions
0
votes
1 answer

Use a function integral( f ) which computes the integral of f over [0,1] to compute the integral of f over any interval

How to use a (hypothetical) routine integral( f ) which computes the integral of function f over [0,1] to compute the integral of f over any interval [a,b]? If I wanted to change the interval of integration I would use the following substitution: y…
0
votes
0 answers

Representation of 1 + 2.0^-24

Im trying to figure why the number 1 + 2.0^-24 in single arithmetic precision is stored as 1.0 instead of 1 + 2^-23 since we can check that 1 + 2.0^-24 - 1 + 2^-23 = 2^-24 and 1.0 + 2.0^-24 - 1.0 = 2^-24 and 1.0 and 1.0 + 2^-23 are two closet…
whd
  • 1,819
  • 1
  • 21
  • 52
0
votes
1 answer

Machine epsilon multiplication

I am trying to get a better understand of floating point arithmetic. I know machine epsilon (e) is define as the difference between 1 and the next largest number (i.e. the next largest number after 1 that can be accurately represented in floating…
bnorm
  • 399
  • 2
  • 16
0
votes
1 answer

adding bounds to code, matlab

I am trying to add bounds to the code but having troubling figuring out where to put them. The equation goes: f(x) = e^(6x) + 1.441e^(2x) − 2.079e^(4x) − 0.333 = 0, -1>=x<=0 function c = newton(x0, delta) c = x0; fc = f(x0); …
0
votes
1 answer

Not getting results for a finer mesh/grid

Is it possible that a particular scheme (MAC in this case) gives accurate results for one grid size but inaccurate/no results for finer grid size or finer mesh? If yes, then how or why?
0
votes
0 answers

Java- What is the preferred method for numerical integration?

What is the preferred method for solving problems through numerical integration? The specific function I am looking to perform numerical integration on is integral_0^infinity (sin(s tan^(-1)(t)))/((1+t^2)^(s/2) (e^(pi t)+1)) dt Writing this in…
0
votes
1 answer

Comparing the accuracies of different numerical gradients?

Suppose that I have a function double f(vector &x) { // do something with x return answer; } Mathematically, f is a continuous function with respect to each component of x. Now I want to evaluate the numerical gradient of x. There are…
Hieu Pham
  • 97
  • 1
  • 8
0
votes
0 answers

adaptive quadrature implementation in Octave - out of bounds error

I'm trying to implement and adaptive quadrature algorithm using recursion in Octave, and I'm getting an array out of bounds error that doesn't quite make sense to me. function integral = adaptive(f, a, b, TOL, count) max_count = 20; h =…
0
votes
1 answer

Numerical error in cuda/cublas simple kernel using particular input

I am working with cuda and cublas and I was trying to implement simple operations like matrix element-wise multiplication/division. I am using only float for my experiments. I know the most obvious way to do it is to write a kernel like this…
gr1ph00n
  • 65
  • 3
  • 10
0
votes
1 answer

segment fault on programming C

I am tyring to make velocity Verlet method, by using C language. I thought I made it good. However, there pops up 'Segmentation fault(core dumped)' whenever, I increase the size of the vector or array, x and y. For the size n equal and less than…
supergentle
  • 1,001
  • 1
  • 14
  • 33
0
votes
1 answer

Gauss-Newton Solver: Improper assignment with rectangular empty matrix

I don't understand why I am getting this error message. I have implemented a Gauss-Newton solver to solve a system of linear equations. It keeps saying improper assignment with rectangular empty matrix at the line "for i=1:m" function [x, l] =…
0
votes
1 answer

Composite Simpson's Rule

I have this code for the Composite Simpson's Rule. However, I have been fiddling with it for quite a while and I can't seem to get it to work. How can I fix this algorithm? function out = Sc2(func,a,b,N) % Sc(func,a,b,N) % This function calculates…
0
votes
3 answers

Convergence of BFGS for convex over-parameterized problems

It is "well-known" that the BFGS optimization algorithm is superlinearly convergent for strictly convex problems, but is there any analysis for problems that are non-strictly convex. For example, suppose that f(x) is convex for some scalar x. …
0
votes
2 answers

algorithm quadratic equation MATLAB

What condition should I put in code of matlab so that get the exactly solutions of a quadratic with these formulas: x1=(-2*c)/(b+sqrt(b^2-4*a*c)) x2=(-2*c)/(b-sqrt(b^2-4*a*c)) Directly implementing these formulas I don't get the correct solution…
Oriol Prat
  • 1,017
  • 1
  • 11
  • 19
0
votes
1 answer

Implementation of GNU Scientific Library?

Does anyone know a collection of articles or books that describes the implementation of the GNU Scientific Library? This question is not about using the GSL; it's about how the GSL is implemented, their design decisions / tradeoffs. Thanks!
anon
  • 41,035
  • 53
  • 197
  • 293