All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Algebraic multigrid as solver and as preconditioner

My question is around the efficiency of AMG. In which case AMG can perform better,as solver or as a preconditioner(for example a Krylov space method as CG)? Assume the case of elliptic pdes.
1
vote
0answers
8 views

Minimize MAE for sum of powers

The model is $$y_i=\beta\big(x_{i1}^\alpha+x_{i2}^\alpha+...+x_{im_i}^\alpha\big)+\epsilon_i\textrm{ for }i=1, 2, ..., n$$ I want to minimize the MAE, i.e. $$\Sigma_{i=1}^n{\big|y_i-\beta\big(x_{i1}^\...
-1
votes
0answers
11 views

I need help to code logical exor funtion in C++ [closed]

[![logical exor funtion][1]][1] I'm done on the first definition where input is two intergers in a logical exor funtion. Now I have no idea on how to do it binary integers in a dynamic array. Please ...
0
votes
1answer
35 views

Solve integral $ \int_{-\infty}^{\infty} e^{-x^2}dx$

i trying to solve this integral $$\int_{-\infty}^{\infty} e^{-x^2}dx$$ I'm using this CODE ...
0
votes
0answers
32 views

Is there a commercial program to compile a Finite Element Fortran program (1980)?

The fortran used come from Montreal Ecole polytechical in 1980 I need some thing that can read fortran and compile it in a Windows 7 or windows 8 operating system.
-1
votes
0answers
43 views

Running numerical hydrodynamics simulation on Apple Silicon M1?

My PC just broke and I'm looking for a replacement and thinking about getting the Apple Mini M1. But I need to run PLUTO CODE, an numerical hydrodynamics simulation, do anybody knows if this will run? ...
0
votes
0answers
24 views

Computing matrices for Model Predictive Control

In model predictive control, an optimization problem is solved at every time instant and it is very common to write down the matrices in a compact form. Without going into the details of the ...
1
vote
1answer
39 views

How to Invert a Poorly Conditioned Matrix

In my research, I need to invert a Fisher matrix in order to get a covariance matrix for me to do parameter estimation. Unfortunately, the values of Fisher matrix vary by many orders of magnitude, and ...
3
votes
1answer
73 views

How frequently scientific code uses comparisons NaN == NaN?

How frequently scientific code uses comparisons NaN == NaN? Reason of asking: from time to time compilers / software floating-point library implementations have ...
-1
votes
0answers
18 views

Adoption related Research Analysis

So, I have this dataset that has common questions about adoption for(child/adolescent) and then questions specific to children and adolescent separately. In short 3 classes of question . For starters ...
2
votes
1answer
39 views

Why is CVXPY throwing a DCP error with cp.sqrt but no error with cp.norm

I am trying to use CVXPY to optimise signal-to-noise-plus interference ratio (SINR) for a visible light communication (VLC) system. I have one of my SINR constraints stated as \begin{equation} \...
3
votes
1answer
36 views

Nonlinear root solving libraries which accept a Jacobian in band-storage

I'm in search for a library for solving large systems of non-linear equations, similar to MINPACK, but unlike MINPACK, can accept a Jacobian in band-storage. My Jacobian is sometimes not invertible, ...
2
votes
1answer
30 views

Algorithm to merge two polygons (using connectivities)?

I am struggling with implementing an algorithm that does one simple thing: Consider two polygons (one can just draw any two polygons and number their vertices), whose connectivities in a node list are:...
1
vote
1answer
48 views

nquad Integration in SciPy

I am trying to self-learn SciPy and evaluate the following quadruple integral using scipy.integrate.nquad: $$\int_{0}^{1} \int_{0}^{1} \int_{0}^{1} \int_{0}^{1-x} (...
0
votes
0answers
11 views

How to convert this code to scan random datas instead of binned datas?

I am new to fortran and I am trying to write a code using random datas instead of binned datas in x, y, z as shown in my sample code. ...
0
votes
1answer
32 views

Implementing Dirichlet BC for the Advection-Diffusion equation using a second-order Upwind Scheme finite difference discretization

i am implementing a Matlab code to solve the following equation numerically : $$ (\frac{\partial c}{\partial t} =-D_{e} \frac{\partial^2 c}{\partial z^2} +U_{z}\frac{\partial c}{\partial z}) $$ with ...
0
votes
0answers
22 views

Estimating the Jacobian in Harmonic Balance Method

I am trying to solve a set of ODEs using the Harmonic Balance method. In order to do this, I need to compute the Jacobian of the set of equations. However I am very confused regarding the dimensions ...
0
votes
0answers
26 views

“This DAE appears to be of index greater than 1” daeic12 (line76) error code

Hi I am trying to solve a set of pde converted into ODE and DAE using central finite difference method. I have used the MATLAB 'solve' command to determine the coefficients of fictitious nodes for ...
5
votes
2answers
98 views

Exponent log to compute reciprocal power?

A MATLAB library seems to overcomplicate a computation: exp( (log(a) - log(b))/b ) which is mathematically equivalent (assuming real & positive ...
3
votes
1answer
93 views

Quick way to find a common basis of eigenvectors between 2 matrices : valid or not?

Following the advise of @Federico Polonion a previous post, one suggested, to find a basis of common eigen vectors between 2 matrices, to simply do : Generate 2 ...
-1
votes
0answers
29 views

Calling scipy.integrate.odeint, solve_ivp, or any possible python solver in matlab

Do you know any way to call scipy.integrate.odeint, solve_ivp, or any python solver directly within a Matlab code? I have tried ...
3
votes
1answer
54 views

Understand the need for Welford's online algorithm

I am puzzled by the Wikipedia entry discussing many online algorithms for computing the sample variance, including the Welford's online algorithm. In particular, the sample variance $s_n^2$ can be ...
-1
votes
0answers
26 views

What is the issue with my Code here? [closed]

I am trying to read in a CSV file for one of my boundary condition in OpenFoam, but for some reason OpenFoam is not reading the file. There is no error message or anything, it just not showing the ...
0
votes
1answer
66 views

Compute 1st derivative with backward difference approximation in python

I am trying to write a function to compute 1st derivative with backward difference approximation. $ u'(x_i) = \frac{u(x_i) - u(x_i - \Delta_x)}{\Delta x} \equiv D_- u(x_i).$ And for the first point, ...
2
votes
1answer
133 views
+100

Matlab - Compute approximative common eigenvectors basis between two matrices as a function of tolerance

I am looking for finding or rather building common eigenvectors matrix X between 2 matrices A and B such as : ...
0
votes
1answer
57 views

Technique to find the CFL condition using the Galerkin method in space and finite-difference in time?

I am using the Galerkin method (Discontinuous to be precise) to discretize in space the scalar linear wave equation and the explicit second order centered finite difference scheme to discretize in ...
4
votes
1answer
55 views

Backwards Difference Implicit Method for Nonlinear Parabolic PDE in Python

Original Stack Overflow Question: https://stackoverflow.com/questions/65683788/indexerror-index-31-is-out-of-bounds-for-axis-1-with-size-31?noredirect=1#comment116218335_65683788 PDE: u_t = u_xx + u(...
1
vote
0answers
36 views

Integrating a wavelike equation with absorbing boundary conditions

I am trying to numerically solve the following equation: $\frac{\partial^{2} \phi}{\partial t^{2}}-\frac{\partial^{2} \phi}{\partial x^{2}}+V(x) \phi(x, t)=0$ On some domain, with: $\phi(x, 0) = I(x)$ ...
1
vote
1answer
61 views

Gauss Integration of $\sqrt(x)$

I want to construct a gauss integration for the weight function $w(x) = x^{1/2}$ for $$\int_{0}^{1}x^{1/2}f(x)dx = a_{1}f(x_{1})+a_{2}f(x_{2})$$ Solving \begin{align*} a_{1}+a_{2} =& \int_{0}^{...
1
vote
0answers
49 views

3D Matrix (Tensor) Operating On a 1D Vector

Say you have a tensor $T$ and the components are represented by a 3 by 3 by 3 matrix. And you want to use that tensor to map a vector $u$ into a new vector $s$, both of which are 3 by 1 column vectors....
-1
votes
0answers
21 views

Help in agglomerating a mesh with Metis?

I have got a mesh of triangles (for a finite element code) that I'd like to partition into polygons, much better if convex. I tried metis and it is very complicated but powerful if one knows about ...
0
votes
0answers
24 views

Split classroom sizes in half linear integer programming

I work for a school who is looking to split students into two groups for COVID related reasons. Ultimately we need to split the students by class section and try to keep families to be in the same ...
2
votes
0answers
125 views

Parametric nonlinear programming

I believe, I have a parametric nonlinear optimization problem. The non-convex constraints depend on some parameters, and I seek a solution that satisfies these constraints for all parameters in a ...
5
votes
1answer
104 views

Solving PDEs in parallel

I have read different approaches on how to solve pdes in parallel which are discretized using finite element method. For example: Non-overlapping domain decomposition approach as mentioned in https://...
0
votes
1answer
44 views

Error too large in leapfrog method for solving the wave equation of a vibrating string

I have been trying to figure out what I did wrong for the last two days. I do not know if I actually did something wrong or if the error is supposed to be this large in usual leapfrog problems. I ...
1
vote
1answer
36 views

Finite element analysis software for acoustic and electrostatic

I need to do a simulation for my thesis project involving some piezoelectric nanoparticles in a fluid beamed with ultrasounds. I'm looking for a software for such simulation and for now it seems me ...
2
votes
1answer
82 views

Efficiently compute a projection matrix from Householders reflectors

Let $A \in \mathbb{R}^{m \times n}$ where $m \geq n$. Let $B$ and $\tau$ be the result of applying LAPACK's dgeqrfp method (R on the upper right triangle, and the ...
0
votes
0answers
52 views

Interpolation of a Concave Mesh

I would like to have an algorithm that interpolates the values attached to nodes in a concave mesh mesh. To be me precise, assume we have a point cloud P (e.g. in 3 dimensions) and a list of edges E ...
0
votes
0answers
13 views

How to define "Characteristic length in Ansys CFX Power Syntax script?

I am trying to evaluate Reynolds number in Ansys CFX 2020 R2 using CCL/Perl script on different domains in a radial turbine. But for that, I need to define the Characteristic length. So I define the ...
0
votes
0answers
9 views

Different values of Gaussian Integration in Pracma library in R

I want to construct a gauss integration for the weight function: $$w(x) = x^{1/2}$$ $\in(0,1)$ of the form: $$\int_{0}^{1}x^{1/2}f(x)dx = w_{1}f(x_{1})+w_{2}f(x_{2})$$ \begin{align*} w_{1}+w_{2} =...
1
vote
0answers
34 views

N-body correct scaling

I realized an usual way to scale an N-body problem for an N-body simulation is by choosing units such that gravitational constant $G = 1$, but I'm probably doing it the wrong way. Suppose I simply ...
0
votes
1answer
56 views

How to compute gradient of each node in finite element method?

I have a problem with computing gradient of each node in finite element method. I can get the value of each node. But how can I get the gradient? I know $u = \sum u_i \phi_i$ where $\phi_i$ are the ...
7
votes
1answer
134 views

Which finite difference better approximates $uu'$?

I want to approximate $uu'$ with a finite difference. On the one hand, it seems to be $$(uu')_i=u_i\frac{u_{i+1}-u_{i-1}}{2\Delta t}=\frac{u_iu_{i+1}-u_iu_{i-1}}{2\Delta t}$$ On the other hand, $$(uu')...
0
votes
0answers
26 views

Largest triangle that contains a point

Given the location of $n$ points on a 2D plane ($P_1, P_2, \ldots, P_n$); and the location of a special point $X$. Find three points $P_i,P_j,P_k$ ($i \neq j \neq k$) such that point $X$ is inside the ...
-1
votes
0answers
31 views

Gmsh undesired behaviour 3D mesh

I would like to generate a 3D hexahedral mesh starting from a STL file using Gmsh 4.8.0. I followed these steps: Opened a STL file: file->open Added a volume: Modules -> Geometry -> ...
-1
votes
0answers
26 views

Defacto Barnes Hut / N-Body MPI C implementation

I'm looking for a relatively straightforward but robust MPI-based parallel n-body application implementation in C/C++ -- ideally one that's off the shelf and has been used in other papers before. A ...
-1
votes
0answers
25 views

Is it ok to get the parameter of a random variable, from a random variable itself?

I want to generate the parameter, for a Poisson distribution, from a lognormal distribution. Has there been literature on if this is proper in probability & statistics, or are there nuances to ...
-1
votes
0answers
21 views

How could I find out how many FLOPs my calculator is capable of?

Looking at previous S.E answers, we have a formula for this: The theoretical peak FLOP/s is given by $$ \text{Number of Cores} * \text{Average frequency} * \text{Operations per cycle} $$ After ...
0
votes
0answers
27 views

Parameter sampling from a 3D isosurface in R

Before we start, a small disclaimer: I am not a computer scientist, and the field of isosurfaces is new to me, so hopefully, the question is phrased clearly:) Otherwise, let me know, and I will (try ...
0
votes
1answer
58 views

Finite Element Analysis based on contractions of a subset of edges in enterior of mesh

I am modelling a problem that is "driven", not by typical boundary conditions but, by contractions in its interior. In a finite element analysis, I can specify the new lengths (not ...

15 30 50 per page
1
2 3 4 5
187