# Tag Info

Accepted

### Is the exponential function, e^x, very expensive to compute in Matlab and harmful to my computer?

Computing the term $e^x$ is definitely significantly more expensive than computing a lower-order polynomial -- say $x^4$. But it may be ten to 100 times more expensive at most, not "crazy" expensive. ...
• 56.2k

### Why does the numerical solution of an ODE move away from an unstable equilibrium?

Note that $\pi/2$ is represented in double precision format in a way that is not exactly equal to $\pi/2$. It's only accurate to about 15 digits. Thus you're starting every so slightly away from the ...
• 18.9k
Accepted

### Why does the numerical solution of an ODE move away from an unstable equilibrium?

I think the two main points have already been made by Brian and Ertxiem: your initial value is an unstable equilibrium and the fact that your numerical computations are never really exact provides the ...
• 1,273

### Energy conservation in RK4 integration scheme in C++

RK4 is not symplectic so it has no guarantee of energy conservation. Especially when solving an N-body problem where two bodies pass by close to each other the energy conservation can be violated ...
• 2,814
Accepted

### In Matlab, how can I be consistent with units?

I would say that you have, mainly, two methods: Being consistent in all your code, as already suggested in another answer. For that purpose, I always keep a table like this one with me, since it ...
• 8,582

### In Matlab, how can I be consistent with units?

Just simply by being consistent in all of my code? Yes this is the only way. Matlab or any other programming language does not know about units. They only know about numbers. As an example consider ...
• 3,038
Accepted

### CFL condition in Discontinuous Galerkin schemes

The restrictive CFL of DG schemes typically comes from the combination of high order accuracy and a compact stencil (see this reference for example). The CFL depends on bounding the variational form ...
• 3,162

### Difference between phenomenological modeling and mathematical modeling

A phenomenological model is based on observations of a system rather than on physical theory. Other physically based models are based on fundamental physical principles such as Newton's laws of ...
• 18.9k
Accepted

### What kind of a researcher am I?

Up until a couple of decades ago, science was based on two large pillars. Those were theory and actual physical experiments. It is an exciting time to see a third pillar arise with numerical ...
• 3,005

### Physics Simulation in C++

I think you are missing a very important and crucial step that lies exactly between the physics and simulation: the mathematical model. In order to model any physics, one has to formulate the ...
• 8,712

### Specifying ode solver options to speed up compute time

Julia's DifferentialEquations.jl has a lot of tooling for automatically deriving (sparse) matrices. For more information, see the JuliaCon 2020 video on Auto-Optimization and Parallelism in ...
• 12.4k

• 11.5k

### How to simulate over 1 billion particles?

A first step, if you "have never been up in computing", is to read the literature and see what others are doing and have done. The second step is that you will likely learn that what you want to do ...
• 56.2k
Accepted

### What numerical methods are used to model deformations in elastic physics?

It seems that the type of algorithms differ considerably depending on whether the problem is: Quasistatic elastic or Hyperelastic In the quasistatic elastic case, a simple approach is the following: ...
• 206
Accepted

### Finite difference methods in cylindrical and spherical co-ordinate systems

There are basically two methods: You can disrectize the angular part via grid points, or you can discretize it via basis expansion. I will focus on spherical symmetry here, the cylindrical case is ...
Accepted

### How does non-dimensionalization improve the behavior of ODE solvers?

Background Let’s have a brief look at what parameters an integrator typically has and what they are used for. All of them govern step-size adaption: Relative tolerance (...
• 2,127
Accepted

### What are good particle dynamics ODEs for an introductory scientific computing course?

For a single particle, interesting dynamics already arise if you are in magnetic and electric fields. The situation becomes even more interesting if you consider several particles at once and how they ...
• 56.2k

### What are good particle dynamics ODEs for an introductory scientific computing course?

One very educational example is the Lodka-Volterra system. It can describe the observed effects of predator and prey population levels in many ecological system (foxes & rabbits). High populance ...
• 3,005
Accepted

### Using backward and forward Euler method to solve a certain stiff ODE

General observations Convergence If $L$ is a Lipschitz constant for the system that is valid for the medium term, then with $Lh\le 1$ both methods give with good probability (but not certainty) ...
• 6,129

### Runge Kutta solution blows up for a first order ODE with very large coefficients

Though the following will not necessarily solve your problem, it is highly recommended to implement the ode dimensionless such that all relevant quantities are around 1 to stabilize solvers. The ...
• 1,285

### Calculation of the EFIE integral

A classic paper for evaluation of the integrals commonly present in computational electromagnetics (EM) is: D. R. Wilton, S. M. Rao, A. W. Glisson, D. H. Schaubert, O. M. Al-Bundak, and C. M. Butler, ...
• 8,712
Accepted

### Spectral Element vs Finite Element

The main advantage is that it reduces the Runge phenomenon and leads to faster convergence rates. It also presents less numerical dispersion and need less nodes per wavelength (see 1 and 2). So, I ...
• 8,582

### Spectral Element vs Finite Element

The SEM is a FEM! It's almost like all these different names are designed to confuse the newcomer. I will speak primarily about the most popular form which uses a tensor product Lagrange basis with ...
• 188
Accepted

### Is the diffusion equation with Neumann and Dirichlet BCs well-posed?

Yes, the problem with mixed boundary conditions is well posed. What's not clear to me is this: Why do you approximate the derivative via the two-sides approximation? Shouldn't it be enough to just ...
• 56.2k