instruction
stringlengths
43
28.1k
From section 19.4.1, Rank Sufficiency: The element stiffness matrix must not possess any zero-energy kinematic mode other than rigid body modes. This can be mathematically express as follows.... I have no idea what does this section about Rank Sufficiency mean. What is rank sufficiency in physical term, and why is ...
Statement of the problem I need to (numerically) solve an eigenproblem of the type $$-\omega^2\mathcal{D}_1\vec{x}=\mathcal{D}_2\vec{x}$$ on the interval $[-1,1]$, where $\mathcal{D}_1$ and $\mathcal{D}_2$ are differential operators with a generalised boundary condition of the form $$\omega^2\mathcal{D}_3\vec{x}(±1)...
I am trying to answer a question about a finite difference scheme. I need to show that the method is stable in the L1-norm. I can't find a single definition of what that means, so does anyone have a source or know for a fact what the definition is? I'm guessing that if we denote the operator corresponding to the scheme...
--> why computers not used high level language as a first Language what are the main reasons?
Say for heat equation or Burgers equation with nonlinear boundary condition. Exact solution is unknown. So I am taking for small mesh size the discrete solution as exact solution. Then how to write the coding part for $L^2$ and $H^1$ error in Matlab?
I'm reading the following paper (Grezlak and Oosterlee) and I have a specific question to a sentence on page 5. I quote: "Since the mapping $y=g(x)$ is bijective and $g(x)$ is strictly increasing, so is $g^{-1}(y)$. This implies that the arguments $x$ can be obtained by the inverse interpolation of $g(x)$ against ...
I would like to generate an isotropic gaussian random field described by a power spectrum $P(k)$ on a 3D grid which represents spherical polar coordinates (i.e., the angular separation between pixels at each slice in the radial direction is equal and each pixel represents a solid angle). I am currently generating a ra...
What are the implications of applying a direction-splitting within each stage of an SSP-RK scheme? For instance, given a standard advective transport type equation: $$ \partial_{t}Q + \operatorname{div}(\mathbf{u}Q) = 0 $$ it's popular to make use of an explicit SSP-RK style time-stepping scheme, such as the well-known...
I have used pyShtools in the past to expand scalar functions to spherical harmonics and to synthesize band-limited representations of them. However, I am not too sure how to achieve this for a vector field on the surface of a sphere, where $u(\theta, \phi)$ and $v(\theta, \phi)$ are the co-latitudinal and longitudinal ...
I am trying to find error estimation based on weighted residual technique: $$Q(e_h)=\sum_{k \in {\cal T}}\eta_k, $$ where $$\eta_k=\int_kR(z-v_h)d\Omega+\int_{\partial k}J(z-v_h)ds,$$ or in the weak form $$\eta_k=\int_k l(z-v_h)d\Omega+\int_k \nabla u_h.\nabla(z-v_h)d\Omega,$$ where $u_h$ is the solution of primal prob...
I want to use the conjugate gradient method to solve poisson's equation in an electrostatic setup: \begin{align} \rho=-\nabla^2\phi \end{align} I am however a little confused when it comes to the boundary conditions. For the dirichlet boundaries $\phi(0)=D$ it is pretty easy because i can implement the condition in the...
I've been using the Eigen C++ linear algebra library to solve various eigenvalue problems with complex matrices. I've recently had to use a generalized eigenvalue solution process, only to be disappointed by the fact that Eigen's Eigen::GeneralizedEigenSolver< _MatrixType > routine can't handle complex matrices. My m...
In his talk "What is a good linear finite element?", Shewchuk states that small dihedral angles in linear tetrahedra elements cause ill-conditioning of the stiffness matrix. Do small dihedral angles in cells also cause ill-conditioning of the FVM system of equations? References Shewchuk, J. "What is a good linear fin...
For the past few days, I have been writing a numerical solver for the 2D compressible Euler equations for an ideal gas. My numerical method has been the Local Lax Friedrichs or "Rusanov's method." Before writing the 2D code I successfully wrote a 1D code using the Local Lax-Friedrichs method, which works. However, my ...
Assume I know all eigenvalues of a matrix $A$ fall into a certain set $\Omega \subset \mathbb{C}$. Is there any way I can exploit this knowledge to design a preconditioner for $A$? Some further remarks: The eigenvalues fill $\Omega$ uniformly, i.e. there are no isolated eigenvalues. I know the eigenvalues but not the...
My last question was about the condition number of the stiffness matrix. This question is about discretization error (which is probably more important to most people). The mesh on the right side of the figure below (source) produced better discretization error than the "perfect" quality mesh on the left side even tho...
Consider N random variables $\mathbf{x}=[x_1,x_2,...,x_N]^T$ with joint density $p(\mathbf{x})$, and let $\mathbf{R}\in \mathbb{R}^{N\times N}$ denote the covariance matrix. How to derive the mutual information for these multivariate Gaussian distributions? Or do you know which literature provide the related derivation...
I have worked with MATLAB for calculating below equation for any time ($n$) and place($i$). In this equation, flux limiter is used. $$C(i,n+1)=C(i,n)-V\left[1+\frac{1}{2}\psi(r_i)-\frac{1}{2}\frac{1}{(r_i-1)}\psi(r_i-1)\right]\left(C(i,n)-C(i-1,n)\right)$$ By writing the equation, the amount of flux limiter in the time...
In order to verify a two-phase subsonic compressible isothermal Euler code, I am trying to implement a manufactured solution following what is discussed here and references therein. Also, as an extension of the question already answered here, I am looking for a more detailed explanation on the choice of a manufactured ...
I've recently been interested in learning about implicit finite element methods. I've found this post, but I'd like to learn more about them, specifically about how simulations like these from LS-DYNA work. Can anyone point me to a good textbook, manual or paper that covers the basics? EDITED: Thanks to everyone for an...
I have a problem where I am solving a system of linear equations but sometimes the system results in a singular matrix which cannot be easily solved. In this case I would like that those rows for which system is ill-defined would be computed as 0. How can I assure that? An example matrix: $$ \left[ \begin{array}{ccccc}...
I am looking for a paper or return on experience regarding the use of Machine Learning in predictive maintenance in the context of data center?
Let $|\psi_i\rangle$, $i=1...N+m$, be a set of overcomplete basis vector in a $N$-dim Hilbert space. The following are known: (Einstein's summation convention assumed) $$\hat{H}|\psi_i\rangle=H_{ji}|\psi_j\rangle$$, $$\lambda^\alpha_j|\psi_j\rangle=0,\alpha=1..m$$ $$\langle \psi_i|\psi_j\rangle=S_{ij}$$ We already kno...
I'm looking for assistance in understanding a concise portion of a paper that involves a quadratic equation, so that I can properly implement it. There are 2 versions of the paper. Each paper utilizes a slightly different quadratic form to achieve the same goal, but I've found success with neither. Here are the papers ...
I'm no expert on the different types of algorithms to compute eigenvalues and vectors for a real, symmetric matrix (coming from linear mass and stiffness matrices for a frame FEA model). I am looking for a good blend of computational efficiency and ease of coding for a system of ~300 DoFs where I only need the first N ...
Suppose you have the following analytical information about a function $f(x)$ on $[-1,1]$: \begin{align*} f(x) &= \frac{1}{x+3}\\ f'(x) & = -\frac{1}{(x+3)^2}\\ f^{''}(x) &= \frac{2}{(x+3)^3} \end{align*} We are asked to find the linear polynomial that is the minimax (best) approximation to $f(x)$ on the interval $[-1,...
I have a set of points in a 2D space. I want to connect the outer points so I get the convex hull. The problem here is that there is a limit to the distance between two points. Let me clarify that with a picture: The green lines are lines that are good. The distance between the two points of the convex hull doesn't ex...
Suppose we have some function $f(x)$ defined as a Chebyshev series up to order $M$: $$ f(x) = \sum_{n=0}^{M} c_n T_n(x). $$ For a given coefficients vector $\mathbf{c}$, and $x \in [-1,1]$ I'm looking to determine the following: Is $f(x) > 0$ everywhere? The maximum value of the gradient $f'(x)$ The number of stationa...
I am trying to implement (in Python for now) low thrust orbit propagation for spacecraft using universal variables. For a given central body with the gravitational parameter $\mu$ and an orbit with the semi-major axis $a$ and the initial position $\vec{r}_0$ and velocity $\vec{v}_0$ at $t = t_0$ the position for a give...
I'm dealing with a set of nonlinear coupled PDEs that have the form: \begin{align} \frac {\partial y_1}{\partial t} &= y_2y_3 - y_1 \tag{1}\\ \frac {\partial y_2}{\partial t} &= y_1y_3 - y_2 \tag{2}\\ \frac {\partial^2 y_3}{\partial t^2} - \frac {\partial y_3}{\partial t} &= \frac {\partial^2 y_3}{\partial z^2} + \fra...
I am programming cubic element and very confused how to find interpolation function for cubic finite element. I have element like this in bi-unit isoparametic system : $-1 \hspace{15pt} -1/3 \hspace{15pt} 1/3 \hspace{20pt} 1$ <- distance |-------------|------------|-----------| $1 \hspa...
I am working with MATLAB, and I would have the following problem. I have the following matrix of random numbers rand(200,200) and I need to create a 3D matrix with the following structure 3D_mat(r,s,p) with 15 layers (p=15), where each layer will contain the given data rand(200,200). Perhaps, it is easy task, but I ...
Suppose I have a real vector $\bf x$ of length $KN$, where $K<<N$. Let's say I break this vector $\bf x$ up into $N$ vectors each of length $K$, $${\bf x}_1,...{\bf x}_n.$$ Now I would like to approximate the sum of their 2-norms: $$f(K, N, {\bf x})\approx \sum_{n=1}^N\left |\right |{\bf x}_n\left |\right |_2.$$ Where...
Assume I have a sequence of vectors $v_k \in V$ in some abstract vector space $V$ not necessarily equal to $\mathbb{C}^n$. Can I still use the Householder QR decomposition in this case, even though the concept of "reflecting onto the first coordinate direction" doesn't make sense if $V \neq \mathbb{C}^n$? Or do I have ...
I am simulating acoustic wave equation in which absorbing boundary condition has to be applied. It is applied in two ways Ist method is as mentioned in this paper. Boundary condition at bottom is (equation 9 in paper) $$ P_{zt} + \frac{1}{v} P_{tt} - \frac{v}{2} P_{xx} $$ which is finite differenced as following (se...
In the finite element method, we often construct the constraints of the system by adding penalty-function terms ( which often are many many magnitudes, up to $10^6$ order bigger than the largest stiffness matrix term) to the stiffness matrix by using the so-called Penalty Method (section 9.2) On the other hand, the e...
Is there any sufficient and necessary condition to check the feasibility of the linear constraints $Ax=b, x\geq 0$ without solving an LP with a constant objective function? $x$ is the variable and $ A\in\mathbb{R}^{m\times n}$ is given and has full row rank. $b$ is also given. Farka's lemma could be an option. But it...
In physical problems the infinite force is easily implemented by the mathematical form of that force, take $1/r$ as an example, whenever the distance between two particles becomes small the force goes to infinity. But, I want to simulate a system using agent-based modeling which the force between two objects becomes i...
$A$ is square and positive definite, and let $r_k = Ax_k - b$. Also let $M = \frac{1}{2}(A+A^T)$. I want to show that $$\frac{||r_{k+1}||_2}{||r_k||_2} \le \left(1-\frac{\lambda_\min(M)^2}{\lambda_\max(A^TA)} \right)^{1/2}$$ We define $x_{k+1} = x_k + \alpha_k r_k$, where $\alpha_k$ is chosen to minimize $||r_{k+1}||_2...
Edit: figure it out, made an error We are given that $$y' = f(y,t), y(t_0) = y_0$$ We want to use the following method $$ \begin{align} u^1_{n+1/2} &= u_n + \frac{h}{2}f(u_n, t_n)\\ u^1_{n+1} &= u_{n+1/2} + \frac{h}{2}f(u^1_{n+1/2}, t_n+h/2)\\ u^2_{n+1} &= u_n + hf(u_n, t_n)\\ u_{n+1} &= \alpha u^1_{n+1} + \beta u^2_{n...
I'm wondering specifically in regard to a recursive function such as massive a game tree. I can't specifically say how big yet, but definitely pushing the limits of a given processor or processor array. Is it correct to say that passing a variable to a function requires an operation. Certainly there must the the flippi...
I was trying to approximate 1st derivative of a function $\phi$ on a non uniform grids: basically my aim is to do this on a uniform grid on the same domain, so I can calculate it on the "new" grid. For example: I have $x_k$ a non uniform grid, and $\xi_k$ a uniform grid, both in $[0,1]$ and with the same length. Now wh...
How does one write general tensor contractions in the Python-based finite element package Nutils? For example, how does one write the contraction of a fourth-order elasticity tensor $\boldsymbol{C}$ with a second-order strain tensor $\boldsymbol{\varepsilon}$, to yield the second-order stress tensor $\boldsymbol{\sigma...
Suppose I am completely new with the Python-based finite element package Nutils, what example code would help me to get started?
How can one construct non-uniform rational B-splines (NURBS) in Nutils, and use them for NURBS-based isogeometric analysis?
Let $\alpha=1.714$ and $\lambda=-v(1-v^{\alpha})/\alpha$, where $0<v<1$. Consider $\phi(v)=\exp\{\int_{v_{0}}^{v}\frac{1}{\lambda(t)} dt \}$, where $0< v_{0} <1$ is an arbitrary chosen constant. How to integrate the given integral numerically and plot $\phi(v)$ vs $v$ using Matlab?
Consider the spherical advection problem: describing the conservation of a property $u$ in a closed spherical domain. $$ \frac{\partial u}{\partial t}+\frac{1}{r^2}\frac{\partial }{\partial r}\left(r^2u\ \boldsymbol{v} \right)=0 $$ In the domain $0<r<1,\ t\geq0$, with the following initial/boundary conditions: $$ \left...
I try to simulate thermal version of 1D $(x, t)$ sine-Gordon field model. I am interested in finding thermal static solution that minimizes functional of energy $E$: $$E = \int dx \left( \frac{1}{2} \phi' ^2 + 1 - \cos \phi \right) \ ,$$ where $\phi' = \partial_x \phi $ What is very confusing that acceptance ratio of ...
How do I compute the adjoint of MATLAB's dwt3 operator? In other words, how do I compute the adjoint of the linear operator that takes a 3D complex array x as input and returns the quantity dwt3(x,'db4') as output. This adjoint computation is an important step in many iterative reconstruction algorithms. One might gues...
For a typical Ridge Regression method for solving an inverse problem $$ \min_x ||A~x - b||^2 + \lambda^2||\Gamma~x||^2 $$ Which has an analytical solution of $$ \hat{x}_{est}=(A^TA+\lambda^2 \Gamma^T\Gamma)^{-1} A^T b $$ How should $A, \lambda, x, b$ be 'normalized'? I have a model where $b_{data}$ is a discrete measur...
I'm trying to use MATLAB to simulate an atom decay process by using Monte Carlo approach. The process is as follow: Suppose that atom 1 decay to atom 2, which, in turn, decay to stable atoms of type 3. The decay constants of 1 and 2 are $\lambda_1$ and $\lambda_2$, respectively. Assume that at $t = 0$, $N_1 = N_0$ and ...
I am solving a numerical optimization problem with my own L-BFGS (implemented in c++). The problem has $\approx 10^6$ optimization parameters. To find the objective function gradient, I am taking a discrete Fourier transform by using FFTW3 library in double precision, all my other calculations/variables are also in do...
I have applied SciPy's implementation of the Cuthill-McKee algorithm to a $48 \times 48$ sparse non-symmetric matrix in Compressed Sparse Row (CSR) format and the output is an array of length $48$ which the documentation calls a "permutation array". How do I use this "permutation" array? Obviously, the array is in so...
Consider the following program: $$\max_{\pmb a} \sum_i z_i\\ u.c. \pmb a \pmb P_i\pmb a^\top\geq z_i$$ where $\pmb a \in\mathbb{R}^p$ and the $\pmb P_i$ are all symmetric positive semidefinite matrix (the eigenvalues of $\pmb P_i$ are all $\geq 0$ for all $i$) and $z_i$ is a scalar. I am wondering if this is indeed a...
I am trying to generate initial velocity field which satisfies incompressible flows condition. To formulate this I am using Rogallo's procedure formulation which is given by $$ \tilde{u}(k) = \frac{\alpha k k_2 + \beta k_1 k_3}{k \sqrt {k_1^2 + k_2^2}} \hat{k_1} + \frac{\beta k_2 k_3 - \alpha k_1 k}{k \sqrt {k_1^2 + k...
As my question states, I want to calculate the Fourier transform $F(q)$ of a radial function $f(r)$ (defined on $[0,\infty)$ and which decays like an exponential $\exp(-Ar+b)$ at large $r$) as accurately as possible in Fortran. The function values come from a data file (which I can easily interpolate through cubic inte...
I am interested in working with systems of PDEs in two spatial dimensions, as part of a mathematical modeling project. The systems of PDEs are coupled, and there is no convenient reduction to 1 spatial dimension (due to the particular constraints of the modeling problem). It is my understanding that the built-in MATLAB...
I need to numerically evaluate 2-D integrals of the form: $$ \mathcal{I}(\theta) = \int_{0}^{1} \int_0^1 \varphi_\theta(x,y) dx dy $$ where $\varphi_\theta$ is a family of smooth functions indexed by $\theta$; and I need to evaluate $\mathcal{I}(\theta)$ for a large number ($> 10^6$) of $\theta_i \in \Theta$, which are...
I need some kind of inequality constraint in my optimization problems (rude version of SVM for example or skeleton based mesh fitting). However hard constraints is not suitable for me because sometimes small constraint violations are allowed. I think about $(max(0, f(x)))^2$ as soft constraint function where $f(x)$ is ...
I am working with matrix operations in MATLAB, and I would have the following problem. I have matrix containing zero elements: a=zeros(100,100) and another matrix with significantly smaller dimension containing value 6: b=6*ones(3,3) I define some coordinates in matrix a: a(45,50). I also consider this point as cente...
I was reading about Interpolation error formula and Runge's phenomenon. My question is : Is there any function that gives no error at all? In other words the interpolation function $p$ would equal the actual function $f$. My answer is : If we choose a function $f(x) = 1$ then we will get no error. Is my answer correct...
I am trying to solve ordinary differential equations with initial conditions using Laplace transform. A simple test setup includes an exponential discharge of RC circuit and an integrator from coil and voltage source. While the result of the first example is as expected, the second one is not. What am I missing? M...
I have a quadratic eigenvalue problem of the form: $$(A_2 s^2 + A_1 s + A_0)\hat{v} = 0$$ where $s$ is the eigenvalue. The matrices $A_i$ contain derivatives up to order six, and I have six boundary conditions: $$ \hat{v}(0) = \hat{v}(1) = 0 \\ \hat{v}^{ii}(0) = \hat{v}^{ii}(1) = 0 \\ \hat{v}^{iv}(0) = \hat{v}^{iv}(1) ...
My FDM code simulates Backward Facing Step flow when I use conventional BCs such as defining velocity profile at inlet and fully developed condition at outlet. I have validated the results and it seems functioning correctly. However, when I want to impose a pressure-pressure condition (both static), it only converges w...
So I have a PDE that I use to describe how material flows through a volume(2D or 3D). $$\frac{\partial C}{\partial t} + \vec{u} \cdot \nabla C = (D' + D )\nabla^2C$$ Now using finite differences I get to the following: $$C^{i+1}_{j,k} =C^i_{j,k}+\Delta t \biggr[ (D+D')\biggr[\frac{C^i_{j+1,k}-2C^i_{j,k}+C^i_{j-1,k}}{(\...
I often see neural networks extended to complex-values. Those networks allow complex input, complex parameters, and complex output. My understanding is that the inner products and point nonlinearities are simply extended. I can see it's advantage for signals that are naturally complex (e.g., phase/amplitude decompositi...
Im currently implementing a Nelder-Mead algorithm in MATLAB that can deal with constraints. In detail, the constraints should be added to the objective function with a Lagrange Multiplier($\lambda$) and the new function is then minimized by Nelder-Mead. Looks something like this. $$L(x_1, \ldots,x_n,\lambda_1, \ldots,\...
I have the following code to execute: $X$ = [0;0;0;0]; $sw$ = 0; for k = 1 : n if (sw(k) == 0 && X(2,k)> 0.7 ) || (sw(k) == 1 && X(1,k) >0) sw(k+1) = 1; X(:,k+1) = X(:,k) +h*(A1*X(:,k) + B1*u); else sw(k+1) =0; X(:,k+1) = X(:,k) +h*(A*X(:,k) + B*u); end end This is fine. I ...
Is there now a package for rigorous numerical integration that uses interval arithmetic and has access to a well-developed library of special functions? By "well-developed", I mean something that, at the very least, includes the error function $\text{erf}$, the incomplete gamma function $\Gamma(s,x)$ and the like. In o...
I need to discretize the surface of prolate spheroid given by the equation $$\frac{x^2}{L^2} + \frac{y^2}{D^2} + \frac{z^2}{D^2} = \frac{1}{4}$$ The surface has to be divided to 500 equal panels to calculate the velocity potential on it. This means I will need to calculate the normal vector at each panel Can anyone sug...
I have the following setting: An irregularly-shaped domain, expressed as a mesh of points A Laplacian operator, together with boundary conditions I am looking for the eigenvalues of that operator, i.e. functions (expressed on the mesh, though clearly approximating an underlying continuous function) satisfying the bou...
In this JCP paper, the authors simultaneously enforce the discrete maximum principles and element-wise mass balance for advection-diffusion equations through convex optimization. The least-squares finite element method is used, so the problem becomes a mixed formulation with a flux variable $\boldsymbol{q}\in\mathbb{R}...
To get cutoff frequencies and eigenmode field distributions for a waveguide, one uses following equation: $$1/\epsilon ∇ \times 1/\mu ∇ \times E = \omega^2 E$$ With $ \omega^2 $ as eigenvalues. This works fine. But what if I would like to calculate the wave number $k_z$ ? If the waveguide is not changing in $z$ direct...
I am adapting a Java program from C++ and need a C++ function to perform the same task as the Java BOBYQAOptimizer() function. Can anyone recommend a C/C++ library with equivalent or similar functions and good documentation on how to use them? I've found one that might be suitable ( http://dlib.net/optimization.html ),...
Let $a,b,c,d\in\mathbb{R}^n$. Is it possible to compute $$\langle a*b,c*d\rangle$$ faster than 6 FFTs? I can do it with 6 FFTs by doing normal convolutions, 3 FFTs each. In my application I know $b, d$ upfront and can do preprocessing, so the cost is actually 4 FFTs. Can I do better than this? The reason I believe that...
My problem is to compute eigenvectors and eigenvalues of a lot of small (n < 30) symetric, positive definite matrices. So far I am using LAPACK's DSYEV. The priority is speed more than accuracy. Is there a faster algorithm (maybe not asymptotically, but in practice for small input)?
I would like to solve the linear system $\mathbf{A}\mathbf{x}=\mathbf{b}$, with $$\mathbf{A}=\mathbf{T}+\mathbf{C}$$ where $\mathbf{T}$ is a symmetric tridiagonal matrix and $\mathbf{C}$ is a corner-only matrix: $$\mathbf{C}=\begin{pmatrix} 0& 0 & \cdots & 0 & c\\ 0 & \ddots & & & 0\\ \vdots & & \ddots & & \vdots\\ 0 ...
Coldae is a solver writter by U Ascher and R Spiteri, located here http://www.cs.ubc.ca/~ascher/coldae.f . It can solve upto index-2 DAEs using collocation. I am new to Fortran, and having a hard time writing the driver, which is a collection of subroutines that define the function, jacobian, boundary conditions, gue...
I'm currently working with this kind of mesh (AMR) : To compute the gradient at the center of the cell P, I use the following formula : $$\nabla \phi_P = \frac{1}{\Omega} \sum_{faces} \phi_f \vec{S_f}$$ where $\Omega$ is the volume of the cell and $\phi_f$ is the approximation of the flux on the interface between cell...
I am looking for a website/database of computer hardware (CPUs/GPUs) benchmarked with common scientific tools, e.g. *GEMM (see comment below for more info on this tool). Currently, I am quite frustrated looking for this information, as it seems scattered across blogs, embedded in manufacturing marketing materials, or ...
I have a function of many variables (~200-2000) which I am optimizing with some success using L-BFGS. While the function is expensive to evaluate, the gradient can be computed with not much additional effort. I would like to know if there are any techniques which could allow this optimization to be sped up by parallel ...
I am trying to solve convection diffusion type equations by a modification: $$-\epsilon \Delta u+ b \nabla u+cu=f_1,$$ with the following boundary conditions: $$u=g~ on ~\Gamma_D,~~~~~~~~~~~~~~ \epsilon \frac{\partial u}{\partial n}=g_N ~~on ~~\Gamma_N.$$ The idea is to solve another equation: $$-\nu\Delta u+ \nabla u...
So I have a code that I use which solves a 1D variable coefficient diffusion problem in cartesian coordinates: $\frac{\partial u}{\partial t}=\frac{\partial}{\partial x}\left(D(x)\frac{\partial u}{\partial x}\right)$. It solves the equation implicitly using a backward euler discretization. it works fine, but I want to ...
I want to numerically solve for electric field of an object in an external electric field. The object has linear displacement field such that its permitivity ($\epsilon$) is constant. The object's shape is not important but I would prefer an ellipse. I do not know how should I impose curl and divergence equations into ...
I want to interpolate a periodic function on a non-equidistant grid and have implemented it the using the Lagrangian formula described in wikipedia. For an odd number of data points, this takes the form $$p(x) = \sum_{k=0}^{2K} y_k\,t_k(x)$$ with $$t_k(x) = \prod_{m=0,m\ne k}^{2K} \frac{\sin\frac12(x-x_m)}{\sin\frac12(...
Just studying some toy examples of $2\times 2$ and $3 \times 3$ matrices, complex number multiplication already gets a bit messy. From a numerical analysis point of view, if one were to try and build very large matrices to model physical behavior, is it much more desirable to build real matrices over complex matrices, ...
Could someone explain the link (if any) between the spectral methods (SM), as presented for example here and the so called spectral volume methods (SV) and spectral difference methods (SD) for CFD ? Are SV and SD the applications of SM to CFD ? If not, is there an application to CFD of SM (that would then have no link...
I wrote a code which solves the 2D Poisson equation with homogeneous Dirichlet BC everywhere and a source term of -1. I am using the classical Jacobi iteration method. The grid is $N_x \, \mathrm{x} \, N_y$, and all the arrays are 0 based. The code yields good results with a 5 points stencil (2$^{\mathrm{nd}}$ order fi...
What would be the rigorous mathematical expression of the fact that a conservation law discretized with a Finite Element method with Galerkin discretization does not result in a conservative scheme ?
Our current lab uses SNOPT as an optimizer for aerodynamic shape optimization. I am currently working on building an approximate Hessian for the sake of improving the convergence speed and limits. Unfortunately, SNOPT only allows me to define an initial Hessian. Is there a FORTRAN package that would allow me to input t...
Consider the following scenario: I want to perform a large Monte Carlo simulation across a compute cluster with several nodes. To avoid excessive transmission of data, I am going to generate random data for my simulation on the individual nodes. Using Python, I would like to do this using numpy.random functions. I need...
i'm solving sparse linear equations within scipy 0.18 which internally resorts to SuperLU (after umfpack got removed due to license-issues). Current, i'm doing a complete re-factorization in each iteration of my algorithm, but now i want to re-use the permutation-ordering (at least the column-permutation; but maybe eve...
I have a system of two bodies, $b^i$ and $b^j$, each in position $\vec{p}^i = (x^i, y^i)$ and $\vec{p}^j = (x^j, y^j)$. The two are connected via spring and I'd like to know, given their states at time $t_n$, their states at time $t_{n+1}$ ($\vec{p}^i_{n+1}$ and $\vec{p}^j_{n+1}$). I have decided to use the backward E...
I am looking for the subject. The size of matrices will be around 1000x2000 elements with linear amount of ones (say, 6000 ones in the whole matrix). The operations I will use the most: iterating over elements of particular column; iterating over elements of particular row; getting submatrix by columns; solving undete...
In a previous question, link, I asked about how I could most effectively do a Fourier Transform of a radial function given at certain values and which we knew the asymptotical behaviour of. The Fourier transform reading $$\frac{4\pi}{q}\int^{\infty}_0 dr\, r \sin(qr) f(r).$$ I tried several ways and ended up choosing F...
I am trying to use CSDP and am struggling with this. Consider for example the SDP problem proposed by prof. Borchers here. Namely: $$\max_{A,z} \sum_{i} z_{i}\quad\text{subject to}\quad\mbox{tr}(P_{i}A) \geq z_{i},\quad i=1, 2, \ldots, n.\quad A \succeq 0.$$ I am wondering how one represents it in the standard CSDP fo...
I have been writing a control system toolbox from scratch and purely in Python3 (shameless plug : harold ). From my past research, I have always complaints about the Riccati solver care.m for reasons that are technical/irrelevant. Hence, I've been writing my own set of routines. One thing I can't find a way around is ...
Let $f(x,y)$ and $g(x,y)$ be two $\mathbb{R}^2\rightarrow\mathbb{R}$ functions, both strictly increasing in both arguments. Assume that they are well-behaved functions (continuous, differentiable, etc.) Given these properties, I want to find a root to the following system of equations: $$f(x,y)=f_0$$ $$g(x,y)=g_0$$ ass...
I am going to discuss my reasons for wanting this first, as this may in fact not be what I am looking for. My reason for asking this that I have finished writing a piece of code that solves, $-\nabla \cdot(a \nabla u) = f$ where $a$ is discontinuous, this is the result of the code we can see oscillations about the lin...
I do computational work as a PhD student and I try to find a correct way to separate code (solver) from the computational experiments based on this solver. Basically, each project that I do revolves around one particular solver (MATLAB or Python code), and for each project there is a set of experiments that should be d...