All Questions

0
votes
0answers
12 views

Efficient matrix multiplication for a certain matrix structure

I have the following matrix: $$ C = \pmatrix{A & B} $$ where $B$ is dense and $A$ has significant sparse structure. $A$ is a B-spline collocation matrix so each row has some number of zeros, ...
0
votes
1answer
9 views

How to code the Crank-Nicolson Method for diffusion equation in MATLAB?

So I have discitized the Crank Nicolson Method for diffusion equation, but I don't understand how to put it into matlab. Since the solution isn't separable how is it inputted?
0
votes
0answers
15 views

When referring to pre-order, in-order, and post-order, is this for an ordered BST …? [on hold]

... or is it for a normal binary search tree ( not ordered ). I was reading this post here: https://medium.com/basecs/demystifying-depth-first-search-a7c14cccf056 and I noticed that the in-order ...
3
votes
1answer
46 views

Any way to avoid catastrophic cancellation when computing the discriminant of a quadratic function?

Homework disclaimer... The task: We are using the following algorithm to solve the quadratic equation $x^2+2px+q=0$: $x_1=|p|+\sqrt{p^2-q}\mathtt{;}$ $\mathtt{if}\,p>0\,\mathtt{then}\,...
4
votes
0answers
38 views

Numerical stability of higher order Zernike polynomials

I'm trying to calculate higher order (e.g., m=0, n=46) Zernike moments for some image. However, I'm running into a problem ...
1
vote
1answer
16 views

Average value divergence in spectral method for Poisson equation

I'd like to know how to deal with a divergence when trying to solve the Poisson equation for electrostatics with a simple spectral method. I'm not sure how to best state my problem, so I'll explain ...
0
votes
0answers
18 views

Looking for advices about moleculae dynamics softwares

I am looking for a software where I can check the properties of for instance, real gases like helium, and observe the molecular movements of that gas visually. I want to have a chance to create a ...
0
votes
0answers
17 views

Determine non-contiguous elements in a 2D triangular mesh

I am using ParMetis do the repartitioning of the adaptive mesh. However, ParMetis cannot guarantee that the result partition is a contiguous mesh. Hence, I need to check if there are any non-...
0
votes
1answer
53 views

Implementation of the jacobian-free newton method

In my calculation (of a simple heat equation, for testing) using the newton method I tried to replace the full jacobian matrix with an approximation vector, i.e. replacing $J$ in $$J(u)\delta u=-F(u)$...
2
votes
1answer
59 views

Checking positive definiteness on a hyperplane

Is there a faster way to check whether $A\in\mathbb{R}^{n\times n}$ is positive definite on $b^{\bot}:=\{x\in \mathbb{R}^{n}: x\cdot b=0\}$ than ...
2
votes
0answers
38 views

Nonlinear least squares and regularization

Consider the nonlinear least-squares minimization of a vector of $n$ residuals $\mathbf{f}$ in $p$ parameters $\mathbf{x}$: $$ \min_{\mathbf{x}} || \mathbf{f}(\mathbf{x}) ||^2 $$ This can be done with ...
-1
votes
0answers
16 views

Using Modules; creating files and importing ? Please see attached links [on hold]

I am a super n00b beginner, I have been teaching myself python concepts for the last couple of months using juptyer notebook, and lessons in CFD & similar subjects that I am conceptually familiar ...
0
votes
1answer
38 views

Numerical solution of non-linear first order partial differential equation (HJB)

I am trying to solve a simple optimal control problem using the Hamilton-Jacobi-Bellman equation, numerically in Python. This is proving to be rather difficult as I end up having to solve the ...
0
votes
0answers
39 views

Classifying a nonlinear numerical instability

I am using a piece of code to study magnetohydrodynamics and I have encountered a problem. The code is solving the ideal MHD equations, i.e. the Euler equations with the Lorentz force and Faraday's ...
-1
votes
0answers
13 views

Prove that an infinite set is decidable [on hold]

Given an infinite set C. Prove that C is decidable if and only if there is a function computable, total, injective and growing whose image is C. I can undertand why it needs to be a function ...
0
votes
0answers
29 views

Solve system of polynomial equations with Python

I have 5 at most 4th order polynomials in 5 variables, $$p_i(x_1,x_2,x_3,x_4,x_5) \qquad i = 1, \ldots, 5$$ where all coefficients are either rational or floating point. I'd would like to get the ...
0
votes
1answer
40 views

Changing the domain of a 3D Finite Difference code from cube to sphere

I have an explicit FD (Finite Difference) code for diffusion/heat on a PDE in a cuboid domain, and it works fine. I would like to update the discretized equations and change the code so as to solve ...
1
vote
0answers
30 views

Algebraic recursion of Hermite polynomials in SymPy [on hold]

I want to obtain the algebraic values of, for example, Hermite polynomials using SciPy but in a recursive manner. Using Maple, for example, these can be defined as ...
4
votes
0answers
60 views

Comparing sum of floating points

I am currently working on a numerical algorithm involving a lot of floating point arithmetic, involving some badly conditioned problem sets. I am using the relation $|x - y| / (\max(|x|, |y|, 1)) \...
0
votes
0answers
22 views

Generalization of a matrix known for some values [on hold]

Preliminaries: and  I wrote Maple code for above. Download the Maple code for Above:   Now, we can calculate the Matrix    as follows  for $k=2, M=3$, Question:  How can we write (Maple or ...
0
votes
1answer
65 views

Operation count for GMRES

One can use GMRES as it is, but there is also a version of GMRES called k-step restarted GMRES, which is used for large matrices, where $k$ is some fixed number of steps after which we take a new $x_0$...
0
votes
0answers
28 views

Point-based multigrid method

Most algebraic multigrid methods are scalar or variable based. This means that the initial grid size is identical to the number of unknowns of the problem. It has been stated, that this approach is ...
-1
votes
0answers
48 views

At how fine time resolution do modern computer simulations run at? Do they need to measure ms, ns?

At how fine time resolution do modern computer simulations run at? Do they need to measure ms, ns (and if ns, then at what accuracy)? This sprang to my mind when I was considering, what's the ...
-4
votes
0answers
27 views

What is thr problem in this C programming code? [on hold]

void printNum(int num); int main(void) { int num = 6; printNum(int num); return 0; } vois printNum(int num) { printf("%d", num); }
0
votes
1answer
35 views

Is this a knapsack problem?

I have a set of $K$ keywords. Each of this keywords can have set of bids from $1\$,\dots,N\$$. For each bid for a keyword, it will get a specific amount of clicks and a specific cost. Clicks and Cost ...
-1
votes
0answers
34 views

plotting sinusoidal wave

I want to create a sinusoidal wave surface in Gmsh whose peak is tilted towards the right side. I have created this symmetrical wave using the simple sine wave equation in Gmsh but the original ...
2
votes
0answers
49 views

Identify the components of the (weak form) PDE in structural mechanics

I am trying to identify the weak form of PDE in structural mechanics. I read a lot of papers where they are using the elliptic boundary value problem \begin{equation} \int\limits_{\Omega} \delta \...
0
votes
0answers
37 views

dsyevx or dsyevr: Which should I use for sparse matrices?

I have noticed a subset of lapack selected-eigenvalue solvers with the suffix vx and vr. dsyevx/vr, zheevx/vr etc. The function preambles (along with this previous stack exchange question) say they ...
0
votes
1answer
30 views

Given co-ordinates of 8 vertices, how to calculate the outward normal and surface area for each face of a irregular hexahedron?

I am working on an FEA mesh of hexahedron elements. The elemental level calculations involve finding the surface normals and area for each surface of a hex element. I preferred the vector cross ...
1
vote
1answer
33 views

Mapping derivative information in uniform to non-uniform grid

I'm having two sets of grids. One is uniform and another one is not uniform. I will calculate the derivative in uniform grid points and I like to transfer(map) the derivative to the non-uniform grid ...
0
votes
0answers
58 views

Electrical field of capacitor with FEniCS

I am fairly new to FEM and FEinCS. I worked through the relevant examples of the FEinCS Tutorial (https://fenicsproject.org/tutorial/ and http://hplgit.github.io/INF5620/doc/pub/fenics_tutorial1.1/) ...
0
votes
0answers
31 views

Group mpi process based on a flag [closed]

I need to create a sub-communicator (mi_comm_world_2) based on a bigger mpi communicator (mpi_comm_world). In particular, after ...
0
votes
0answers
15 views

Find a probable prime congruent to 6 mod 7 of a particular form [closed]

I am searching for a prime of this form: $$(2^k - 1) 10^d + 2^{k-1} - 1$$ where $d$ is the number of decimal digits of $2^{k-1} - 1$, which is congruent to 6 mod 7. I reached k=565.000 and there is ...
0
votes
1answer
30 views

Scipy Two-point Boundary value Problem

Nonlinear ODE Statement I would like to use scipy to solve the following: u'' + (u')^2 = sin(x) u(0)=0, u(1)=1 where u = u(x). Approach I am looking at the ...
0
votes
1answer
34 views

What's a time centered Riemann problem?

I am trying to understand the meshless methods as described in https://arxiv.org/pdf/1409.7395.pdf. I'm having trouble understanding the following step: (Page 7, just after equation 17) Now, rather ...
-1
votes
0answers
33 views

How to create a 3D random complex array with conjugate symmetry in matlab or other languages

For a 3D array A to be conjugate symmetry, then A = conj(A([1 nx:-1:2],[1 ny:-1:2], [1 nz:-1:2])) for A having size nx,ny,nz. I will be so happy if I get help on this.
3
votes
0answers
51 views

Gmsh for 3D volume with inclusions

In an attempt to create three-dimensional volumes with inclusions in Gmsh I stumble upon a problem which was non-existent in the two-dimensional case. I'm using the OpenCASCADE geometry kernel ...
-1
votes
0answers
26 views

Non linear system using Gauss Newton

I'm trying to solve this question whose growth function is given as: Pk = (r^k) * P0 Where pk = [0.19 0.36 0.69 1.3 2.5 4.7 8.5 14] k = [1 2 3 4 5 6 7 8] The unknowns I'm trying to solve for is r ...
2
votes
1answer
66 views

Is steady linear elasticity inherently ill-conditioned?

Compared to the transient PDE for linear elasticity, the steady equations appear to less well-conditioned. Are they inherently ill-conditioned without the transient term? The condition number for ...
0
votes
1answer
12 views

Numpy: How to permute array into indices of larger array? [closed]

I have an array of length L with N zeros, and L-N non-zero values. I have another array of length N. I would like to put the values of the shorter array into the positions of the longer array which ...
3
votes
1answer
90 views

Is there any open-source code for a hybrid 2D mesh (triangles and quadrilaterals)?

The question is pretty much the title. Note that I have lots of experience using open-source meshing tool, e.g. Gmsh and OpenFoam blockMesh & snappyHexMesh. Nevertheless, I have no idea on how to ...
2
votes
0answers
52 views

Where does the seemingly official number of certain algorithms come from?

There are a lot of algorithms which seem to have been supplied an official number, such as Algorithm 76, Hierarchical clustering using the minimum spanning tree. Another example is Algorithm 123, ...
0
votes
0answers
58 views

Kerr black hole geodesic simulation in Matlab

I'm trying to implement a simulation for geodesics in Kerr black holes using Matlab. I used the ode's of this paper $$ p_r = \frac{\Sigma}{\Delta} \dot r $$ $$ p_\theta = \Sigma \dot \theta $$ $$ \...
0
votes
0answers
16 views

Given a data set of 3 item tuples (x, y, z), how to predict y to maximize z if given x?

I have a training set of a bunch of three element tuples in the form of (x, y, z) where x, y, and z are all continuous real valued scalars. Given a future x value (which will likely be close but not ...
0
votes
0answers
14 views

Finite Group (Non-)Isomorphism

I am poking at reproducing some fundamental research in group-theory. In particular, I want to reproduce the OEIS sequence #1. The crux of the problem is not generating potential groups, this can be ...
0
votes
1answer
60 views

Solving advection equation - periodic conditions - using roll python function [on hold]

The original post was on stackoverflow : I transfert it here. I have to solve numerically the advection equation with periodic boundaries conditions : u(t,0) = u(t,L) with L the length of system to ...
0
votes
0answers
35 views

convergence rate for the 4node 2d problem

I am running a 4node simulation of a cantilever beam. I calculated the convergence rate for different mesh sizes ( 4x2 8x4 16x8 32x16) and it was 1.7 not 2. what the reasons that might effect the ...
0
votes
0answers
36 views

Quickest solver to linear programming

I have encountered an linear programming problem as follows: $$\max_{x\in\mathcal F_n}~ c_n^t\cdot x_n,\quad \quad \quad \quad \quad \quad (\ast)$$ where $\mathcal F_n:=\big\{x_n\in\mathbb R^{512n^...
2
votes
1answer
54 views

How to find the nearest/a near positive definite from a given matrix?

I'm given a matrix. How do I find the nearest (or a near) positive definite from it? The matrix can have complex eigenvalues, not be symmetric, etc. However, all its entries are real valued. The ...
0
votes
0answers
39 views

Finite Element Nodal Point Field Variable Recovery

I am working on a program which takes values computed at the quadrature points from the finite element method and extrapolates them to the nodal points. I am working with a 10 node tetrahedral element ...

15 30 50 per page