# All Questions

9,038 questions
Filter by
Sorted by
Tagged with
71 views

23 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 ...
109 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 : ...
25 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 ...
80 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/...
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: ...
89 views

52 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 ...
91 views

### Solution of Cahn-Hilliard equation

I need to solve the Cahn-Hilliard equation $$\frac{\partial u}{\partial t} = \Delta(f(u) - \epsilon^2\Delta u), \hspace{.5cm}(x, t)\in \Omega\times(0, T],$$ using mixed formulation \...
189 views

### Central differencing scheme for second derivative leads to ill-conditioning

The central difference scheme: $$\frac{d^2u}{dx^2}=\frac{u_{n+1}-2u_i + u_{n-1}}{\Delta x^2}$$ yields a tridiagonal coefficient matrix [1 -2 1]; As the number of points gets larger, this matrix ...
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 ...
28 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 ...
66 views

### R function or package for carrying out maximum likelihood techniques in random effect models

I am applying optim() function in R to obtain maximum likelihood estimates of the fixed effects and random effects in a model with bivariate random effects. The ...
35 views

### How to solve for underlying function from discrete data set containing integral of that function

New to Computational Science, I hope I'm on the right exchange network for this question. I have a time series data set that contains the sum of a source data set representing an exponential decay ...
190 views

### Why lattice Boltzmann despite its huge number of mesh points still has worse accuracy in comparison to FEM for calculating wall shear stress?

I'm just doing a very simple experiment. I'm calculating wall shear stress based on Poiseuille flow for a pipe by using lattice Boltzmann method (LBM) and FEM to compare their values with the ...
41 views

### How to make fuzzy rules?

I have a dataset with weather factors(rainfall, temperature, humidity etc.) and crop yield. I want to make fuzzy rules. Considering the large number of features, it cannot be done manually by ...
180 views

### On the reordering of sparse matrices

I have been reading on different techniques used to reorder sparse matrices to achieve better performance, the most popular being the Cuthill-McKee or Reverse Cuthill-McKee algorithm. Most of those ...
102 views

### Accurate and efficient computation of the logarithm of the ratio of two sines

For exploratory work related to special function implementations, I need to compute $\log \frac{\sin y}{\sin x}$, where $0 \le x \le y \le 2x < \frac{\pi}{2}$. Cases with $x \approx y$ in ...
19 views

### Show deformed mesh in Comsol

I am using COMSOL Multiphysics 5.2a in order to do thermal, mechanical and thermo-mechanical simulations. Due to a boundary load, my components get deformed which I can simulate very well. However, ...
59 views

69 views

### How to avoid gsl root finder evaluate function outside its domain

When I use the newton's method or hybrid solver in the GSL package to deal with 1-D or multidimensional root solving problems, the code frequently crashes when the solver requests function value ...
144 views

### Efficient root finding algorithm for monotonic function

This is my first time asking a question here, so I may not be asking this in the right place. I am trying to find the roots of a monotonic function with as few function evaluations as possible. I ...
31 views

### Reference for learning the linear algebra of optimization [closed]

What's a good linear algebra reference for optimization that uses standard linear algebra curriculum topics such as inner products, orthogonality, gram-schmidt? Some of the current material I'm ...