All Questions

Filter by
Sorted by
Tagged with
1
vote
2answers
31 views

Python scipy eigh(Arpack) giving wrong eigenvalues for generalized eigenvalue problem

I am trying to solve a generalized eigenvalue problem using Arpack, right now the code is using LAPACK but that's too slow, we only need a few eigenvalues and the matrices are sparse so using Arpack ...
2
votes
1answer
34 views

Meshing surface of a sphere with a subdomain

I am trying to build a triangle mesh of the surface of a sphere which also includes a subdomain defined by a 'polygon'. Here is a successful example (subdomain defined by the red dots): Note that the ...
1
vote
0answers
58 views

Numerical computation of Lyapunov exponent

I'm trying to compute the Lyapunov exponent for a smooth continuous time dynamical system(say, $\dot{\bar{x}} = f(\bar x)$). I using the QR decomposition method. Here are the steps that I follow. ...
0
votes
0answers
19 views

Save font selection for plots in Paraview

I adjusted plotting fonts in a Paraview scene, saved as .pvsm file, and loaded it in a different Paraview version. The fonts changed. Can this be avoided? Also ...
1
vote
1answer
50 views

Rootfinding algorithm that takes advantage of automatic differentiation

Is there any algorithm (or tricks) for rootfinding to take advantages of automatic differentiation (AD)? Rootfinding algorithms typically solve $$ \mathbf{f}(\mathbf{y}) = \mathbf{0} $$ where $\mathbf{...
0
votes
0answers
11 views

Convert s to ms in a Paraview plot

After composing my Paraview scene, I realised that I need to represent the units in a "Plot Selection Over Time" filter instead of seconds in milli seconds. How can one accomplish this?
2
votes
1answer
79 views

Region of interest in Paraview

I am struggling with this: In a render view in Paraview, is it possible to draw a square or rectangle around the region of interest and have this as a close up render view in another window then being ...
2
votes
0answers
35 views

Collaborative coding platform in the style of Google Colab

(I hope this question is fitting for this SE, I couldn't find very relevant tags) I am looking for an online platform in the style of Google Colab with the following requirements: possibility to run ...
0
votes
0answers
24 views

Finite elements algorith for a fluid in a tube with an elastic obstacle (Fluid-Solid coupling)

I want to solve the model of a tube with an elastic obstacle, something like a simple model of an vessel with a valve. The fluid is given by an evolutionary incompressible Navier--Stokes equations, ...
1
vote
1answer
62 views

Jacobi iterative method

I'm using Jacobi iterative method for finding eigenvalue and eigenvector for hermitian or symmetric matrix. Eigenvectors corresponding to eigenvalues are not exact. The third eigenvector is totally ...
2
votes
2answers
49 views

How to refine the tetrahedron if exist two longest length edge?

In some algorithms to refine tetrahedron, we need to calculate the longest edge. background If exist a tetrahedron with node ABCD, it has edges ...
2
votes
0answers
58 views

Remez algorithm convergence

I have implemented the Remez algorithm in Python where all calculations were done with the Python mpmath library. I have noticed that sometimes the $|E_{max}|$ and $|E_{min}|$ do not monotonically ...
1
vote
0answers
68 views

Which library to use in C++ for fast DCT's?

I need to apply a 1D type-II DCT (Discrete Cosine Transform) to each column of a matrix while normalizing the result in C++. Effectively, I want to multiply my matrix with an orthogonal type-II DCT-...
0
votes
0answers
33 views

Jacobi Gauss-Seidel Method

...
2
votes
1answer
25 views

How to filter customer voice from customer - agent conversation recordings?

I have a doubt on the project I'm working now. Actually I want only customer voice from the recordings which contains customer-agent conversation.But I have no idea to filter customer voice from ...
6
votes
2answers
102 views

What makes a good computational grid?

Most computational methods for solving PDEs are grid-based. What makes a computational grid "good", other than being sufficiently fine to resolve features of numerical solutions? Are grids ...
1
vote
0answers
24 views

Solution of non-linear Poisson equation does not match reference

I'm trying to solve the non-linear Poisson equation as a first step to solve the drift-diffusion equations for semiconductors. For reference, I'm using a preprint from the Weierstrass Institut (which ...
1
vote
0answers
23 views

Multiplying by E[xy'] where only some statistics of xy' are known

(cross-posted on crossvalidated) For random variable $(x,y)$ in $\mathbb{R}^{d}\times \mathbb{R}^{d}$ and vector $v \in \mathbb{R}^d$, I need to perform the following matrix vector multiplication. $$T(...
4
votes
1answer
77 views

Accuracy of Explicit Euler method (finite difference) decreases as Δx decreases, shouldn't it increase?

The price of a commodity can be described by the Schwartz mean reverting SDE $$dS = \alpha(\mu-\log S)Sdt + \sigma S dW, \qquad \begin{array}.W = \text{ Standard Brownian motion} \\ \alpha = \text{ ...
3
votes
0answers
70 views

Inverse problem with uncertain forward operator

Suppose I want to solve a linear inverse problem. In this example we take a convolution with the kernel: $$\frac{1}{(y^2+z^2)^{3/2}}$$ We only take a fixed $z$ for the computation and convolve with ...
1
vote
1answer
60 views

How is the mixed 2nd partial derivative simplified to a more efficient form?

I'm implementing the Finite Different 2nd and 3rd derivatives in my research and naturally I'm looking for the most efficient approach. From https://en.wikipedia.org/wiki/Finite_difference#cite_ref-...
3
votes
0answers
64 views
+50

Numerical Issues with DDE from SEIRU$\delta$ model

I'm new in this community. I moved this question from Math community. I'm reading the following article Article Here and my target is to replicate the results for a project. SEIRU Model: I obtained ...
1
vote
2answers
66 views

Coding up a toy model for gradient-descent — what step size to choose?

I'm coding up a simple model for gradient-descent, and using it to minimize some simple, deterministic functions. What step size could I choose that's simple enough for me to get started with? Should ...
1
vote
1answer
56 views

Implicit methods for variable coefficients based on equations of state

For example I have an equation that goes something like $ \partial_t \rho = -\nabla\cdot (\rho u) + \nabla \cdot(D(\rho, T) \nabla \rho) + \rho_s $ ($\rho, \rho_s, u, T$ are coupled with a few other ...
1
vote
1answer
68 views

If analytically, a function is not differentiable at a point, does it make sense to write a finite difference code for the function at that point?

What would happen if I wrote a finite-difference code evaluated at a point where the function isn't differentiable analytically? I'm trying to think analytically vs numerically. Thanks,
4
votes
1answer
106 views

When is it easy to invert a sparse matrix?

(Crossposted on cstheory.SE) When is it easy to invert a sparse matrix? Specifically, I'm wondering about the cases in which matrix inversion has similar cost to sparse matrix multiplication, hence ...
0
votes
1answer
61 views

Coding up Newton's method for a mapping from R^2 to R — the Jacobian wouldn't be invertible

I'm trying to code up in Matlab a multivariable Newton's method, for a mapping from R^2 to R, but the Jacobian would be a 2x1 matrix, not square, so it wouldn't be invertible. Does this mean that ...
2
votes
1answer
140 views

Finite element (1D) for steady state non-linear problem

I need to solve with linear finite elements the equation $$\frac{\partial }{\partial x}\Bigl(\text{sgn}(x) u \Big) +\frac{\partial}{\partial x} \Bigl[ \sqrt{u} \frac{\partial u}{\partial x} \Bigr] =0$...
17
votes
1answer
2k views

How can I avoid catastrophic cancellation?

I have the following formula that I need to rewrite in order to avoid catastrophic cancellation. $$y =\sqrt{\frac{1}{2}\left(1-\sqrt{1-x^{2}}\right)}$$ As $x$ becomes smaller, $\sqrt{1-x^{2}}$ ...
1
vote
0answers
52 views

How do I apply BDF2 in a STRANG splitting

I have a 3D diffusion equation that I want to solve using a time splitting (2D+1D). Assume that $A$ is the 2D discrete diffusion operator and $B$ is the 1D discrete diffusion operator. I want to use a ...
0
votes
0answers
40 views

FEM solution becoming wider as number of nodes increase

My FEM scheme uses a 4-node quadrilateral element with bilinear shape functions. The simple problem I'm solving is. $\nabla ^2 f = 5$ But as I increase the number of nodes, the plot of the solution ...
0
votes
0answers
29 views

How to describe function convergence and function tolerance for numerical root-finding?

I'm currently doing some practice problems on root-finding and am writing up some notes / comments on my code. In my solver code, if my function value is below the tolerance that I've set, should I ...
0
votes
0answers
36 views

Am I computing this complex root correctly? [migrated]

I'm playing numerically with root-finding in Matlab but am a bit rusty with complex roots that come in conjugate pairs -- for polynomials with real coefficients. Am I justifying these steps correctly: ...
1
vote
1answer
119 views

FEM does not match exact solution

I am trying to solve : $$-u''(x) + u(x) = \sin(2\pi x)\, ,\quad 0<x<1\, ,$$ $t>0$, with $u(0) = u(1) = 0$. That has as exact solution $$u(x) = \frac{\sin(2\pi x)}{1 + 4\pi^2}\, .$$ But the ...
1
vote
1answer
108 views

Non-Linear advection diffusion with nondifferetiable advection term

I'm looking at Murray's book: Mathematical biology: an introduction , first volume, pag. 404 In particular, I'm interested to solve the following PDE: $$\partial_t u = \partial_x (\text{sign}(x) u) + \...
0
votes
0answers
22 views

Library/project on python for solving conjugate heat transfer problems

Can someone recommend a python library that can help me solve heat transfer problems between turbulent fluids and solids? Thanks.
2
votes
1answer
40 views

Solving MX=N where M is structured as a Gaussian 4th-moment tensor

I'm looking to solve numerically the following equation for $(d,d)$ variable $X$, in Einstein summation notation $$M_{ijkl}X_{kl}=N_{ij}$$ Where $M$ is a $(d,d,d,d)$ 4th-moment tensor of random ...
2
votes
1answer
84 views

Ill-condioned Linear System and Gaussian Elimination

Suppose that I have a linear system $Ax=b$ such that $A$ is ill-conditioned. Can I say that it is dangerous to find a solution with Gaussian Elimination for this system, or does there exist some class ...
1
vote
0answers
62 views

How can I practice multivariable root-finding?

Recently, I've been reading up on various root-finding / optimization algorithms such as the Levenberg-Marquardt method, Gauss-Newton, Conjugate Gradient, trust-region and trust-region-dogleg. I've ...
0
votes
0answers
38 views

Split of complex parts in weak form

I am working on a numerical model to simulate the acoustic and elastic wave propagation in frequency domain via the Finite Element Method. Basically, the problem is to solve the Helmholtz equation in ...
0
votes
0answers
46 views

Simple Finite Volume method for Stokes equations

I'm trying to understand how to implement fluid problems using Finite Volume Elements, for example a simple Finite Volume Elements for the Stokes problem: $-\nu\Delta u+\nabla p =f$ in a bounded ...
3
votes
2answers
151 views

1D FEM for nonlinear diffusion coefficient

I want to solve with linear finite elements the equation $$\partial_t u = \partial_{x}(a(u)\partial_xu)$$ in the domain $t \in [0,1]$ and $x \in [-L,L]$. Here $a(u)$ is just a function of $u$. ...
1
vote
0answers
52 views

Is there any function to calculate condition number of sparse matrix in Eigen libraray?

The function JacobiSVD and BDCSVD can calcuate condtion number of a dense matrix via singular values. However I need to know condition number of a sparese matrix due to slow computation speed using ...
2
votes
2answers
85 views

Petsc Mat object in class

[Relatively new to Petsc] I am writing an object oriented project and my idea is to have parallel objects when the user constructs the object with MPI arguments. So have member data Mat and fill/...
3
votes
1answer
86 views

Efficient solution to a structured symmetric linear system with condition number estimation

I have a real-valued linear system $Hx = b$ where $H$ is symmetric matrix** (not necessarily positive/negative definite) with a very particular structure: $$ H = \begin{bmatrix} D && B \\ B^T &...
2
votes
2answers
57 views

In a dynamical system, what might be a good reason why periodicity in an object's velocities is important?

I'm studying periodic motions in a dynamical system and, as a newbie, I narrowly think of an object's periodicity in its spatial x-y coordinates, but what might be a good reason why the existence of ...
0
votes
0answers
21 views

Hi I am trying to model a 2D Lug angle using Gmsh 4.6. How can I combine transfinite quad and regular full quad meshes in the following geo file?

I need transfinite mesh a small section of the bolt hole to insert a crack. However, The transfinite mesh and regular full quad mesh seem being incompatible and throwing errors. How can I combine ...
0
votes
0answers
29 views

Why does COMSOL treat a well as a rectangular cube?

I'm trying to learn COMSOL for a graduate research project and am struggling through a flow and transport in 3D tutorial. As such I'm walking through my boundary conditions and trying to figure out if ...
1
vote
1answer
57 views

Imposing pressure variation instead of Dirichlet boundary conditions on Finite Element Method

I always see Finite Element codes solving PDE with Dirichlet or Neumann boundary conditions. But, I have a problem now consisting of a straight cylinder with a circular base (a simple 3D tube), with ...
0
votes
0answers
29 views

Reference request: Textbook similar in structure to “Computational Materials Science: An Introduction” by June Lee for Computational Biology

In the Computational Materials Science: An Introduction by June Lee, he discusses molecular dynamics and density functional theory with examples from LAMMPS and QuantumEspresso, and explains LAMMPS ...

15 30 50 per page
1
2 3 4 5
182