# All Questions

8,355 questions
Filter by
Sorted by
Tagged with
2k views

### Diagonal update of a symmetric positive definite matrix

$A$ is a $n \times n$ symmetric positive definite (SPD) sparse matrix. $G$ is a sparse diagonal matrix. $n$ is large ($n$ >10000) and the number of nonzeros in the $G$ is usually 100 ~ 1000. $A$ has ...
47 views

### Draw contour line to represent multiple contours

I have 5 data sets, each includes multiple scatter points. If I use the geom_path function in R, I could obtain 5 contours like the following graph shows. Those five contours are annotated outlines ...
23 views

### Truncated power series algebra implementation

1) I am looking for references for an efficient implementation and usage of TPSA. What sources exist besides Berz's 1989 original paper and the incomplete chapter in Dragt's book? 2) Are there ...
42 views

### What precautions should be taken when using 2D Perfectly Matched Layers?

I'm solving linearized Navier-Stokes equations with Perfectly Matched Layers in two spatial directions $x$ and $y$, but in the time-harmonic frequency $\omega$-domain, which is meant to be less ...
3k views

### Options for solving ODE systems on GPUs?

I would like to farm out solving systems of ODEs onto GPUs, in a 'trivially parallelisable' setting. For example, doing a sensitivity analysis with 512 different parameter sets. Ideally I want to do ...
63 views

32 views

### How to store all solutions of an ODE on Matlab for multiple values of a parameter

I would like to solve an ODE for multiple values of the parameter p and most importantly, save all the solutions for all the different values. Till now, I have ...
70 views

### How do I get power from gaussian beam numerically?

I would like to get the power from a Gaussian beam given a set of points at which electric field is evaluated. Please follow my reasoning and tell me what assumption maybe are wrong Power definition ...
67 views

### Why do not we choose the error solution norm as an iterative method's criterion?

For solving linear system $$Ax=b,$$ using iterative mehods, we often use the terminate criterion as follows: $$\frac{\|r_k\|}{\|r_0\|}=\frac{\|b-Ax_k\|}{\|b-Ax_0\|}<eps.$$where $x_0$ is the ...
76 views

### CPU usage when a MPI rank waits during a blocking communication

A typical way of dealing with I/O in MPI parallel programs is to either read all data to a single node and dispatch to the other nodes accordingly, or send all data to a single node and write from ...
29 views

### What kind of problem or matrices are suitable for multigrid method?

For Poisson or Convection-diffusion equation as follows: $$-\Delta u=f,\qquad u|_\Omega = g.$$ or $$-\Delta u +\vec{w}.\nabla u=f,\qquad u|_\Omega = g.$$ using FDM or FEM discretization, we can ...
20 views

### Plot sinewave on ZX axis [duplicate]

I am trying to plot a sinewave with a bit of 3d perspective along the ZX axis instead of the XY axis. I have so far been unable to get anything that works, and have been unable to locate any examples....
38 views

### A lot of identical staff in Comsol material database?

I got a lot of elements in Material Browser of Comsol Multiphysics of Optics section. ...
67 views

### Solving differential equation in Python with discretized variable coefficients

I am trying to solve a differential equation with discretized variable coefficients which are calculated from a time serie. In this case the Runge-Kutta step size is fixed by the frequency in the time ...
51 views

### Using MATLAB to simulate the Ising Model

I am using MATLAB to simulate a 1D Ising Chain. I am running into an issue where when trying to find heat capacity, my system has a tremendous amount of noise. I'll post my code and an image of the ...
27 views

### Piecewise-linear Continuations vs Marching Squares/Cubes

It seems that both piecewise-linear continuation and marching squares are methods to produce iso-contours of a scalar function given the function's values on a grid. It seems that piecwise-linear ...
2k views

### Venues for publishing papers that emphasize software

Software is a fundamental part of computational science, and is increasingly recognized as an essential part of the scientific record. Given the value of using existing and well-tested code, it seems ...
123 views

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

I am considering the following diffusion equation: $$\frac{\partial f}{\partial t} = \frac{\partial}{\partial x}[D(x,t)\frac{\partial f}{\partial x}]$$ over a grid ...
39 views

### Question regarding 1D implementation of the DG method

I'm pretty new to the DG method and have been writing a 1D code to help me understand the coding aspect. With respect a reference, I've been following these notes https://www3.nd.edu/~zxu2/...
113 views

### Is there any other sparse matrix data in matlab built-in file?

I want to do some numerical examples solving large sparse linear system Ax=b. And I want to use some data from Maltab itself because this experiments are easily ...
143 views

### Consumer hardware for scientific computing?

I'm interested in problems around probability, statistics, and statistical mechanics, and often I find it useful to perform simulations to get some sense of the underlying phenomena. Example ...
542 views

### Fitting Implicit Surfaces to Oriented Point Sets

I have a question regarding quadric fit to a set of points and corresponding normals (or equivalently, tangents). Fitting quadric surfaces to point data is well explored. Some works are as follows: ...
65 views

### Numerical integration with singularity term

In https://www.johndcook.com/blog/2012/02/21/care-and-treatment-of-singularities, the author explains the subtraction method to get rid of singularities when performing numerical integration. The ...
67 views

### Is operation count a reliable predictor of performance when comparing two formulations?

I have two formulations to solve a problem (both give dense, complex and symmetric system). They are solved multiple times in a loop. I am trying to predict which is better to use. The first one ...
111 views

### Why is modeling a physical system with ODEs sufficient?

I've read a few papers in dynamical systems where the model equations are sets of ODEs, with the state space, say, the spatial variables x, y, z, and an angle variable phi all evolving forward in time....
95 views

### What is eighth order central difference?

The origin of the question can be found here. I know the details about forward, backward and central differences. If $u$ is the variable, does eight order means it approximates the $u_{xx}$ using $u$...
36 views

### Why does the initial guess for linear system usually choose by zero vector?

For solving linear system $$Ax=b,$$ using iterative mehods, we often use the terminate criterion as follows: $$\frac{\|r_k\|}{\|r_0\|}=\frac{\|b-Ax_k\|}{\|b-Ax_0\|}<eps.$$where $x_0$ is the ...
230 views

67 views

Good evening, I would like to understand why I do not get the correct result: I assume that I know my function on discrete data points and expand it as a discrete Fourier transform: $\text{sin}(x)=\... 2answers 78 views ### Is expm1 the right primitive? I'm writing some code to calculate$\int_0^1 e^{ax} \mathrm{d} x$. Annoyingly there does not seem to be a way of doing this without if statements: ... 1answer 51 views ### How to implement Geometric Multigrid in non-rectangular grids? It is quite easy to implement multigrid on a rectangular grid but what about an non-rectangular?How to coarse a non-rectangular grid and apply multigrid(assume an easy non-rectangular grid capital ... 1answer 76 views ### Dynamic linear elasticity problem is stiff (numerically) I am considering a dynamic linear elasticity problem applied to a simple structure such as a beam. In system form, the PDE can be written as$M \ddot{X} + D \dot{X} + XK = F$where$X$represents the ... 1answer 71 views ### Lumped matrices in thermal analysis using finite elements The governing equation of the transient heat transfer problem is $$C \frac{dT}{dt}+K T = Q$$$C$is the heat capacity matrix.$K$is the thermal conductivity matrix.$T$is the temperature vector.$...
In the original paper of Conjugate Gradients, the authors mention that if we pick the canonical basis $\{e_1,e_2,\ldots,e_n\}$, to obtain A-orthonormal vectors, we end up with the Gaussian elimination ...
Suppose I know that a function from $[0,\pi] \to \mathbb{R}$ may be written as $$\sum_{k=0}^\infty A_l \frac{2l+1}{4\pi} P_l(r)$$ where $A_l$ all are known. Is there a way in which I may very ...