# All Questions

9,344 questions
Filter by
Sorted by
Tagged with
3 views

### Shape recognition of tangientially connected polygons using openCV

Lately, I have encountered the following problem, namely how to recognize the shapes of particular polygons. I have realized that quite straightforward to do so when the polygons are separated by ...
13 views

### How to solve a Stiffness matrix?

I am quite new in this field. For my university I prepared a stiffness matrix to solve for a project group. This matrix consists of 450 equations with 450 unknows (it's a Matlab script) and I have the ...
16 views

### Solve for large array of PD matrices

I have N matrices that are positive definite, and I have to solve for a M vectors. As M is large in my case, doing all solves simultaneously using np.linalg.solve ...
12 views

### Error estimation in perturbative term of ode approximate solution

I've implemented a code which allow me to find the solution of a perturbed orbit (3-body system) and I was wondering how could I find the numerical error caused by the method I'm using (Runge-Kutta 4)....
36 views

### Model and solve nutrition optimization problem: how to?

How to solve/assess the following problem? Given: $N$ ingredients like apples, bread etc. Mass of an ingredient $j$ is in this simplified model a sum of macro nutrients carbohydrates, proteins and ...
68 views

### Adaptive Lagrangian-Eulerian methods and practical benchmark results

Does anyone know of any published study that talks about the practical aspects of running Adaptive Lagrangian-Eulerian techniques for solid and/or fluid mechanics problems? I'm looking for things ...
111 views

12 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 ...
248 views

### Gmsh for .inp file

How do I get an .inp file from Gmsh? I need to create a simple geometry and mesh it and define the boundary conditions in Gmsh and export it as an ...
104 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 ...
81 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 ...
43 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 ...
38 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.
2k views

### Need for quad precision in scientific computing?

Even if quad precision is not directly supported by most CPUs, many Compilers (GNU, Intel) support them. Also some software packages allow to compile with quad precision, e.g. PETSc. But is there ...
53 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? ...
33 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 ...
34 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:...
241 views

### How to compute Singular value decomposition of a large matrix with Python

Language: Python3 Problem: I have a matrix Q of shape [51200 rows x 51200 cols] stored in a binary file, each of the element in this matrix has a data type of complex64. To load the data into memory I ...
44 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 \...
41 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, ...
8k views

### Use of machine learning in computational fluid dynamics

Background: I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for ...
50 views

62 views

### Determining the voxels between two boundary surfaces

Issue description 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 ...
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. ...
113 views

### How to find a pair of divisors as close as possible to each other?

For a given integer $n\in\mathbb{N}^*$, I want to find a pair $(x,y)\in{\mathbb{N}^*}^2$ such that $x*y=n$ and $|y-x|$ is as small as possible. A naive algorithm I found is : ...
99 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 ...
67 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, ...
24 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 ...
59 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 ...
27 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 ...
55 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 ...
30 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 ...
18k views

### Plot integral function with scipy and matplotlib

I want to plot a numerical integral function of some function $f$ using scipy and matplotlib. How can I do this? I tried the ...
649 views

### Interpolation using compactly supported radial basis function

I have been struggling for two days with the following problem. I would like to do a $d$-dimensional interpolation over some data. I tried first to use polyharmonic splines, but when the size of data ...
28 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 ...