3

Probably not what OP was waiting for, but I think it could be pretty instructive and useful. FEM codes use a much different approach to build the so-called stiffness matrix. In practice, they loop over elements and compute for each element small matrices (in your case if you use linear elements 3by3) which are distributed to the right entries of the global ...


3

The choice of finite-difference scheme depends on several factors, such as the smoothness of your data, how uniformly-spaced the data actually is, etc. You may also want to consider just how accurate your velocity estimate actually needs to be. For example, if there are large error bars in the trajectory then it probably makes little sense to use a high-...


3

There are some unknowns in what you are doing but for simplicity, suppose we want to find $u(t)$ as discrete times $t_1, t_2, \cdots, t_n$. Let $\textbf{F} = [F(t_1), F(t_2), \cdots, F(t_n)]^T$ and $\textbf{u} = [u(t_1), u(t_2), \cdots, u(t_n)]^T$ be column vectors representing $F$ and $u$ evaluated at the desired times. From your problem statement, you wish ...


2

This is a (FDM) supplement to VoB's answer. You could write an extremely vectorized and optimized solver for your problem, but that is not a good first idea. Writing a for loop is easier, and once you identify the opportunities for optimization, you can implement them. Here is how I would go about it (in pseudo-code): Assume $0\leq i\leq n$ and $0\leq j\leq ...


1

First of all, I want to ask if you are sure that when you are saying $n=10000$ you mean $10^4$ points in one dimension? Because that would mean $10^8$ points over the domain, and that is too many points to solve such a simple problem. You would hit the minimum error before $10^8$ points, and you wouldn't gain anything for the extra work you do. Secondly, you ...


1

The stability analysis is made considering two close trajectories, if the difference between the state is guaranteed to reduce after one iteration, it means that the method is stable, the numerical errors introduced in one iteration (rounding errros) will not accumulate. The numerical solutions satisfy the equation $$ u_i^{k+1} = r\,(u_{i+1}^k + u_{i+1}^k) + ...


Only top voted, non community-wiki answers of a minimum length are eligible