instruction stringlengths 43 28.1k |
|---|
For a large parallel sparse matrix (mpiaij type matrix) in my code, I was experimenting with various preconditioners to see which one would do best with GMRES/BiCGSTAB. I tried the PCMG preconditioner without specifying any grid/interpolation/restriction information, and this actually seemed to do pretty well for my p... |
I need to solve the Kadomtsev Petviashvili (KP) equations
$$\partial_x(\partial_t u+u \partial_x u+\epsilon^2\partial_{xxx}u)+\lambda\partial_{yy}u=0 $$
where $$\lambda=\pm 1 \;.$$
My questions are:
1) Which is the best numerical method to solve them? Or maybe a good method that is simple?
2) What does wikipidia mean... |
I'm trying to solve the Travelling Salesman Problem in a non-complete graph $(G,E)$ using genetic algorithms.
My problem is that I can't find a good first approximation by the usual greedy algorithms, as long as I can't assure an arbitrary edge $(u,v)$ to be in $E$. I tried to add to $E$ new edges (with almost infinity... |
At each iteration $i$ of the GMRES method, is calculated a single new orthonormal vector of the existing Krylov subspace. If the norm of that vector is 0 (or close to 0), then the subspace is "complete", and we should be able to calculate the converged solution. In theory, this occurs when we have $N$ orthonormal vecto... |
The Wikipedia page for SGD describes optimizing a function $f = \sum f_i(\theta;x_i)$ by successively approximating gradients from random subsets of the data, while most literature poses the problem as optimizing $f = \text{E}[F(\theta,\zeta)]$ for some random variable $\zeta$. I can see how these are asymptotically eq... |
I'm a double major in computer science and mathematics. I love both subjects. I'm thinking in taking a graduate career, perhaps in scientific computing. What's the real difference between scientific computing and numerical analysis? Are they studied as careers?
|
If $A, B, C$ are $n \times n$ matrices, where both $B$ and $C$ are nonsingular, and $b$ is a vector of length $n$, how would you compute the following without computing any inverses?
$$x = B^{-1}(2A+I)(C^{-1}+A)b$$
|
I am trying to integrate the following function in Python,
$\int_{0}^{\infty}\int_{0}^{\infty} \dfrac{e^{-x-y}}{B(x,y)}dx dy$,
where $B(x,y)$ is the beta function - $B(x,y) = \int_0^{1}a^{x-1}(1-a)^{y-1}da$.
As the above function was not directly integrable in scipy.integrate, I did a change of variable, $x\rightarrow ... |
I'm reading an article lately, and there is one point which confuses me. So, we have the following constrained binary quadratic problem.
min $x^{T}Qx$
with the constraints that $Ax≤b$
and $x\in {0,1}^{n}$
This can be relaxed into the following:
min $\sum_{1\leq i <j \leq n}2q_{ij}y_{ij} + \sum_{i=1}^{n}q_{ii}x_i$
with ... |
I'm going through an article lately and there is one point which is very confusing. So, we have the following original constrained binary quadratic problem as the following. The pre-assumption of certain parameters are $Q\in Z^{n*n}$, $A\in Z^{n*n}$, and $b\in Z^{n*1}$.
$\text{min}$ $x^{T}Qx$,
$s.t.,$ $Ax\leq b$
$\tex... |
I am currently trying to plot a function which describes linear perturbation growth in cosmology for different world models. I would like to be able to have all the curves on the same set of axes, but am struggling with setting it up.
This is the function
$D(z) = \frac{5 \Omega_M H_0^2}{2} \int_z^{\infty} \frac{1+z}{H... |
While reading this paper on MPM (page 48), the definition of the objective function $E(\boldsymbol v_{\boldsymbol i})$ didn't make sense to me, although I completely understand the definition of (what I suppose to be) it's derivative $\boldsymbol h(\boldsymbol v^{n+1})$.
Excerpt from the paper:
We will show that solvi... |
Note: This was cross-posted from comp-sci, as I didn't know this community existed!
I have a problem which I'm looking to see if there is literature on:
Consider three types of actors, a Director, Aggregator, and Follower. The Director talks to multiple Aggregators, the Aggregator talks to multiple Followers. The direc... |
I'm going through an article with title "Solving constrained quadratic binary problems via quantum adiabatic evolution" (reference 1). And there are several points confusing me a lot.
This article is aimed to solve the CBQP (constrained binary quadratic programming) with the following format.
\begin{align}
&\min &x^{T}... |
I'm a New Yorker and take the subways every day. I have a growing interest in understanding the distribution of paths people take on the subways to work every day.
I.e. if there are $n$ subway stations, I want a temporal distribution over the paths $\omega = (n_i, n_j, t)$ where $n_i$ and $n_j$ are nodes representing... |
Given that there are eigensolvers in Scalapack that use a divide and conquer method, is there any way we can use Scalapack functions to only compute the first $k$ dominant eigenvalues and corresponding eigenvectors?
This is for a spectral clustering code.
|
Summary
We are trying to solve some models of emission of substances to the air. In these models, emission stops at a certain point.
We are using the DotNumerics implementation of radau5
We had issue finding correct solutions. If emission stops, the air concentration should drop, but this was not always the case.
We we... |
I have written a function that sets up a sparse matrix A and RHS b for the 3D Poisson equation in a relatively efficient way. The set-up is nothing fancy: I have extended the 2D 5-point stencil to an equivalent 7-point stencil for 3D. Conductors are (at this moment) simply blocks of Dirichlet BCs and I am not (yet) tak... |
I'm going through the article in the following link lately and one point confuses me a lot. https://arxiv.org/pdf/1509.05001.pdf
So, the goal of this paper is to solve the following constrained binary quadratic programming. Here the parameters $A$, $Q$ and $b$ are all of integer values.
max $x^{T}Qx$
$s.t.,$ $Ax\leq b$... |
Suppose that I'm solving the poisson equation by the finite element method by lagrange elements. I know that the error can be measured in a variety of ways, depending on which norm you choose. For a given lagrange element order p and a symmetric bilinear form (e.g. galerkin's finite element method), the errors in the... |
I have a 7000x7000 sparse matrix (scipy), which I want to exponentiate. I've tried using scipy.sparse.linalg.expm, which works quite well for smaller matrices (takes a few seconds for a 1000x1000 matrix) but it takes too long time to compute for the matrix in question. Is there a way to optimise this or work around the... |
Given the one dimensional equation:
$\epsilon\frac{\partial^2u}{\partial x^2} +\frac{\partial u}{\partial x} = 0 $
with $0\le\epsilon \ll1$ with boundary conditions $u(0) = 0$ and $u(1) = 2$, we can't neglect the diffusive term because of the boundary conditions. In which situations (with very small $\epsilon$ could w... |
I'm trying to come up with the right algorithm for a system in which the user enters a few symptoms and the system has to predict or determine the likelihood that a few selected symptoms are associated with those existing in the system. Then after associating them, the result or output should be a specific disease for ... |
I have written a code which solves the incompressible formulation of the Navier-Stokes equations. It uses high-order methods both for time and spatial derivatives. I have been conducting convergence rate analysis to validate the high-order aspect of my solver.
For space convergence, the problem was relatively simple. F... |
I've recently written a code that solves the incompressible/low-Mach number formulation of the Navier-Stokes equation with high-order methods for both time and space. My advisor insisted that I use third order Runge-Kutta method. However, I do not find it to be adapted to our current problem.
In incompressible solvers... |
I think it's already been asked, but I still can't figure out a way to do it computationally.
I had to check for positive definiteness of an $n \times n$ matrix $A$. I know that for any nonzero column vector $x$, we have $x^{t}A x > 0$.
I want to implement it in C++ to use it with the Cholesky method, in which I need:... |
I have spend the last few days working my way through an interesting paper and I'm building a numerical model so I can apply the method. However, I am getting stuck at an "it can be shown" step.
I am trying to convert the following system into the form $A\cdot{x}=b$. Have I missed something obvious, I really don't know... |
I've recently got interested in CFD and started a small project by solving the radial Reynoldsequation. Why the Reynoldsequation? I recently encountered it through my studies and somehow got stuck :)
I would greatly appreciate it, if someone were so kind to have a read through my steps and point out my thought mistakes... |
When simulating a partial differential equation describing a physical phenomenon like vibrations on a string, fluid flow in a chamber or quantum wave functions, the most straight-forward way is to divide your space into small regions / cells, set up the relevant values at each cell according to the initial condition, a... |
In a initial value problem does the initial condition has to satisfy the boundary condition and the governing equation?
For example: If a non-homogeneous Neumann boundary condition for the pressure in a fluid dynamics problem is applied on a boundary, can one initialize a zero pressure field?
|
How do we correctly define the flux in a finite volume method applied to Poisson's equation where we have a piecewise constant material? Specifically, say we have the equation
\begin{align*}
-\nabla\cdot(k\nabla u) =& f\textrm{ on }\Omega\\
u =& 0\textrm{ on }\partial\Omega
\end{align*}
where $\Omega$ is some kind of ... |
In a book that our course is following this semester, the theorem given is only in one direction: if the scheme is both consistent and stable, then the scheme is convergent.
However, since this isn't a double implication theorem, then are there convergent schemes that are either consistent but not stable, or stable ... |
I have a function $\mu(x)$ that I need to convolve with several functions $\nu_n(x)$. I'm currently taking the DFT of $\mu$ and multiplying it individually with the N DFTs of the functions $\nu_n$ and then taking the inverse DFT to obtain the convolution.
Can I instead define
$m(x, y) = \mu(x), n(x, y) = \nu_y(x)$ for... |
I'm writing a library that involves some approximations of variational calculus problems. Whenever I implement routines to evaluate the derivative or Hessian of an action functional $A$, I write a test to check that these are working correctly. To do this, I evaluate the error in using the first and second derivatives ... |
The question is exactly as the title:
Which 2D (triangular) mesh generator software can be used which has a set of geometric primitives, controlled mesh size and standard output (.vtk or something similar)?
For testing my code I need a triangular mesh for a circle and I am looking for the easiest way to do that. E.g.,... |
I have two vectors which specify the bounds $x_{min}$ and $x_{max}$ of the sample space. Also, it has to satisfy the linear constraint $Ax \leq b$.
How to generate an evenly spaced set of points, with some control over grid spacing, which satisfy these constraints and this includes both the boundaries and the interior?... |
I have a optimization problem in which the optimal objective value occurs at multiple point in the feasible space. If I run my problem in LINGO software then it gives me the optimal objective value at a point in the feasible space but how to get the all points in which optimal solution occurs.
|
There are several functions of two or three variables that I am working with. For this question I have made a small set showing the resistivity, $\rho$, in n$\Omega$m, of copper as a function of its purity ($RRR$ value) and its temperature, $T$, in Kelvin.
RRR\Temp [K] 20 90 160 230 300
60 0... |
I am attempting to solve a nonlinear advection diffusion equation
$$\frac{\partial u}{\partial t} = \frac{\partial}{\partial x}(\frac{\partial u}{\partial x} + u^2)$$
with Robin boundary conditions via the finite volume method.
I am using the WENO method to reconstruct the function $u$ and its derivative $u_x$ as well ... |
I have worked on mathematical modeling based on differential equations, and now I want to simulate a cellular automaton based on a system of mixed ode-pde coupled first order differential equations
\begin{eqnarray}
\dfrac{dR}{dt}(t)&=&v_r(R,t),\\
\dfrac{\partial v_r}{\partial r}(r,t)&=&\dfrac{R\sinh(r)}{r\sinh(R)}[1-\... |
Can somebody point me to software/code to extract a solenoidal (a.k.a. divergence-free) field from a 2D vector field numerically?
There are a plethora of papers and documents describing how to do this, but for some reason none of the authors (or anybody else for that matter) puts a simple piece of source code online im... |
Right now I stuck with a problem. It seems to be really trivial one, but still it is hard for me to find an appropriate solution. The problem is:
One has two intervals and are to find the intersection of them.
For instance:
Intersection of [0, 3]&[2, 4] is [2, 3]
Intersection of [-1, 34]&[0, 4] is [0, 4]
Intersection ... |
I have a MATLAB code (see below) that employs 'fsolve' from the optimization toolbox for a root finding problem.
The bottleneck is that, within the objective function calculation, there is a computationally expensive function (denoted as 'expensive_function' in the below code, and is located in the matlabpath). The var... |
Suppose I have a energy functional E depending on X, where X is a N-dimensional real value vector and N could be very large (~=2000). I assume that there exists (at least) a (local) minimizer for E. There are several problems I am dealing with now:
Firstly, the functional E is extremely 'complicated', it is nearly imp... |
I want to numerically solve the damped oscillator equation
$$\frac{d^2x}{dt^2}+\eta\frac{dx}{dt}+x=0 .$$
Usually it's very easy to solve this kind of ODE analytically and numerically. But now the damping coefficient is extremely small, $\eta=10^{-10}$. To get the obvious damping pattern, the value of oscillating time $... |
As the title says, I'm trying to make my code include a uniform pressure/force to the surface of a plate for analysis.
Structural/Element Modeling
I am modeling a 2D 9 node Mindlin plate that has a clamped boundary condition on one side. It is 0.2 [m] by 0.2 [m]. Currently, I am using 6x6 elements. The plate has 6 laye... |
I've asked this question on mathoverflow too.
Let
$T>0$
$I:=(0,T]$
$d\in\mathbb N$
$\Lambda\subseteq\mathbb R^d$ be nonempty and open, $$\mathcal V:=\left\{\phi\in C_c^\infty(\Lambda,\mathbb R^d):\nabla\cdot\phi=0\right\}$$ and $$V:=\overline{\mathcal V}^{\left\|\;\cdot\;\right\|_{H^1(\Lambda,\:\mathbb R^d)}}\;,\;\;... |
I am working on some medium to large scale finite element codes. By using established and available tools I am able to have an algorithm that scales well up to about 10,000 cores. Investigating scaling beyond this requires investigating larger meshes, which leads to my problem.
Once meshes start getting large (in range... |
I've asked this question on Math.SE too.
Let
$d\in\left\{1,\ldots,4\right\}$
$\Lambda\subseteq\mathbb R^d$ be bounded, nonempty and open and $\partial\Lambda$ be Lipschitz
$V:=\left\{u\in H_0^1(\Lambda,\mathbb R^d):\nabla\cdot u=0\right\}$
$W:=\left\{p\in L^2(\Lambda):\int_\Lambda p=0\right\}$
$\mathfrak a(u,v):=\su... |
As a toy problem, I was looking at a classical second order system of the following form:
\begin{align}
\ddot{x}(t) + c \dot{x}(t) + k x(t) = 0
\end{align}
Instead of the basic system above, I want to replace $x(t)$ with a Low-Pass filtered version of $x(t)$. This can change the equation to the following form:
\begin{... |
I am working on a generalized eigenvalue problem of the form
$$
\boldsymbol{A}\cdot\boldsymbol{x}=\lambda\boldsymbol{B}\cdot\boldsymbol{x}
$$
where $\boldsymbol{B}$ is not symmetric positive. Therefore I recast the problem to
$$
\boldsymbol{B}^{-1}\cdot(\boldsymbol{A}\cdot\boldsymbol{x})=\lambda\boldsymbol{x}\ .
$$
I a... |
I was wondering if there is a simple or known way to minimize the number of unique elements in a decision variable (vector).
Note that I'm not asking for minimization of nonzero elements (rank constraint).
In particular I'm searching for a penalization (soft constraint) or hard constraint in the form
$$f(x) <= n_{ma... |
I am trying to calculate real speed and time in free fall of a body. I wrote a code in Fortran and I am trying to improve it by using RK4 method
x=time y=total free fall
Purple line using:
DO WHILE ((K1-K2) > y)
y = y + t*((G*m*t/(2*((r-y)**2))) + sqrt(2*(G*m*y)/(r*(r-y))))
time = time + t
... |
Consider solving a differential equation system for 1D, 2D, or 3D.
It involves various input and output "field" variables, which, more often than not, correspond to various physical quantities relevant to the problem.
The typical discretization step is to agree on a mesh, and then solve the system. We might refine the ... |
As the title mentioned, some suggestions and references are needed to help me to construct a function in $H^3(\Omega)$, but not in $H^4(\Omega)$?The domain $\Omega=[0,1]\times[0,1]$ and has zero trace. I'm very glad to receive some suggestions.
More precisely, I want to construct a function satisfying
\begin{align}
&-\... |
my problem is a ecuation i don't understand, I have no idea how to solve that, is a classic minimisation programme of quadratic form with linear constraints, here is the ecuation:
$$\sum_{i,j}^n[P(i/j)P(j) - \sum_{k=1}^rt(ijk)\prod_k]^2 + \sum_{i,j}^n[P(i/ \bar j)P(\bar j) - \sum_{k=1}^rs(ijk)\prod_k]^2$$
subject to th... |
I have read some papers about time-fractional PDEs solved by finite element method. The time-fractional derivative is the Caputo derivative defined by
$$
\frac{\partial^{\alpha}u}{\partial t^{\alpha}}=\frac{1}{\Gamma(1-\alpha)}\int_{0}^t\frac{\partial u}{\partial s}\frac{ds}{(t-s)^{\alpha}},~~~~0<\alpha<1.
$$
Now, we... |
I have $m$ inequalities involving $n$ variables as follows
$$a_{1,j} x_1 +a_{2,j} x_2 +\dots +a_{n,j} x_n>0 \quad \text{for} \quad 1 \leq j \leq m$$
How can I check if a solution exists (with the possible help of computer)?
|
I have a computationally expensive objective function, whose analytical form is not available. The only input argument to the objective function is an integer variable. The goal is to compute the integer variable that minimizes the objective function.
$$x_{sol} = argmin_{x \epsilon [x_{min},x_{max}]} f(x)$$
where $x$... |
Trotter expansions say:
$$ e^{A+B} = \lim_{P\to\infty} \big(e^{A/2P} e^{B/P} e^{A/2P} \big)^P. $$
With $P = 2$, it becomes (with high accuracy)
$$ e^{A/4} e^{B/2} e^{A/2} e^{B/2} e^{A/4}. $$
Let's say I want to solve
$\frac{dy}{dt} = Cy$, where $C = A + B$. $C$ can be time dependent. How can I solve this equation by sp... |
In this question, I suggested that the Couran-Friedrichs-Lewy (CFL) condition for the wave equation in polar coordinates reads
$$C = 2c\frac{\Delta t}{\Delta r \Delta \phi} \leq C_\max \enspace ,$$
where $c$ is the phase speed. I suggested this from an intuitive point of view, and it worked in that example. Nevertheles... |
I'm trying to find an approach for integral image resizing.
I found out that I can do it with a bilinear interpolation method, but with this approach I can only resizing by the factor which is a power of two.
I found a paper (Speeding Up Object Detection
Fast Resizing in the Integral Image Domain) which describes a for... |
When looking at the output file of my solver, I have been told that the time-step taken by the solver depends on parameters like the total number of elements and their relative size in my geometry, or the material properties. A material with a high Young modulus could decrease the time step taken by the solver, as well... |
Just for my interest I'm thinking how to make some cheap-and-dirty simulation of processes such as:
penetration of metal plate by projectile
explosion of shaped charge (for example https://www.youtube.com/watch?v=qqMoFx0uwpo)
implosion of atomic bomb core
I can imagine how to do it in Lagraginan frame ( something li... |
EDIT based on comments below:
I add the mathematical formulation of my problem below. I am trying to solve an equation of the form
$$
\partial_t f(x,y,t)= (\partial^2_x +\partial^2_y) f(x,y,t) \equiv G(x,y,t),
$$
discretizing this equation we have
$$
f^{k+1}_{i,j}= f^k_{i,j} + \Delta t G^k_{i,j}
$$
where $i,j$ refer to... |
I am solving a flow physics problem, in which I encounter a symmetric boundary. So I set the boundary conditions to be $$\frac{\partial u}{\partial r} = \frac{\partial v}{\partial r}=\frac{\partial w}{\partial r}=\frac{\partial T}{\partial r} =\frac{\partial \rho}{\partial r}$$ where $u,v,w$ are the 3 components of ve... |
Consider two-body central force problem in polar co-ordinates $r,θ$.
Corresponding 2nd order differential equation is obtained by using conservation of angular momentum. This equation is :
$ d^2r/dt^2=l^2/(m^2r^3)−GM/r^2 $
$r(t)$
is the radial position of particle (of mass $m$) as a function of time $t$. $l$ is angular... |
I need to use variable precision arithmetic in MATLAB for an expensive set of computation.
The vpa function provided by the symbolic math toolbox is very slow. I found a non-free alternative toolbox known as "Advanpix" (http://www.advanpix.com/) ,which sped up things by an order of magnitude, using a trial version.
How... |
I have a real signal in time given by:
And I am simply trying to compute its power spectrum, which is the Fourier transform of the autocorrelation of the signal, and is also a purely real and positive quantity in this case. To do this, I simply write:
import numpy as np
from scipy.fftpack import fft, arange, rfftfreq,... |
I am leveraging the SLEPc library for solving the first $k$ (where $k = 3$ or $4$) eigenvalues and their corresponding vectors for a matrix of size 200,000. The matrix is sparse and symmetric. I intend to compute the eigenvalues without using MPI, as a result of which the entire computation takes more than 2 minutes. I... |
I am applying a 6th order Finite-Difference differentiation scheme as seen in http://www.scholarpedia.org/article/Method_of_lines/example_implementation/dss006
There seems to be severe numerical/floating-point issues with this scheme. The result is very sensitive to the values in the vector with which the FD matrix is... |
In some cases I have seen that if the local error is:
$Err = O (\Delta t^{p+1})$
where the global error is p. So if local error is 3, global will be 2.
Does somebody know where it comes? For instance in the case of multistep solver you can say that regarding wikipedia, but are there other cases. Is there a simple way ... |
For a CFD panel-based potential method, I'm trying to reduce the time to solve the linear system. The matrix has the larger values on the diagonal, since the influence of a panel on itself is maximum, and that the panel's influence on other panels decreases at least as the inverse of their distance. The matrix has no r... |
I have a function:
delt=1 #trial
def f(z):
return ((1-2*z)*np.exp(-delt/z))/(((1-z)**(2+delt))*(z**(2-delt)))
I also have a variable:
import scipy.integrate as integrate
var=integrate.quad(f,0,0.5)[0] # equals 0.040353419593637516
Now I am trying to find the value p such that
integrate.quad(f,0.5,p)= var
and m... |
I have successfully solved the multi-species diffusion-reaction equation
\begin{equation}
\frac{\partial c_i}{\partial t} = \nabla \cdot (d_i(x)\nabla c_i) + s_i(x,t), \quad \quad (1)
\end{equation}
with dicontinuous source term
\begin{equation}
s(x,t) = \left\{ \begin{array}{rcl} s_1(x,t) & \text{for} & 0<x\le x' , ... |
I'm trying to better understand finite volume methods and have started coding up a basic script to solve the diffusion equation $$u_t = u_{xx}$$ which has the finite volume form: $$\frac{\bar{u}^{n+1}_i\ - \bar{u}^n_i }{\Delta t} = \hat{F}_{i+\frac{1}{2}}^n - \hat{F}_{i-\frac{1}{2}}^n$$ where $\bar{u_i}$ is the average... |
I actually find the formulae for peak theoretical performance:
Node performance in GFlops = (CPU speed in GHz) x (number of CPU cores) x (CPU instruction per cycle) x (number of CPUs per node)
CPU Speed and CPU cores are easy. but how can i know the cpu operations per cycle?
For example, my qualcomm processor specs are... |
I am currently working on a project where a two-phase flow is considered. The phases are described using a level set approach and a signed distance function from the interface between the phases where positive values are liquid and negative values are gas.
I consider a Stoke's flow which gives me a velocity field $v$ ... |
I am referring this paper, and trying to implement chaotic sender and receiver, to decode message, as given in section $V^{th}$ Chaotic signal masking.
The process that I want to implement is figure 6 of the same paper, where we have Lorenz system given by equations:
: \begin{align}
\frac{\mathrm{d}x}{\mathrm{d}t} &=... |
There seem to be many books and papers that explain various CFD methods in great detail, but unfortunately I have not been able to find many good resources of such methods implemented in codes such as MATLAB or Python (besides the most basic of problems such as the linear advection equation). As such, I was wondering i... |
I recently coded a 1 stage and 3 stage optimal TVD-RK explicit scheme using eqn 3.3 here
http://www.ams.org/journals/mcom/1998-67-221/S0025-5718-98-00913-2/
on the equation Ux+Uy=0, where x and y are the independent variables with which U velocity is differentiated. It is a 1D problem. The space is discretized using t... |
I am having some serious difficulties trying to understand how to use (apply) CG to minimize a function. In all the textbooks and notes, the step size $\alpha$ is give by the following expression
$$ \alpha _k = - \frac{r_k ^T p_k}{p_k ^T A p_k}, $$
where $r$ is the residual and $p$ the search direction. The problem is ... |
I'm writing a matrix library in c++. After some debugging I found that a simple double difference is not zero for two "equals" numbers. This is due how double are represented in a computer of course. So my question is, what I could use to improve the numeric stability about subtracting matrix (or vectors) and possibly ... |
I wish to compute the derivative of a vector through numerical differentiation. Let's say, we use a standard 2nd order central difference scheme, to arrive at a differentiation matrix, and apply it on a numerical vector, $u$.
$$u' = D u$$
At the top and bottom few elements of the resulting derivative vector, I get spur... |
Both algebraically or with software (numerically/computationally, for example) is acceptable. Here is a how one of the polynomials looks like ($L<1$ is a constant).
I have attached a text file with all the 13 polynomials that I need to sort in ascending order - more precisely, I have a target order I need to achieve, s... |
Consider the 1D advection equation in its strong and weak forms
$$\ u_t + a u_x = 0 $$
$$\ \int_{x_{j-0.5}}^{x_{j+0.5}} w u_t \ dx - a \int_{x_{j-0.5}}^{x_{j+0.5}} w_x u \ dx + a [w(x)\hat{u}]_{x_{j-0.5}} ^{x_{j+0.5}} = 0 $$
Having introduced the piecewise constant Lagrange polynomials or the first two Legendre Po... |
I'm trying -to no avail- to broadcast the following piece of code in Python:
import numpy as np
from scipy.linalg import expm
def ExactSol(c, omega0, x0, v0, T, p):
# Docstring
"""
Returns the solution of
x'' + c x' + w0^2 x = 0
embodied with initial condition x(0) = x0 and x'(0) = v0
i.e. the ... |
Given a uniform polar grid, as in the figure below:
and a FV discretization of a gradient for example:
$\frac{\partial p}{\partial \varphi} = 0$
$\Delta r \frac{p_e - p_w}{\Delta \varphi} = 0$
My Question revolves around the value of $\Delta \varphi$
As the Grid is uniform, $\Delta r$ does not change across the grid. ... |
I am trying to calculate the smoothness indicators for the WENO methods using the method given by Jiang and Shu.
$$\beta_k = \sum_{l=1}^k \Delta x^{2l-1} \int_{x_{i-1/2}}^{x_{i+1/2}} \Big(\frac{\partial^l}{\partial x^l} p_j(x)\Big)^2 dx$$
where $p_j(x)$ is the interpolation polynomial in the $k$-th sub-stencil. I belie... |
I work in the field of Finite Element Methods, specifically, developing algorithms to speed up the computational time in structural mechanics problems. Till now I have been developing my code in Octave/Fortran and testing out my algorithms on small/simple problems (number of degrees of freedom less than 1000). Now I wa... |
I'm new to computational science and I already have learned basic methods for integration, interpolation, methods like RK4, Numerov etc on c++ but recently my professor asked me to learn how to use LAPACK for solving problems related to matrices. Like for example finding eigenvalues of a complex matrix. I have never us... |
I was trying to optimise CdSe (Cysteine) molecule using a semi-empirical method in Gaussian 09 (and gaussView) for a preliminary study of quantum dots. But it seems as the number of iterations advances, resultant optimised molecule is getting dissociated into different sub group which has no direct bond/connection wit... |
#f,g are the dH/dq and -dH/dp respectively
def f(v1,v2):
alpha = (a*v1 - b*v2)/k
beta = (a*v2 - c*v1)/k
dot1 = (c-a)/(3*k) + (a*np.exp(alpha)/k - c*np.exp(beta)/k)/(1 + np.exp(alpha) + np.exp(beta))
dot2 = (b-a)/(3*k) + (a*np.exp(beta)/k - b*np.exp(alpha)/k)/(1 + np.exp(alpha) + np.exp(beta))
... |
Is there an algorithm on python to analyze swarming behavior or model swarming behavior for predictions?
|
I'm attempting to simulate a standing breather of the form
$$ u(x,t)=4\tan^{-1}\left(\sqrt{3}\cos\left(\frac{t}{2}\right)sech\left(\frac{\sqrt{3}x}{2}\right)\right)$$
for the Sine-Gordon equation
$$u_{tt}-u_{xx}+\sin u =0 $$
on the real line by using centered differences in both time and space. Because of reflections ... |
I have recently learned about Discontinuous Galerkin method to solve differential equations and I was trying to implement it to solve Euler equation. For now, consider the standard Sod Shock Tube Case.
Without using any limiter I am getting an unstable scheme (even with CFL 0.01) and my solution blows up. Presently I a... |
I am new to COMSOL and I want to model fluid flow in stress field. As starting point I want a simple 2D box having a fracture from right to left while pressure gradient vertically. I want to know the threshold value of that pressure from top which allows flow of fluid in fracture. Can anyone please suggest me which mod... |
Suppose you have spheres (e.g. cells). You add particles to the suspended cells which are smaller but do have a size distribution rather than a single diameter. The particles stick to the cells. I would like to model how much of the cell surface is covered by particles and how much of the covered fraction is covered by... |
I am using spilu (incomplete LU decomposition for sparse matrix) in scipy:
https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.linalg.spilu.html
However there is an option call "fill_factor" which is quite unclear to me.
If fill_factor=100, does it mean the matrix is full; and fill_factor=50 means... |
MATLAB/Octave is a pretty useful language for prototyping scientific computation use cases, however I would like to know if the sheer nature of being a high level language bottlenecks how fast the performance can get. (I'm not talking about writing optimal code like vectorization, but a general impact on CPU Time, like... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.