All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
97 views

Implementation of Jacobi iteration

I have implemented the Jacobi iteration in C++ using a dense vector and a sparse matrix in CSR format. The code is as follows: ...
2
votes
1answer
32 views

Robust ways to find zeros of the Tricomi confluent hypergeometric function as a function of its parameters

I'm solving a quantum mechanical problem, and the quantization condition requires me to solve the equation $$ U\left(\frac12(\ell+1-E), \ell+1, r^2\right) = 0, $$ where $U(a,b,z)$ is the confluent ...
1
vote
0answers
29 views

Multipole expansion for magneticfield intesity (magnetization)

I'm using the Barnes Hut method to calculate the magnetic vector potential induced by an applied current. Given as: $\begin{equation} A(r) = \frac{\mu_0}{4\pi} \int_V\frac{\bf{J(r')}}{|r-r'|}dV(r') \...
0
votes
1answer
49 views

Implementing structured grid boundary conditions using NumPy arrays?

I am making a toy code in Python to solve the advection equation $$u_t + cu_x = 0$$ with, for example, periodic boundary conditions. Background information The numerical grid is specified like this: ...
1
vote
0answers
22 views

Solution errors when refining a static grid: Continuous vs. step-wise refinement

Let's assume I am working on a 2-D domain on $R^2$, with my coordinates $x \in[-1,1]$, $y \in[-1,1]$ and I want to solve a popular CFD problem, like the shallow water system or the Euler system. At $x=...
0
votes
0answers
17 views

Orientation of cones and transitive closures of a dmplex in Petsc

From the Petsc manual pages, I fail to understand what the orientations of cones and transitive closures mean. In particular, how can I relate these numbers to the orientation of the length/area/...
0
votes
0answers
15 views

Inconsistent potential over a cylindrical surface in COMSOL

I made the following construction in COMSOL (This is a cut): Two cylinders, the inner one in the middle is a solid cylindrical conductor. The thick outer cylindrical shell, along with the two small ...
0
votes
0answers
20 views

On using Ritz Method to solve a Mindlin–Reissner plate

I am trying to replicate the method given in the this paper. I have written a Matlab program which determines the displacement field of Mindlin–Reissner plate theory using Ritz method. The limitation ...
1
vote
1answer
96 views

Cholesky for ill-conditioned/singular covariance matrices

Can someone suggest a way to get Cholesky factorization of a singular covariance matrix? I need it to match Cholesky on full-rank matrices, ie coordinate order should be preserved. My attempt below ...
4
votes
1answer
53 views

approximate function such that the inverse of the approximation is “simple”

I have a smooth enough injective function $f:[a, b]\to \mathbb{R}$ which I want to approximate by something that can be computed quickly, e.g., a Padé approximant of low degree, $$ \frac{\sum_{j=0}^m ...
2
votes
0answers
36 views

Inverses of many standard subspaces of one large matrix

i have a large rectangular invertible matrix M (about 5000x5000) and i have a loop in which i do the following for each iteration i (there are about 6000 iterations): i am given a subspace S_i (which ...
2
votes
2answers
106 views

Why iterative method: AMG preconditioned PCG is slower than Matlab direct method 'A\b'?

Recently, I have met a question that a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods. But when I implement some experiments ...
1
vote
0answers
49 views

Runge-Kutta for PID and system in separate calculations without filter

I need to calculate a closed-loop system in Python; specifically, obtain the PID response and then use the output to obtain the system response sample-by-sample with my own loop. For this, I am ...
3
votes
0answers
38 views

Minimum of quadratic assignment (QAP) with convex objective

Suppose $A,B\succeq0$ and $C\in\mathbb R^{n\times n}$. I am hoping to solve an instance of the following optimization problem: $$ \min_{\textrm{permutation matrices }P} \mathrm{tr}(BP^\top AP+C^\top ...
2
votes
1answer
72 views

Number of GMRES iterations increase when stepping forward in time, using the Newton method

I am solving a system of nonlinear time-dependent equations using the Newton method in a finite-element-setting, i.e. first I create the jacobian matrix for the current time, and afterwards I try to ...
0
votes
0answers
59 views

How to implement the following Finite Element method for Burgers' equation?

I am trying to replicate this result. It involves using the Galerkin finite element approach onto the viscous Burgers' equation. However, my implementation (in R) seems to be giving me wrong results....
2
votes
0answers
33 views

Equivalent of multiple-scale analysis for a linear ODE

I came across the method of multiple-scale analysis and was intrigued, because I am trying to solve a linear ODE with multiple characteristic timescales. When I apply the method as described, say, ...
0
votes
1answer
45 views

why on wolframAlpha I cannot find the value of an expression?

I would like to calculate the following two expressions using Wolfram Alpha: $$z = (x (d^2 + d (4 y - 6) - 8 y^2 + 12 y - 3) + 6 (d - 1) (y - 1) y)/(d^2 - 2 d y + 4 y^2 - 6 y + 3)$$ and $$w = -(\...
1
vote
0answers
18 views

Second fundamental form - Maple

I would like to know the command/line in Maple 16 or similar to obtain the second fundamental form tensor for a given metric. I've managed to obtain Rienmann and Ricci tensor, even Weyl, but I can't ...
3
votes
0answers
26 views

Sparsity-Promoting Convex Optimization Over Simplex

Say we want to find a sparse approximate minimizer to the function $f(x) : \mathbb{R}^d \to \mathbb{R}$. Then in line with the work in the field of compressed sensing, we can instead minimize $$f(x) + ...
0
votes
0answers
32 views

Grids for atmosphere simulation with finite volumes on the globe

I am currently in the early construction process of building a simple CFD model of a rotating planetary atmosphere. The planet should be allowed to tilt significantly, so that a time-dependent source ...
4
votes
0answers
28 views

Implementation of Lanczos method that returns tridiagonal matrix

The Lanczos method can be used to obtain extremal eigenpairs of sparse symmetric or hermitian matrices. I know there are several implementations of the Lanczos method (as well as Arnoldi, Davidson, ...
1
vote
1answer
39 views

Incomplete LU decomposition of sparse matrix

I have a sparse matrix stored in CSR format. For this matrix, I would like to get the incomplete LU decomposition. I tried to find algorithms which can utilize the CSR format but I could not find ...
0
votes
0answers
33 views

Least square approximation of a polynomial with a constraint on the derivative in Python

I'm trying to fit a polynomial of the third degree through a number of points. This could be a very simple problem when not constraining the derivative. I found some promising solutions using CVXPY to ...
4
votes
1answer
102 views

Improve Mandelung constant code

I'm learning and improving my Python skills. I did a program in Python about Mandelung constant. But, I'm having kind of a problem. The Mangelung constant is calculated using this sum: $$ V_{total} =...
2
votes
1answer
24 views

Can I solve a model in GEKKO with Black Box, Simulated Annealing or GA solvers?

I'm trying to use my current GEKKO model with different solvers methodologies. I don't know if I can also use global optimisation solvers as GA, Simulated Annealing o Differential Evolution. I need ...
0
votes
1answer
48 views

Determination of Young's Modulus for a Finite Element Code

I am writing a finite element code for my final year project of BS Mechanical Engineering. The geometry is an integration of several parts composed of different materials. I don't have exact values of ...
0
votes
1answer
80 views

Well-posedness of Navier-Stokes equation

Before running a simulation for turbulence (e.g Rayleigh-Benard Convection), how do we check for well-posedness of Navier-Stokes with other equations for a given boundary condition?? Can someone ...
4
votes
0answers
79 views

Are there well-known methods for navigating on kd-trees?

When you have a mesh, there are many well-known methods to navigate it, as for example using a half-edge data structure, that allows easy circulation around faces and vertices. Are there similar ...
7
votes
1answer
185 views

Do computational scientists typically also become domain experts?

Let's say I'm interested in fluid dynamics, specifically in fluid-structure interactions -- and I want to get into modeling, simulations and experiments. I am a mathematics student by training, ...
4
votes
1answer
36 views

Binary combinatorial optimization with hard to compute costs

I have a combinatorial problem regarding the optimal placement of sensors. I want to find the optimal placement of $N$ sensors, given $M$ possible locations, $N < M$. Right now I'm working with ...
3
votes
1answer
332 views

Limitations with dynamical systems vs. PDEs?

As a computational scientist, are there limitations to studying dynamical systems — systems of odes in which each state variable evolves with time — compared to studying PDEs? For instance, it seems ...
2
votes
1answer
119 views

Why don't we call the simulation “a model for …”?

When a set of model equations, e.g. some coupled differential equations, has solutions that behave in ways similar to real-life phenomena such as blood flow in the heart, a wave movement, or a plate ...
1
vote
1answer
37 views

How to use QZ decomposition for single matrix in Matlab?

Can I use QZ decomposition on a single square matrix in Matlab? Like, [Aa,Q,Z]=qz(A);
6
votes
1answer
88 views

Optimization algorithm / approach for suggesting what goods to buy and sell in a marketplace?

A toy problem would probably be best to explain it this. Let's say we have 100 people, each with 4 unique types of items (to simplify things, let's say it's the same four types of items for each ...
1
vote
1answer
53 views

Classical vs. modified Gram-Schmidt

It is often said that modified Gram-Schmidt is more robust with respect to rounding errors than classical Gram-Schmidt, but it is very hard to find a good explanation / example of why this is so. Can ...
0
votes
1answer
38 views

How to define $P0-$ Piecewise constant basis function in finite element method?

Suppose if we take $X_h(G)$ as finite element space then this space (space of piecewise constant basis function)is defined as $$X_h=\{v: v|_{T}=c_{T}, T \in \mathbb{T}\},$$ where $\mathbb{T}$ is a ...
3
votes
1answer
367 views

What's the terminology for this alternative minimization algorithm?

Say the model is $F(x_1)G(x_2)Z(x_3) = y \in \mathbb{R}^N$, with $F,G,Z$ explicitly known, we are given observation of $y$ as $y_b \in \mathbb{R}^N$ to find the value of $x_1$, $x_2$, $x_3$ for each ...
0
votes
0answers
38 views

Cubature rule in unit Sphere in $\mathbb{R}^{3}$

I need to find the cubature rule for the following integration $$\int_{S^{2}} f(s,\tilde{s})d\tilde{s} ds,$$ where $S^2$ is the unit sphere in $\mathbb{R}^{3}$.
3
votes
1answer
78 views

Calculating the Convolution Using DFT (FFT)

I have the following convolution as part of a numerical simulation. $$T(r)=\int \mathrm{d}^3r_2\, p(r_2)f(r_2)\alpha(r-r_2)\, .$$ My problem is that the analytical expressions for $f$ and $p$ do ...
1
vote
0answers
12 views

Error on the fit parameters when several good fits exist

I am using the reduced chi-squared statistic to determine the goodness of fit. I run several simulations and determine that a parameter 'p' has a certain range of values that all give values between 0....
1
vote
1answer
51 views

Finding curves where function goes to zero in two dimensions

Suppose $f(x,y)$ is a complex function of two real arguments with roots* that are not discrete points but lie in curves. (Is there are term for this characteristic?) An example is shown below: the ...
5
votes
0answers
74 views

Sensitivity of BFGS to the accuracy of the gradient

I am studying how to speed-up the BFGS method using quantum computing techniques. I have used a method of speeding up the gradient of the function, but it sacrifices the precision value of the ...
2
votes
1answer
51 views

Givens rotation vs 2x2 Householder reflection

The usual story of Givens rotations vs Householder reflections is that Householder reflections are better if you want to map a long vector to $e_1$, while Givens is better if you want to map a 2-...
1
vote
0answers
22 views

Fast convergence of smoothing of periodic noise

I have essentially periodic data from a simulation (not exactly periodic but is qualitatively fairly periodic), and I'd like to take an average or noise filter of some sort that I can get a well ...
2
votes
2answers
62 views

How to include penalty in a Objective Function with Python? GEKKO

I'm trying to include a "great M" penalty in my objective function. I want use the entry x vector values as entry values in a function. A fixed maximum value is took initially for the returned value ...
1
vote
1answer
61 views

Best way of storing numerical data in a compact manner, while leaving it accessible for tools like GnuPlot?

My simulation, written in C++, generates a large amount (roughly ~500) of text files for each set of parameters I try to simulate, with four columns of ~5k double values in each file. Furthermore, to ...
5
votes
1answer
274 views

Iterative linear solver for “ugly” saddle point system

I am a graduate student majoring scientific computing. The numeric model I made caused a very ugly-looking saddle-point linear system. It is not symmetric at all and I will attach the sparsity pattern ...
0
votes
0answers
23 views

Question about the visible and hidden neurons in neural networks methods

My problem is the following : I found the ground state energy (for the Ising model) with neural networks (more specifically RBM). I reproduced the same result but by increasing every time the ratio $=...
0
votes
1answer
69 views

Software to simulate molten salt flow and thermodynamic operations

I was curious if there was any software (preferably in C++, Java, and/or python) that could be used to simulate the following: Heat capacity of a fluid Heat transfer through a liquid and a solid ...

15 30 50 per page