All Questions

Filter by
Sorted by
Tagged with
2
votes
2answers
84 views

Visualization of Quad/Octree data Structures

I have a simple C++ quadtree implementation. The implementation subdivides node into four children as if there is more than one point in that particular node. At the moment I want to visualize how ...
0
votes
0answers
17 views

How can I convert OpenFOAM postProcessing directory to HDF5?

Are there existing tools or practices for converting OpenFOAM run-time post-processing directory, postProcessing, into a single HDF5 file or HDF5 groups? The ...
0
votes
1answer
176 views

Can Julia be used to create a large-scale CFD software like OpenFOAM?

I have some experience with some programming languages like C/C++, Fortran, Python, etc but recently, I am getting interested in Julia. But, I am wondering if Julia could be used to create some large ...
1
vote
0answers
31 views

Well posedness dirichlet BC in elasticity

I always thought that a Dirichlet BC need to be prescribed on at least one part of the domain in order for linear elasticity to be well-posed. Is this correct? But I was recently told by a colleague ...
0
votes
1answer
42 views

Convert decimal number in binary double precision, how to avoid the loss of the last digits after normalization?

I have the decimal number: $0.023$, and I want to convert in a binary number with $52$ bit of mantissa in Double Precision: if I go to convert, using this utility here, in non-normalized form, with $...
2
votes
2answers
83 views

Solution of symmeric/non-symmetric linear system

I would like to understand what happens in the following: I have a really simple Poisson problem, in 1D, with $u_0 = u_N = 0$. I assembled the stiffness matrix and the right-hand side, and I applied ...
0
votes
0answers
61 views

Calculating the exponential of a complex matrix

I am trying to calculate the exponent of a 3 x 3 matrix using the formula $\sum_{i=0}^\infty\frac {A^n}{n!}$ I believe that my error may lay in the scalar division with a factorial or the member ...
3
votes
1answer
86 views

Augmented arithmetic operations (IEEE-754-2019): output definition and implementation

In the new version of IEEE-754-2019: IEEE Standard for floating-point arithmetic, the augmented arithmetic operations were introduced. These operations can be particularly useful in certain numerical ...
1
vote
0answers
39 views

Triangle on top of diagonal least squares

I need to solve many least squares problems with the following matrices: $$ \pmatrix{ R \\ D_i } $$ where $R$ is upper triangular and $D_i$ is diagonal. $R$ is the same for all the problems, while $...
1
vote
1answer
94 views

Partial differential equation FEM application

I have a PDE which looks like Helmholtz wave equation on one dimensional domain. $$\dfrac{d^2u(x)}{dx^2}+\pi^2u(x)=f(x)$$ where $-\infty <x<\infty $ Also, $f(x)= 1$ for $-0.25<x<0.25$, I ...
4
votes
1answer
130 views

How to define a dimensionless Objective function for determining how peaked a curve is?

I have attached 2 plots for FFT spectra. One is considered good and one is bad. The good one is classified on the basis of how closely spaced the frequencies and the bad is based on how multiple ...
0
votes
1answer
30 views

How to fill matrix entries for two-dimensional implicit finite-difference for the general case

If I have derived a finite-difference formula for a 2D problem, for example something like: $af_{i,j}+bf_{i-1,j}+cf_{i,j-1}+df_{i-1,j-1}=g_{i,j}$ where f is the unknown function on a grid and ...
0
votes
0answers
20 views

COMSOL Circularl polarization

I'm having some problems trying to implement circularly polarized light in COMSOL Muliphysics. For a isotropic homogenous media, I've obtained without problems the TE and TM reflectance curves. ...
0
votes
0answers
17 views

Volumetric Mesh Cutting Algorithms For Simulating Sculpture

I am interested in whether there an available algorithms to give me insights on how to cut a volumetric mesh?
0
votes
0answers
29 views

Determining the voxels between two boundary surfaces

I am working on human brain tACS simulations where I have the models of the skin, skull, csf, brain and ventricles in STL format. The shape does not matter and there are no intersections. I want to ...
2
votes
1answer
22 views

Getting a list of coordinate points of a Cartesian grid in Python

I have a regular three dimensional Cartesian Grid with numpy.linspace(a1,an,na), numpy.linspace(b1,bn,nb), numpy.linspace(c1,cn,nc) along their respective ...
0
votes
0answers
10 views

How to optimize linear programming subproblems with respect to global constraints?

I have an optimization problem where I have several categories and for each category $j$ I have entries $i = 1....m$, I wish to assign some value $x_{ij}$ for each entry of each category but: I need ...
-1
votes
1answer
95 views

Numerical solution for gradient(slope)

Abstract I have the next equation to find a force, for my problem: $$U=-\int \vec{m}\small{(x)}\times \vec{B}(x)dV$$ $$\vec{F}=-\nabla U$$ Considering 3-dimensional space with x,y,z coordinates, ...
1
vote
1answer
73 views

How to write a code of 2D ADI method in matlab?

I tried to write a code for the alternating direction implicit (ADI) method in 2D, but I got stuck. My equation is: $$\frac{\partial U(t,x,y)}{\partial t} = 2\Delta U(t,x,y) -10(\frac{\partial U(t,x,y)...
2
votes
0answers
61 views

Solve 1D saturation equation using FEM

I want to solve the following 1D equation to model the time evolution of saturation in a porous medium using finite elements (I'm a beginner). The permeability $K$ and the pressure $p$ depend on the ...
4
votes
2answers
133 views

More stable method of back substitution?

I've been tinkering a little in Fortran (2008) and wrote the following to solve $Rx=b$ for $R\in\mathbb{R}^{n\times n}$ upper-triangular, $x,b\in\mathbb{R}^n$. My code looks like this: ...
0
votes
1answer
33 views

MATLAB ode45 doesn't start at initial conditions

I wrote a code in MATLAB to solve a system of differential equations, but my solution doesn't seem to take into consideration the initial conditions I specified. I am not sure how to interpret this ...
19
votes
4answers
3k views

Is half precision supported by modern architecture?

I am new to computer science and I was wondering whether half precision is supported by modern architecture in the same way as single or double precision is. I thought the 2008 revision of IEEE-754 ...
0
votes
0answers
19 views

How to plot a function for multiple values of a parameter in the same set of axes in Python?

I'm currently trying to plot a graph wich describes a photoionization cross section as a function of incident photon energy for optical transition in a semiconductor for different values of the $\...
0
votes
1answer
29 views

Clarification regarding 3D FMM translation operators

I am implementing an adaptive 3D FMM with the "basic" $O(p^4)$ translation operators. I am looking for clarification on the multipole-to-multipole (M2M) translation operator. I will explain my ...
0
votes
2answers
64 views

Best way to find biggest & smallest number in a random list?

Given a list of some length, containing random numbers. What method would need the least amount of checks to find the largest & smallest number in the list? My best guess is: (list_length)/2 ...
0
votes
0answers
20 views

Does order of data points matter for approximating AUC with unit time steps?

I have a time series of data where the increment is every minute. In order to approximate AUC, I just compute the sum of the data values, since they would all be multiplied by 1 anyway per Riemann sum ...
0
votes
0answers
51 views

Unsupervised event prediction with time series data

I have to solve a problem using unsupervised time series forecast. I have a dataset where three columns are given, 1. Endtime: when the row was generated ( it generates a row after each 54-55 seconds)...
0
votes
0answers
24 views

Circumferencial waves on a cylinder/sphere

I was wondering how we can introduce $e^{ik.x}$ terms associated with circumferencially propagating waves? In this case $\hat{e}_\theta$ is the direction of wave propagation. However, I was not able ...
1
vote
1answer
90 views

Numerical methods that can be written in flux conservative form

I have a system of non-linear PDEs that I expect to have shocks as well as the appearance of Gibbs phenomena (spurious oscillations that form near the shock) for 2nd-order methods or higher. I have ...
1
vote
0answers
73 views

Plot of ratio of two integrals:

Consider the following integrals $$ I_1(x) =\int_0^\infty\mathrm dy \frac{F(x + \mathrm iy) − F(x −\mathrm iy)}{\mathrm e^{2πy}-1}, $$ And $$I_2(x) =\int_1^x F(t)dt$$ Where, $ F(z) = \sin^2[π\Gamma(z)/...
0
votes
0answers
45 views

Division and Modulus for Large DIVISORS

Excel and also Excel VBA have no built-in support for arbitrary precision arithmetic. There are a few very large add-ins that can be installed to do these sorts of calculations where the operands are ...
1
vote
3answers
125 views

Runge-Kutta method for an ODE with initial value which is root of denominator

I wrote a code in Fortran to solve this differential equation using RK4 method: $$ \frac{dy}{dx}=A\sqrt{\frac{B}{y}+\frac{C}{y^2}} $$ $A$, $B$, and $C$ are some known constants. The problem is that ...
1
vote
1answer
39 views

How do I get scipy.minimize to terminate below a certain loss threshold?

I was looking at the scipy.minimize documentation to see if I could find a way to terminate optimization when the loss gets below some cut-off, and I couldn't see ...
1
vote
0answers
45 views

When to discretize nonlinear Poisson Equation

I am trying to solve a nonlinear poisson equation of the form: $u_{xx} + f(u_y)u_{yy} = 0$. In trying to get a handle on this problem, it seems like there are two approaches. I could either ...
4
votes
2answers
106 views

Kronecker product representation of the finite difference laplacian

The laplacian equation when discretized gives a system of linear equations that can then be solved. See the answer to this question: https://math.stackexchange.com/questions/3120948/discretization-...
0
votes
0answers
23 views

Adding a boundary surface on a STL model in Gmsh

Background info I want to run brain simulations with models from the PHM repository (not relevant to the problem but suits the narrative) which are shipped in STL format. The meshes of the STL have ...
2
votes
1answer
81 views

A concave maximization that is not supported on CVX

I try to solve a maximization problem using CVX. In its simplest form, I want to maximize $$f(x,y)=y*h_b\left(\frac{x}{y}\right),$$ where $h_b(\cdot)$ is the binary entropy function. In the context ...
0
votes
1answer
28 views

Convert existing gmsh mesh from first- to second-order elements?

Is there a way to take an existing gmsh .msh file, and convert it to second-order elements? Specifically, I'm trying to go from 8-point hexahedra (hex8) to 20-point hexahedra (hex20). Ideally, I'd ...
-1
votes
1answer
25 views

An almost surly fine-time game of coin toss where you win with probability $p$

Given a fair coin and a number $p\in(0,1)$. How do you design a game that finishes in a finite number of tosses with a probability of $1$? And further, with the probability $p$ you win the game. I ...
1
vote
1answer
66 views

Finite Difference libray C++

What is the best FD library (or collection of libraries) for C++ codes? I am looking for some data structure implementation that offers the possibility to do parallel computations on adaptively ...
3
votes
0answers
59 views

Conjugate Gradient for nonlinear equation system

Is it possible to apply adaptions of the conjugate gradient algorithm i.e. Fletcher-Reeves, Polak-Ribere or others to systems of nonlinear equations? How should the equation system be adjusted so one ...
1
vote
1answer
95 views

Order of accuracy for finite-difference on nonuniform grid

If we evaluate the first derivative of a function F(x) on a 1D grid {$x_i$} by central difference at $x=x_i$ as $$ \frac{dF}{dx} \approx \frac{F_{i+1} - F_{i-1}}{x_{i+1} -x_{i-1}} $$ then it is ...
5
votes
0answers
99 views

How to numerically evaluate this double Integral?

I want to evaluate the following integral: $$\int_{0}^{60} \ \left(\int_{0}^{2z} 0.5\cdot t \left(\mathrm{erf}(t-a) -1 \right)J_{0}(qt)\mathrm{d}t \right)^2 \mathrm{exp}\left(-\frac{(z-a)^2}{2s^2}\...
0
votes
0answers
35 views

What constraints, if any, are there on constructible patterns in Conway's Game of Life?

Conway's Game of Life is Turing-complete. Interesting demos of this: A clock Tetris I note that Turing-completeness doesn't require that any specifically encoded state be reachable, does it? ...
2
votes
3answers
241 views

Comparison of integrals with a function:

Consider the following integral: $$S(q)=\int_{x=2}^q\sin^2\left(\frac{π\Gamma(x)}{2x}\right)dx$$ And consider the functions : $$R(q)=\frac{q}{\log(q)}$$ $$T(q)=\int_2^q\frac{1}{\log(x)}dx$$ I ...
1
vote
0answers
29 views

Why are “instructions retired” more stable than “cycles” or “task-clock” when using “perf”?

I tested the perf tool in Ubuntu 18.04 on a simple benchmark in our compiler (parsing some file). I ran perf several times and ...
5
votes
0answers
238 views

Finding points inside cells of power (generalized Voronoi) diagram

Suppose we have a set of points $p_1,\ldots,p_n\in\mathbb R^d$ as well as a set of weights $w_1,\ldots,w_n\in\mathbb R$. Recall that the power cell associated to the pair $(p_k,w_k)$ is given by: $$\...
0
votes
0answers
39 views

Discretisation by FVM with triangulare mesh

I work on electromagnetic modeling, and I use the finite volume method as a tool, so I want to develop code by the modified finite volume method (with triangular mesh), my problem studied is in a ...
1
vote
1answer
93 views

Composite matrices in Numpy

Lets say I have four matrices A, B, C and D, and I want to combine them together into one new matrix for computation: $$ \left( \begin{matrix} A & B\\ C & D \end{matrix}\right) $$ How can I ...

15 30 50 per page
1
3 4
5
6 7
179