Numerical analysis is the study of algorithms that use numerical approximation, as opposed to general symbolic manipulations.
Questions tagged [numerical-analysis]
263 questions
3
votes
1 answer
Find the largest x for which x^b+a = a
Stability (Numerical analysis)
Trying to apply the answer I saw in this question, a+x=a worked just fine with a+eps(a)/2. Suppose we have x^b+a=a, where b is a small integer, say 3 and a=2000. Then a+(eps(a))^3 or a+(eps(a)/2)^3 will always return…

GengisKhan
- 65
- 5
3
votes
3 answers
Haskell performance: Struggling with utilizing profiling results and basic tuning techniques (eliminating explicit recursion, etc.)
I took a bit of a long break from playing with Haskell, and I'm starting to get back in to it. I'm definitely still learning my way around the language. I've realized that one of the things that has always made me nervous/uncomfortable when…

Doug Stephen
- 7,181
- 1
- 38
- 46
3
votes
8 answers
Algorithm for multidimensional optimization / root-finding / something
I have five values, A, B, C, D and E.
Given the constraint A + B + C + D + E = 1, and five functions F(A), F(B), F(C), F(D), F(E), I need to solve for A through E such that F(A) = F(B) = F(C) = F(D) = F(E).
What's the best algorithm/approach to use…

avalys
- 3,662
- 4
- 25
- 22
3
votes
1 answer
Adaptive Quadrature (C++)
I'm having issues with my adaptive trapezoidal rule algorithm in C++ -- basically, regardless of the tolerance specified, I get the same exact approximation. The recursion is supposed to stop very early for large tolerances (since abs(coarse-fine)…

Emir
- 481
- 1
- 5
- 15
3
votes
0 answers
matlab fit exp2
I'm unsuccessfully looking for documentation of fit function using exp2 (sum of 2 exponents).
How to operate the function is clear:
[curve, gof] = fit(x, y,'exp2');
But since there are multiple ways to fit a sum of exponents I'm trying to find out…

BioSP
- 518
- 4
- 15
3
votes
1 answer
Abnormal behavior algorithm implemented in matlab depending of the input
I'm doing a homework assignment for scientific computing, specifically the iterative methods Gauss-Seidel and SOR in matlab, the problem is that for a matrix gives me unexpected results (the solution does not converge) and for another matrix…

franvergara66
- 10,524
- 20
- 59
- 101
3
votes
1 answer
is there a way to plot an average in gnuplot?
Suppose I have a file with two columns of data file.dat.
I would normally plot it with
plot "file.dat" u 1:2
I want to average over 10 (for example) preceding point and 10 following points, and plot it on the same plot.
I can easily do that using…

kirill_igum
- 3,953
- 5
- 47
- 73
2
votes
1 answer
Convert a float to a rational number that is guaranteed to convert back to the original float
I am looking for an algorithm to convert a float to a rational number, such that the rational number is guaranteed to evaluate back to the original float, and the denominator is minimized.
A naive algorithm can just return the actual value of the…

xiaq
- 764
- 1
- 6
- 13
2
votes
2 answers
F# and ILNumerics
I have just downloaded the last version of ILNumerics, to be used in my F# project. Is it possible to leverage on this library in F#? I have tried simple computations and it seems very cumbersome (in F#).
I would like to set up a constrained (or…

pacta_sunt_servanda
- 724
- 4
- 14
2
votes
1 answer
Solution to nonlinear differential equation with non-constant mass matrix
If I have a system of nonlinear ordinary differential equations, M(t,y) y' = F(t,y), what is the best method of solution when my mass matrix M is sometimes singular?
I'm working with the following system of equations:
If t=0, this reduces to a…

Doe a
- 352
- 1
- 11
2
votes
1 answer
Lack of 'convergence' in MATLAB's bvp5c
I am trying to solve the following set of 2nd order non-linear and coupled ODEs:
0 = ² ℎ″() − ℎ′() + ² ()² [1−ℎ()],
0 = ² ″() + '() − ² () [()² + ()² − 2],
0 = ² ″() + ′() − (1/2) () [1−ℎ()]² − ² () [()² + ()² − 2].
(I'm sorry…

MLPhysics
- 23
- 4
2
votes
1 answer
Unexpectedly low error for a numerical integrator with certain equations of motion
I have an RKF7(8) integrator whose output I've verified with several simple test functions. However, when I use it on the equation of motion I'm interested in, the local truncation errors are suddenly very small. For a timestep of around 1e-1, my…

David
- 424
- 3
- 16
2
votes
1 answer
Simpson's double integral won't work in java
So I had to write an algorithm for the Simpson's double integral so I can find the answer in a much faster manner. I had a guide that showed the steps to follow to write this program. After following this guide and running it in netbeans, I found…

Gchammas23
- 142
- 13
2
votes
2 answers
Trying to understand syntax with index slicing in python matrix
I have been looking over and interpreting some sample code and am having some trouble understanding what is going on with a bit of slicing syntax. For some context I am working on a computational program that uses method of finite differences…

Chase Gammon
- 21
- 3
2
votes
1 answer
correctly-rounded double-precision division
I am using the following algorithm for double-precision division and trying to make it correctly rounded in software emulation of floating-point.
Let a be the dividend and b is the divisor.
All operations are performed in Q2.62.
Initial…

Daniel
- 440
- 4
- 13