Skip to main content

All Questions

0 votes
0 answers
27 views

How to best approach a numerical computational solution towards matching $e^{-r}$ and $k_2\sin(k_1\,r)$ as well as their derivatives $\frac{d}{d\,r}$?

In my question, "Why does it seem like two parameters $k_1$ and $k_2$ are needed to match $e^{-r}$ and $k_2\sin(k_1\,r)$ as well as their derivatives $\frac{d}{d\,r}$?", it was identified ...
Stephen Elliott's user avatar
0 votes
0 answers
23 views

Recursive approximations of inverse square law

I have a toy electrostatics simulation that consists of some number of 2D point particles that each have a real-valued "charge" $q_i$, which then exert forces on each other proportional to $...
redroid's user avatar
  • 640
0 votes
0 answers
59 views

Recursive algorithm for numeric integration with singularities

As part of my research, I have to integrate Green's Function to get charge density but Green's function has integrable-singularity near band-edge and integration has been a headache with normal ...
Shlok Vaibhav 's user avatar
2 votes
1 answer
52 views

Rules for Choosing Bounds and Initial Conditions when Using 2nd Order Runge Kutta Methods

I have a question regarding 2nd order Runge-Kutta methods, specifically where it regards the bounds of the solution. Let's say I have to solve a 1st order ODE $\frac{dy}{dx}=f(x,y)$ numerically using ...
WnGatRC456's user avatar
1 vote
0 answers
39 views

why is this iterative algorithm for calculating the Chebyshev polynomials stable?

It is known that $\cos n \theta $ is a polynomial of $\cos \theta $. This polynomial is the so called Chebyshev polynomial of order $n$, often denoted as $T_n(x)$. We have the recursion relation $$T_{...
poisson's user avatar
  • 1,015
1 vote
0 answers
39 views

How to derive a recursive formula from the following formula

How to derive a recursive formula from the following formula, $$ u_{n}=a_{n-1}u_{0}+\sum_{k=1}^{n-1}(a_{n-1-k}-a_{n-k})u_{k}+\Gamma(2-\alpha)h^{\alpha}f(t_{n},u_{n})? $$ P.S.: Consider the following ...
workwolf's user avatar
1 vote
2 answers
107 views

Tail recursive formulation of the Legendre polynomial relation

The recursive formula for Legendre polynomials is widely known: $(n + 1) P_{n+1}(x) = (2n + 1) x P_{n}(x) - n P_{n-1}(x).$ Let us rewrite the above as follows for convenience: $P_{n}(x) = \frac{2n - ...
Andrii Kozytskyi's user avatar
1 vote
1 answer
205 views

How to calculate the following variance in a recursive way

Suppose we need to divide people into two groups A and B, the first person will be assigned to either of the group with probability $0.5$, from the second person, the assignment will be done based on ...
koori's user avatar
  • 21
3 votes
2 answers
1k views

is there a faster method to calculate $1/x$ ($x$ an integer) than this?

I gave this stackexchange a second go. Is there a faster way to calculate $1/x$ than the following: Calculate $100/x$ (.or other arbitrary positive power of $10$) with remainder Write multiplier in ...
user avatar
6 votes
1 answer
262 views

Why does calculating $\exp z$ using $\ln z$ via newton-raphson method fail to converge?

I am trying to calculate $\exp z$ using $\ln z$ via Newton-Raphson method $$x_{n+1} = x_n-\frac{f(x_n)}{f^{'}(x_n)}$$and got the formula $$x_{n+1}=x_n-\frac{\ln x_n-z}{\frac{1}{x_n}}$$ where $z = a + ...
user10560552's user avatar
2 votes
1 answer
513 views

*Numerical* Convergence of the Babylonian Method?

I understand the sequence $x_{n+1} = \frac12\left(x_n + \frac2 {x_n}\right) $ converges to $ \sqrt2 $ algebraically. That is proved by means of fixed-point method or monotone convergence theorem and ...
CWPC's user avatar
  • 23
10 votes
1 answer
284 views

Let $X$ be a random variable, $\frac{\mathbb{E}[e^{sX}-e^{tX}]}{s-t}$ for $s \approx t$. As

Question Let $X$ be a random variable for which we only have the value of its Moment Generating Function $M_X$ on a discrete set of points, I am looking for a stable method to compute: $$\frac{M_X(s) ...
Darkwizie's user avatar
  • 757
1 vote
0 answers
77 views

How do I fight loss of significance and/or improve convergence for this recursive algorithm?

While trying to answer this question I used the series approach and obtained a recursive algorithm. While checking it numerically, I found it suffering from "catastrophic cancellation", i.e. loss of ...
Yuriy S's user avatar
  • 31.7k
3 votes
2 answers
500 views

Numerical stability of a geometric series

Suppose I want to compute $S_n = \sum_{i = 0}^n \beta^i$. We do have an exact formula for the answer: $S_n = \frac{1 - \beta^{n + 1}}{1 - \beta}$. Let's suppose though that instead of using this ...
cgmil's user avatar
  • 1,303
5 votes
1 answer
301 views

Prob. 24, Chap. 5 in Baby Rudin: For $\alpha>1$, let $f(x) = (x+\alpha/x)/2$, $g(x) = (\alpha+x)/(1+x)$ have $\sqrt{\alpha}$ as their only fixed point

Here is Prob. 24, Chap. 5 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition: The process described in part (c) of Exercise 22 can of course also be applied to functions ...
Saaqib Mahmood's user avatar

15 30 50 per page