New answers tagged

6 votes
Accepted

How to design a sin and an arcsin function such that arcsin(sin(x))=x, where x is a finite precision floating point number

That seems impossible to do with a small numerical error, because of cardinality reasons. Consider for instance the much simpler case of the function $f(x) = x^2$ over $[0,1]$. This function maps $[0,...
3 votes

Storing Raw Simulation Data or Truncated Data?

I would recommend keeping the computation in your original precision and reducing the accuracy just when you write, unless the computation is too slow. If you reduce the precision of the computation, ...
2 votes

Finite difference approximation error

Take the Taylor series and re-arrange it to be $$ f'(x) - \frac{f(x+h)-f(x)}{h} = - f''(x) \frac{h}{2} - f'''(x) \frac{h^2}{3!} - f^{(4)}(x) \frac{h^3}{4!} + \ldots $$ Assuming that $f^{(n)}(x)$ is ...
3 votes

Chebyshev/Lagrange polynomials in spectral methods

To complete david's answer: References: Canuto et al., Spectral Methods Fundamentals in Single Domains We consider the Burgers equation \begin{align} \text{advective form}: \qquad \frac{\partial u}{\...
4 votes
Accepted

Chebyshev/Lagrange polynomials in spectral methods

Your understanding is perfectly fine, except for the last statement that Lagrange polynomials turn out to be a more suitable choice. In fact, both methods, the modal and the nodal expansion, have ...
  • 2,937
3 votes
Accepted

Faster than forward substitution?

Let's assume that the size $m$ of the individual blocks is fixed, but that the number of blocks $n$ grows. Then the one-step-at-a-time algorithm takes $O(m^3n)$ operations if you chose to invert the ...
3 votes

Faster than forward substitution?

I am not an expert in the field, but since there are no other answers at least I can suggest you a keyword to start a literature search: "parallel-in-time integration methods". This is a ...
4 votes
Accepted

C^1 continuous element for a triangle?

tl;dr: defelement link There is an equivalence between all polynomial basis which span the same space so in theory you can use the standard monomial basis to fit the various parameters using a ...
3 votes

C^1 continuous element for a triangle?

The $C^1$ elements are all very challenging to implement, which is why you don't see them get used very often. If you just want to see what the basis functions are on the reference (or other) ...
2 votes
Accepted

FreeFEM++ converting equation into code

In the piece of code that you mentioned from the FreeFEM documentation, the Galerkin Finite Element Method (FEM) is used for the spatial discretization and the Finite Difference Method (FDM) is used ...
  • 194
1 vote
Accepted

Solving a boundary value problem with variable number of coupled equations

This is a situation where some variables only live on parts of the domain. This is not so different from multiphysics problems -- say, a fluid-structure interaction problem where velocity and pressure ...
1 vote

Solve 1st order ODE in using `scipy`

One preliminary comment is that supplying at the initial point both $y$ and $y'$ is redundant. If $y'(t_0)$ is given then obviously the ODE fully defines $y(t_0)$. On the other hand, if $y(t_0)$ is ...
2 votes

What are the benefits of cutting by half the number of multiplications needed to calculate n?

What are the benefits of cutting by half the number of multiplications needed to calculate n! The rest of your question doesn't really refine what you're asking and it's too long for me to want to ...
  • 3,586

Top 50 recent answers are included