All Questions
11,341
questions
0
votes
1
answer
64
views
a question about kernelized locality preserving projections
kernel LPP is of form:
$$\min_{\alpha} \ \alpha^{T}KLK\alpha
\\
s.t. \ \alpha^{T}KDK\alpha = 1$$
and it eventually results in solving generalized eigenvalue problem below:
$$KLK \alpha= \lambda KDK \...
16
votes
1
answer
6k
views
Pressure as a Lagrange Multiplier
In the incompressible Navier-Stokes equations,
\begin{align*}
\rho\left(\mathbf{u}_t + (\mathbf{u} \cdot \nabla)\mathbf{u}\right) &= - \nabla p + \mu\Delta\mathbf{u} + \mathbf{f}\\
\nabla\cdot\...
15
votes
2
answers
3k
views
FeniCS: Visualizing high order elements
I've just started messing around with FEniCS. I am solving Poisson with 3rd order elements and would like to visualize the results. However, when I use plot(u), the visualization is just a linear ...
2
votes
1
answer
417
views
Mixed FEM vector indices of pressure and velocity in FEniCS
Looking at the stokes-iterative demo of FEniCS, after solving the linear system using
U = Function(W)
solver.solve(U.vector(), bb)
the solution ...
6
votes
2
answers
138
views
How many bits to unambiguously represent fixed-point division?
Suppose I have a function which divides an $m$-bit unsigned integer $a$ by an $n$-bit unsigned integer $b$ and returns the quotient as a fixed-point number with $t$ fractional bits, truncating towards ...
0
votes
0
answers
34
views
Computation of potential flow using dirichlet conditions [duplicate]
I know I already posted this question and I thank you for your answers, but unfortunately I didn't find what I was looking for among them. Anyway now I'll rewrite the question more clearly, because ...
11
votes
3
answers
2k
views
How should non-constant coefficients be treated with finite-volume first order upwind scheme?
Starting with the advection equation in conservation form.
$$
u_t = (a(x)u)_x
$$
where $a(x)$ is a velocity which depend on space, and $u$ is a concentration of a species which is conserved.
...
3
votes
2
answers
919
views
Simulating laminar fluid flow in microfluidics device
I just started working in a lab that is trying to design microfluidics devices to trap and manipulate colonies of E. coli cells. Given a 3D model of such a device created in Autodesk Inventor (or a ...
5
votes
2
answers
243
views
Improving the time integration of implicit discretized PDE with a non-linear source term
This might be a naive question, but when applying a implicit discretization to a PDE with a source term, should the source be averaged in time? For example if we take the diffusion equation with a non-...
6
votes
0
answers
701
views
Stochastic Galerkin projection approach for using generalized polynomial chaos expansion (GPCE) in solving PDE
I want to know if there is any way to define the test and trial function in the way that I want instead of using the default functions. So if I want define the polynomial and basis and coefficient, ...
4
votes
1
answer
447
views
Verlet Leap-frog Method of approximating orbits
I found the following simulation of an orbit given the semi-major axis of the ellipse, eccentricity, initial velocity, the mass of the object being orbited, and initial position of the orbiting ...
0
votes
2
answers
181
views
Speed up DG FunctionSpace evalutation [closed]
today I tried some evaluation on a DG function space (Fenics 1.2.0).
In my calculations I need to use meshes with a large number of cells (~10mio).
At the moment it takes a very long time to create a ...
6
votes
1
answer
461
views
Calculate large and small frequency separation for the Sun
I want to determine the big and small frequency seperation from timeseries data for the sun. An excerpt of the data (timeseries and power series) is plotted below.
The power series is calculated in ...
3
votes
2
answers
2k
views
How can I calculate numerically an electrical potential distribution from an electric field distribution?
I want to calculate the unknown electrical potential distribution $\phi(x)$ (notice this is a function of $x$) from a known electric field distribution $\boldsymbol{E}(x)$ using the Poisson equation,
...
1
vote
2
answers
1k
views
How can I build a mesh with holes for use in FEniCS?
This is my first time using FEniCS. I am trying to solve an elliptic PDE, fairly similar to the Laplace equation, on a rectangle with two holes in it. The holes are level sets of an energy function, ...
6
votes
1
answer
361
views
Boundary value method for equation $u_{tt} = u_{xxx}$
I have this funny equation
$$
\frac{\partial^2 u}{\partial t^2} = \frac{\partial^3 u}{\partial x^3}, \qquad x \in [0,1], \qquad t \in (0,T]
$$
with initial conditions $u(x,0) = \sin(2\pi x)$, $\frac{...
7
votes
1
answer
417
views
Potential flow around a non-symmetric obstacle using stream functions
I've seen that there is a way to use the finite differences method, on a cartesian orthogonal grid, to perform calculations on potential flow about an obstacle without using the Neumann conditions, ...
11
votes
2
answers
4k
views
Discontinuous Galerkin / Poisson / Fenics
I am trying to solve the 2D Poisson equation using
the Discontinuous Galerkin method (DG) and the following
discretization (I have a png file but I am not allowed
to upload it, sorry):
Equation :
$$\...
8
votes
2
answers
4k
views
Open-source 3D FEM Solver for Electromagnetics (Time-Harmonic Maxwell)
I was wondering if there exist any good (accurate/fast/easy-to-use) open-source FEM solvers for 3D time-harmonic Maxwell's equations. I am looking to simulate systems a few wavelengths large in the X/...
1
vote
1
answer
99
views
Solving an ODE without a boundary condition [closed]
I have an ODE without a boundary condition:
$\small\left(\frac{d}{dr}C(r)\right)^4-2C(r)\left(\frac{d^2}{dr^2}C(r)\right)\left(\frac{d}{dr}C(r)\right)^2+2\left(\frac{d}{dr}C(r)\right)C(r)^2\left(\...
2
votes
4
answers
2k
views
Simple FEniCS problem shape mismatch
This presentation by the Imperial College in London has a nice example in it, on page 8, Burgers Equations. The first part of their code reads like this:
...
4
votes
1
answer
2k
views
calculation time in Fluent
I'm making a model of a square box where water comes in and the water level rises. I want it to be a transient, turbulent, VOF-model. The velocity of water entering changes in time ($-0.2$ to $0.2$ m/...
13
votes
2
answers
2k
views
Does the "cofactor technique" for inverting a matrix have any practical significance?
The title is the question. This technique involves using the "matrix of cofactors", or "adjugate matrix", and gives explicit formulae for the components of the inverse of a square matrix. It is not ...
8
votes
2
answers
16k
views
How to discretize the advection equation using the Crank-Nicolson method?
The advection equation needs to be discretized in order to be used for the Crank-Nicolson method. Can someone show me how to do that?
7
votes
2
answers
2k
views
FEniCS: boundary conditions for electrostatic problems with dielectrics
I carefully read all circa 70 pages of FEniCS tutorial and I still do not understand how to solve electrostatic problems when I have materials with different dielectric constant. The self contained ...
16
votes
3
answers
2k
views
Is variable scaling essential when solving some PDE problems numerically?
In semiconductor simulation, it is common that the equations are scaled so they have normalised values. For example, in extreme cases electron density in semiconductors can vary over 18 order of ...
14
votes
5
answers
14k
views
Meshing 3D surface data in python
I have a dataset of 3-dimensional points for which I'd like to construct a mesh, using python. All the software I've seen requires that you provide the edges. Is there a program in python which takes ...
7
votes
2
answers
6k
views
FEniCS: how to specify boundary conditions on a circle inside 2D mesh
I would like to numerically find a mutual capacitance of two stripes of metal on the opposites sides of a cylinder. The problem is obviously a 2D Laplace equation. I would like to find the potential ...
10
votes
2
answers
1k
views
An Octree Code in Fortran
I am new to scientific computing. I am looking for a Fortran ( preferably f90) implementation of an Octree.
My problem requires an Octree which divides my domain until there aren't more than some N ...
2
votes
1
answer
169
views
Converting matrices L and U output by dgssv() of SuperLU to triples format
How can I convert matrices L and U output by dgssvx() of SuperLU to triples format (to ...
1
vote
0
answers
58
views
Sine series using exponential based FFT
I have such a problem - I would need to expand a discrete function in a sine fourier series but I would like to use exponential based library for FFT (I will use CUDA to compute it).
What have I to do ...
7
votes
1
answer
768
views
Jacobi preconditioner not reducing condition number?
Let's say you have a general matrix $A$, with diagonal entries $a_{ii} = d>0$. (No assumptions are made about the off-diagonal elements.) Then Jacobi preconditioning doesn't improve condition ...
16
votes
3
answers
16k
views
What is the fastest way to compute all eigenvalues of a very big and sparse adjacency matrix in python?
I'm trying to figure out if there is a faster way to compute all the eigenvalues and eigenvectors of a very big and sparse adjacency matrix than using scipy.sparse.linalg.eigsh As far as I know, this ...
12
votes
3
answers
4k
views
Choice of step size using ODEs in matlab
Hey there and thanks for giving time to look at my question. This is a updated version of my question which I posted earlier in physics.stackexchange.com
I'm currently studying a 2D exciton spinor ...
7
votes
2
answers
3k
views
Intermediate values (interpolation) after Runge-Kutta calculation
I have a numerical ODE simulation that I computed at fixed time step $h$ using a 4-th order Runge-Kutta method (RK4), producing a series of results $(x_1,y_1), (x_2,...
6
votes
0
answers
2k
views
What is the best OpenFOAM RAS turbulence model for a motorbike/vespa problem?
I am learning OpenFOAM as a hobby and using my Vespa racing as the topic to apply it to. The objective is to produce modifications that improve the top speed (as well as getting some values such as ...
4
votes
1
answer
221
views
Molecular dynamics simulation: fluctuating dipole model implementation
I'm conducting a molecular dynamics simulation for silica. Some time ago I turned to the fluctuating dipole model, and after much effort I'm still having problems implementing it.
In short, all ...
3
votes
2
answers
361
views
What FCIQMC codes are out there?
Full configuration interaction quantum Monte Carlo seems like it is poised to overtake DFT in some applications pretty soon. I am curious if there is any freely available implementation of the method,...
3
votes
1
answer
163
views
Transient Fluid Dynamics
Eventually, I would like to numerically simulate the transient compressible flow in an axial compressor during start-up.
However, I know that this is a very challenging undertaking (to say the least).
...
6
votes
1
answer
951
views
FEniCS: how to access coordinates when writing an equation for a trial function
I need to solve the following equation in FEniCS:
$$
\boldsymbol{\nabla} \cdot \begin{pmatrix}
f(y)\frac{\partial u}{\partial x} - g(x,y)\frac{\partial u}{\partial y} \\
- g(x,y)\frac{\partial u}{\...
-4
votes
1
answer
71
views
How to evaluate 1st and 2nd order reactions, with rate constants and fluxes?
I want to implement differential equations in C# from Open Cell cellml file. The mathematical model is described in this article. I have parsed xml, and calculate operations, but can't correctly ...
5
votes
1
answer
651
views
How to transform such an SDP to standard form
I plans to use CSDP to solve the following semi-definite problem:
$$\min_{B, \beta}\operatorname{trace}(CB) \\
\text{s.t.} \ \operatorname{trace}(AB)=1 \\
\beta\geqslant 0 \\
\begin{bmatrix}
1 & \...
2
votes
1
answer
199
views
SPD matrices with right hand sides
I'm looking for sparse SPD matrices with right hand side? There is UF collection of sparse matrices, however, I'm not sure how do I search of the matrices of these kind efficiently (I'm doing a naive ...
4
votes
4
answers
8k
views
Fenics: msh to xml conversion
I generated a mesh file in gambit and wanted to convert it to xml format. I tried the code below, but there is no output.
...
2
votes
4
answers
455
views
2d-mini element-can't use sub(0),but bubble element is ok
My program (in Python, using FEniCS):
...
6
votes
1
answer
548
views
Reference BLAS/LAPACK from NETLIB is twice as fast as MKL for complex numbers
I'm solving the Helmholtz equation using PETSc. I found with the PETSc configure option --download-f-blas-lapack my program runs twice as fast over running it with ...
3
votes
1
answer
591
views
Fenics: time-independent Sine-Gordon equation
Is there a code for the equation
$$
\frac{\partial^2u}{\partial x^2}+\frac{\partial^2u}{\partial y^2} = \sin(u)
$$
or for the sine gordon equation in two dimensions because I want to change some ...
4
votes
1
answer
4k
views
Fenics: Meshfunction usage
I am confused most of the time with the application of boundary conditions in Fenics. Suppose I have an xml mesh for a rectangular beam and want to apply Dirichlet BC ($u =0$) on the left side of the ...
8
votes
2
answers
3k
views
Genetic algorithm vs conjugate gradient method
I am trying to optimize some force-field parameters in a molecular framework so that the result of simulation comes as close as it can to the experimental structure.
In the past, I have written a ...
7
votes
2
answers
689
views
How to numerically solve a laser driving semi-classical two-level system using Floquet formalism?
Consider the semi-classical laser driving two-level atom, where the laser is treated classically and the atom is treated quantum mechanically. The effect of laser on the atom is a dipole coupling:
$$
...