instruction
stringlengths
43
28.1k
I have questions about the use of "derivative" annotation I wanted to ask you. Lets put a sample. The equation is this: z_level = LevelZ(time); where LevelZ(time) is an external C function, and there are also LevelZ_der(time) and LevelZ_der2(time) that are the first and second derivative. It the code is like this, ...
I am looking for information on the time complexity for solving sparse system Ax=b with direct solver. This system results from a finite-element discretization of an elliptic problem. The matrix A considered is symmetric definite positive, has n equations, m non-zeros and a constant bandwidth b. How the time complexity...
I was asked to prove that the time complexity of merge sort is $ O(log_2n)$ but I cannot find a way to continue my method. Any help? $T(n)=2T(\frac{n}{2} )+n$ $T(n)= 2[2T(\frac{n}{4})+n] +n = 4T(\frac{n}{4})+3n$ $T(n)=8T(\frac{n}{8})+7n$ $...$ $...$ $...$ $...$ $T(n)= 2^kT(\frac{n}{2^k})+(2^k-1)n$ Finally $\frac{n}{2^k...
I want to compute the following conditional expectation $E_{t}[\phi(A_{t+1}, \eta_{t+1})| A_t]$ where $\log A_{t}=\rho \log A_{t-1} + e_{t}$ and $e_{t}$ is IID $N~(0,\sigma_e)$ and $\eta_{t}$ is another normally distributed variable with $(0,\sigma_{\eta})$. The function $\phi(.)$ is known. I am unsure if someone wan...
In LeVeque's Finite Volume Methods for Hyperbolic Problems, p. 320-321, one may find the derivation of the Roe matrix to the 1D Shallow Water Equations (SWEs). It is $$ \hat{A}_{i-1/2}=\begin{pmatrix}0&1\\-\hat{u}^2+g\bar{h}&2\hat{u}\end{pmatrix} $$ where $\bar{h}=(h_i+h_{i-1})/2$ and $$ \hat{u}=\frac{\sqrt{h_{i-1}}u_{...
I have a light ray moving through space-time, i.e. a curve in $\mathbb{R}^4$, parametrized by some variable λ. The exact trajectory, i.e. the coordinate functions $x^μ(λ)$ of the curve are given by some ODE $\frac{dx^μ}{dλ} = f(λ)$. Now, I've got two requirements for my code to satisfy: The results $x^μ(λ)$ must be gi...
I want to debug a c++ code with Netbeans. I can use the debugger in sequential mode but I dont know how to debug it when I want to run it in parallel. I would be grateful if anyone help me on this problem.
I have a bunch of 3x3 linear systems of the form $Ax=b$. In general, would it be faster to solve each individual system, or to formulate it as a giant block diagonal system and solve that? I expect to have a million or so systems to solve. I also was planning on using the Eigen C++ library, if that makes any difference...
Using an established criterion involving capturing eddies down to the Kolmogorov length scale it can be reasoned that the order of grid points in the computational mesh needs to be $N^3 \ge Re^{9/4}$ where Re is the Reynolds number of the flow. If $Re \approx 50,000$ then I get about $N^3 \approx 3.7\times 10^{10}$. I...
I have a question about Galerkin method. I don't understand why the Galerkin method weights the residual by the shape functions and sets it equal to zero. I want to know what is reason of this. Why we must set weights residual functions equal to zero?
I am interested in studying a problem of the form $\min F(\Omega)$ where $\Omega$ varies in the class of convex, open sets in the plane. An idea is to deform $\Omega$ at each step using a steepest descent algorithm, and if the deformed shape $\Omega_d$ is not convex, project it in some way on the space of convex sets. ...
I was reading through Monaghan, SPH, 1992 paper and he states that any quantity $A$ at $r_b$ can be approximated by $A(r) = \sum_b m_b \frac{A_b}{\rho_b}W(r-r_b,h)$ and so the gradient of that quantity can be computed as $\nabla A(r) = \sum_b m_b \frac{A_b}{\rho_b} \nabla W(r-r_b,h)$. So if we want to approximate the d...
Let curve $C_1$ be defined parametrically $$\begin{aligned} &x(t)=0.5\cos(t)-0.3\cos(3t),\\ &y(t)=1.2+0.6\sin(t)-0.07\sin(3t)+0.2\sin(7t) \end{aligned}$$ How do I find if an arbitrary point $P(x,y)$ is inside or outside of this curve? Also, for another curve $C_2$ $$ \begin{aligned} &x(t)=0.4+\big(0.19+0.07\sin(5t)\big...
Suppose I have an unstructured polygonal mesh system like so: Each node $x$ has Cartesian coordinates $(x_1,x_2)$, so for a given node can form matrices like this: $$ J(x,y,z) = \left(\begin{array}{cc} y_1-x_1 & z_1-x_1 \\ y_2-x_2 & z_2-x_2 \end{array}\right) = (y-x,z-x) $$ If my mesh were structured, i.e. a mappe...
In CVX, how do we return the value of the parameter over which the problem is minimized at the optimal value? By this, I mean, how do we obtain $$x^* = \arg\min_x f(x)$$ when solving the problem with CVX? I have gone through the user's guide and did some google searching. The only thing I could find was cvx_optval whic...
Suppose I want to solve the PDE: $$-\nabla\cdot\left( a_\epsilon\left(x\right)\nabla u\right)=0 \text{ in } \Omega$$ $$u=g(x) \text{ on }\partial\Omega$$ Here, I assume that $a_\epsilon(x)=a(x,\frac{x}{\epsilon})$ for some $a(x,y)$ such that $a$ is 1-periodic in $y$. I know that if I apply the standard finite differenc...
I want to study the Density matrix renormalization Group(DMRG). Can some one provide me with the souce code which is writen by C++ for study purpose only? The code is not necessiary very professional, but works.
I am currently writing a code that solves a large tridiagonal matrix every iteration and runs for 1,000's of iterations. I am currently using a Thomas algorithm to solve the matrix serially. I found a parallel version of the Thomas algorithm in the book called "Parallel Scientific Computing in C++ and MPI" (which you c...
For a silly screen saver I'm trying to develop, I'd like to randomly generate a divergence-free 2D array of 2D vectors, and then use it to generate a line integral convolution plot. I've heard$^1$ that one way to do this is to generate random noise, and then project out the solenoidal component of its Helmholtz-Hodge d...
I have a 2D implementation of smoothed particle hydrodynamics up and running, however when I tried to move it to 3D, using the appropriate 3D kernels, particles always tend to go apart from each other. Since my 2D implementation works fine and the only thing I've changed are the kernels, the only parameter that affect ...
Imagine you have a piece of wood and from that piece you want to get the largest cylinder possible. How do you determine the position and orientation of the cylinders axis, to maximize its radius? I've been looking at this problem for over a year now and I can't find an efficient (or rather any) algorithm that can han...
Background I'm trying to do an update to a "thin" QR decomposition ($A = QR$, where $Q$ is $\mathbf{R}^{m,n}$, the first few columns (up to the matrix rank) of an orthogonal matrix and $R$ is upper triangular and square and $\mathbf{R}^{n,n}$). The matrix itself is a full column rank "tall" matrix ($m \ge n$), and I'm...
I have a (cyclic undirected) graph stored in a suitable structure (which depends on the language chosen). Nodes represent places in the real world and edges represent connection between them, so I have a sort of initial guess of the drawing. I have to draw this graph with some constraints and requirements, and from wha...
I'm trying to solve the following non-linear diffusion equation: $$ \frac{\partial}{\partial t} u(x,t)= \frac{\partial^{2}}{\partial x^{2}}u(x,t)^{3}$$ $$ -1\leq x \leq1, t \geq 0 $$ with the boundary conditions: $$u(1,t)=-u(-1,t)=1$$ and the initial conditions: $$u(x,0)=x$$ I'm trying to implement a Crank-Nicolson sch...
I have two sets of 300 VTK files and I want to get a graph comparing the average difference of the two sets. All files have a structured grid containing a scalar value named phi. At the end, I need a graph showing the average difference of each grid for every grid. I have computed the difference at each cell using a Pr...
Typically, the function that one wants to integrate numerically, $f$, is given, i.e. its values for various points $\{x_i\}$ are known precisely. The resulting error is due to the fact that we chose a finite number of points. Let's call this error $numerical$. I have a different situation. I know the values of $f$, $\{...
This question is a follow up of another one I have asked a while ago. I have successfully implemented my problem using odeint library and I get the results I expect. However I would like to give an estimation of the error for the results, obtained by Runge-Kutta method of 4th order. In addition to results obtained by ...
So far the closest I've found is ViennaCL, which has a Lanczos implementation for Eigenvalues. It is not clear that EigenVectors are produced by this library. Does anyone here know whether ViennaCL solves for EigenVectors? And how to get them? Or of any other sparse matrix EigenVector solver for GPGPU? ETA:From what I ...
I'm using DGGEVX routine from LAPACKE with BALANC option as shown below, but to my surprise changing BALANC option from 'N' to 'P' or 'S' or 'B' has no effect on the output Eigen values & vectors. Does anybody know why? info=LAPACKE_dggevx(LAPACK_COL_MAJOR,'B','V','V','N',n,a,n,b,n,alphar,alphai,beta,vl,n,vr,n,&ilo,&ih...
I would like to solve numerically the diffusion equation, where the sink term depends linearly on the field, and there is field-independent sink: $\frac{\partial^2 u(x)}{\partial x^2} =f(x)u(x) - \kappa(x)$ At the moment I am solving the above using a finite difference scheme, where I modify the standard laplacian mat...
I want to learn a numerical method for PDEs other than finite difference method. After some research on internet i have found Rothe method and it looks interesting to me. Unfortunately, i couldn't find a good book/ notes for starting. Can you suggest me a book to study? What is prerequisites/corequisites for the Rothe ...
I have seen videos like this before in the past of things like "3D Mandlebulbs" and similar fractal sets, but can anyone tell me what sorts of programs are actually used create these visualizations? How computationally expensive are these visualizations to make? Also, what sort of simulations are these? I mean, what so...
For non-overlapping domain decomposition methods for elliptic problems there is an associated Steklov-Poincaré definite positive operator defined on the interface, allowing a direct computation of the interface solution from the boundary data. I have never heard about an equivalent kind of operator for overlapping meth...
I'm playing with ARPACK. I looked into the examples they provide, zndrv4.f illustrating the usage of the routine znaupd, in the directory of ARPACK/EXAMPLES/COMPLEX/. I also came cross NAG Fortran Library. In NAG, there are some linear problem solvers F12***. The F12*** routines in NAG are equivalent to the znaupd in A...
I wrote a simple script to generate random polynoimals $\displaystyle f(z)= \sum_{k=0}^N a_k \frac{z^k}{\sqrt{k!}} $ of high degree and find their roots. For more discussion on random polyomials see here. N = 500 a = np.random.normal(0,1,N) n = np.arange(N-1)+1 n = np.insert(n,0,1) n = np.sqrt(n) n = np.cumproduct(n...
Lets say I have a function $f(X) = f(x_1,...,x_N)$ to be integrated. But unlike time discrete methods, my integrator uses quantisation to advance time, that is if $|x - q| > dQ$, with $q$ being the quantised version of $x$ and $dQ$ being the quantum. To achieve this, the function needs to send $f(X)$, $f'(X)$, and $f''...
For $A=LU$, or $A=LDL^T$ factorization, bandwidth is preserved when there is no pivoting. This is true even for indefinite A, see question. However, when there is pivoting band structure is destroyed, so fill-ins can occur outside the band. I am curious if there is any pivoting that can still preserve sparsity for the ...
I am working on generating a (complex) solenoidal vector field $\mathbf{A}$ from a prescribed (complex) vector $\mathbf{a}$ and the gradient of a scalar, $b$, such that $$\mathbf{A} = \mathbf{a} + \nabla b.$$ The condition that I require is then $$\nabla\cdot\mathbf{A} = \nabla\cdot\mathbf{a} + \nabla^2 b = 0 \qquad \L...
Before there was CUDA or OpenCL people were using GPUs for computation. I am trying to find out how they did that -- because I want to press my Rasberry Pi's GPU for computing and it does not seem to have OpenCL support. I am looking for notes on how they did this. I've done cursory Googling but have come up empty han...
I have very large matrices that I would like to row reduce (I need to keep track of the steps and find a basis of the kernel/image, not just find the rank). The good news is that I work mod 2 and the matrices are very sparse. The problem is their size, right now I have a beast that is roughly 3 millions x 1 million, bu...
I am writing a molecular dynamics program to create an lattice and populate it with atoms/molecules. These then are given random velocities and the system is initialized. Then throughout time the molecules interact with each other and exert forces on each other. I've tried to make my program as readable as possible. M...
I'm currently revising my optimization algorithm for a specific part of a problem. I have trouble in wrapping my head around a new approach and my mind is having this tunnel-vision of ideas. I could really use some fresh perspectives. I'll try my best to simply the explanation. (Please see attached file "Example-1.png"...
I wrote a Monte Carlo simulation of the 2D Lotka-Volterra model on a discrete lattice (with periodic boundary conditions). A video that I produced (which images the system after some number of monte carlo steps) can be found here. I am wondering, what is the best way to track the spatial "speed" of the oscillations of ...
Is there a mesh data format which is particularly well suited for Cartesian meshes with Dey-Mittra style cut-cells? Ideally, one which does not require converting the cut-cells into a more general polyhedron. Non-proprietary formats with open-source implementations are also preferable.
I am solving a problem of the form: $\dfrac{\partial u(x,y,t)}{\partial t} = \nabla^2 u(x,y,t) - f(x,y,t)u(x,y,t) - \kappa(x,y,t)$ At the moment, I am solving this at each time step by assuming a quasi-steady-state: $\nabla^2 u(x,y,t) = f(x,y,t)u(x,y,t) + \kappa(x,y,t)$ To do this, I use finite differences, which means...
I'm looking to solve the Richards' equation. This models water flow in porous media and is a nonlinear, possibly degenerative, parabolic differential equation that takes the form $\partial_t \Theta(\psi) - \nabla \cdot (K(\Theta)\nabla(\psi+z))=0$ where $\psi$ is pressure head, $\Theta$ is the water content, $K$ is the...
What are the problems that arise when fitting (2D or 3D) a set of scattered data? (non uniformly distributed) I had some data I had to fit and I solved the problem using the triscatteredinterp() matlab function which implements different types of methods: natural neighbor interpolations, linear interpolation and neares...
I am encountering a problem that my MATLAB code ran and an error occurs and shows that it is out of memory. My code is using finite element method to solve some complicated kind of integral equation and the number of elements can reach more than 100,000. I use the sparse to store the stiffness matrix and ran the code i...
What is a reasonable manufactured solution to test the following equation against its finite difference approximation? I want it to look like a Cosine function about $0$, rotated about $Z$ axis (basically not varying about $\theta$) such that $f$ turns out to be a not so bad function in terms of $r,\theta$ $$u_{rr} \;...
"We consider an unstructured planar (undirected) graph and calculate the stationary probability distribution of the random walk on the graph. The graph is generated by choosing n random points in the unit square and triangulating them using Delaunay triangulation." This sentence is from the description of a test proble...
I am a computer science student and I came across the Verlet Cloth simulation. An implementation is here. I was interested in how such computation would lend itself to parallelization. The problem looks like a variant of N-body computation where we could compute constraints on each point and them move the points based...
It is necessary for me to find the unit outward normal vector for the curve: $$\gamma=(x(t),y(t)) $$ where $$x(t)=\cos(t)−0.5\cos(3t)$$ and $$y(t)=\sin(t)+\sin(7t)+\sin(3t)$$ I know how to find unit outward normal vector for this: using $$T=\frac{\gamma' (t)}{||\gamma(t)||} $$ so $$N=\frac{T (t)}{||T(t)|| }$$ bu...
I am trying to write a code to solve a nonlinear BVP using the Finite Difference Method. The BVP is: $(T^2)\frac{\partial^2 T}{\partial x^2} + T \left( \frac{\partial T}{\partial x}\right)^2 + Q = 0$ The boundary conditions are Dirichlet at $x = 0$ and Robin at $x = L$. The parameter $Q$ is a constant. My (probably nai...
I recently implemented Successive Over Relaxation using Cuda as a part of my course project and was curious to know how I can make the code more efficient. I'm using Red/Black SOR scheme which is popular version of parallel SOR. To update the value at a grid point, I need to access 4 adjacent values which are generall...
I am performing analysis on chassis (Static Structural) and for optimization purpose i am asked to generate MESH-INDEPENDENCE REPORT,of which i have no idea. I have tried going through research papers but couldn't find anything important. Need a basic idea about Mesh-independence, any example would be helpful.
This is a homework question, I would like to know if someone can shed some light on it. Let $x_n = \frac{a_n + b_n}{2} , r=\lim_{n \to \infty}x_n$ and $e_n =r-x_n$. Here $[a_n,b_n]$ with $n\geq0$ denotes that successive intervals that arise in the bisection method when it is applied to a continuous function $f$. Show...
In Golub and Van Loan's book, Matrix Computations, page 606, it is stated that: With standard discretizations, 2-dimensional problems can be solved with $O(n^{3/2})$ work and $O(n \log{n})$ fill-in. For 3-dimensional problems, the typical costs are $O(n^2)$ work and $O(n^{4/3})$ fill-in. Here, they refer to elliptic...
I have a problem with implementing proper boundary conditions on sides of my simulation (in RF or WaveOptics module of Comsol). I want to obtain an infinite but not periodic space (beacuse then I will put something inside). For example, it can be a glass-vacuum interface with incident plain waves. For such a simulation...
I have some vector $V$ which can be decomposed into the eigenspace of the hermitian sparse operator $M$: $V = \sum_i v_i \hat{m}_i$ Is there a way to find the $\hat{m}_i$ (the eigenvector itself) that correspond to the largest $v_i$ (in magnitude)? I essentially want the largest few terms of the sum, including the eige...
Background Please note that I am duplicating the question on scicomp. I have already asked this in math. I am trying to come up with a scheme in Polar Co-ordinates for the following PDE: PDE I am trying to solve $$ u_t - (u_{rr} + \frac{1}{r} * u_r + \frac{1}{\theta} * u_{\theta\theta} + bu) = f(r,\theta, t)$$ I am ex...
I am trying to implement a second order DG-method using a monomial basis and explicit Euler in time. I have written down some of the theory, which I present below: Theory Consider the linear advection function over $\Omega\subset\mathbb{R}$ and a class of testfunctions $v\in C_0^1(\Omega)$ $$ \int_\Omega\partial_tuvd ...
I am interested in solving the problem $-A u = \lambda u$ on a finite differences grid on a square. In my case, the operator $A$ is of the type $-\Delta + \mu I$, where $\mu$ is there to impose some constraints. The method I used until now was to consider a finite differences grid and get $$ 4u_{i,j} - u_{i,j+1}-u_{i,j...
Can someone give some references to understand what's the differences between a component-wise and a characteristic-wise ENO scheme? If I'm right, the characteristic variables come from the diagonalization of flux matrix but I don't see how it comes to play when doing ENO and what's the advantage of it.
I have asked a question in this regard earlier. I am trying to solve the following equation in Polar Co-ordinates: $$ u_t - (u_{rr} + \frac{1}{r} * u_r + \frac{1}{\theta} * u_{\theta\theta} + bu) = f(r,\theta, t)$$ I am building a finite difference method to tackle the above pde. I have assumed the solution to be of t...
I have implemented a FVM code and now I need to plot the accuracy of the method as the mesh gets refined. Having a very fine mesh, my idea is to compare what is the error between the coarser and fine mesh in the L1-norm. My problem is that having a finer mesh the solution vector has more entries than the solution with ...
I want to solve a nonlinear optimization problem of the following form \begin{equation} \min\left(\sum_i d^{x_i}c_{i}\right)\\ 0 \leq x_{i} \leq a\\ \sum_{i} x_{i} \leq b \end{equation} $a$, $b$, $0.95 < d < 1$ and $c_i > 1$ are constant. The problem has a very specific structure, and my question is whether using a ve...
I'm trying to solve a Stokes flow problem with a pseudo-spectral method in periodic boundary conditions. The equations of interest are $-\nabla^2 \bf{v} + \nabla p = \bf{f} \\ \nabla \cdot \bf{v} = 0$ where $\bf{f}$ is a force vector coming from the gradient of a stress tensor, $\bf{f} = \nabla \cdot \sigma$. To do so,...
There has been quite a flutter recently in the iterative world about an algorithm that speeds up the classical Jacobi method by as much as 200 times using a scheduled relaxation method where a combination of over and under relaxation is employed. The results as shown in this paper are remarkable and are indicative of a...
Ply file formats is used to represent mesh structures in the TETGEN freeware package. All the examples I've seen of 'ply' meshes were used for triangular meshes. Can we use ply formats to represent tetrahedral meshes as well ? Any examples would be helpful ? PS : I am new in this field so any pointers for further unde...
I'm looking to numerically compute the solution to $$ k(x,u) \partial_t u - \Delta u = f \quad\quad\text{ in } \Omega \times [0,T]$$ where $k$ is a continuous but nonlinear (in $u$) real-valued function and $\Omega \subseteq \mathbb{R}^2$. I want to use the Finite Element Method, but I cannot seem to manage the nonlin...
I am learning Monte Carlo simulation by C++. I begin with reading codes (from the internet and text books) of the 2D Ising model and the XY model. I find some people define spins simply by a two dimensional array int s[i][j], however, some people use vectors like int *s or int **s together with new int. The body of the...
This might be a question better suited for the Software Recommendations side of S.E., however I do believe that people who frequent this part of S.E. are more likely to be able to answer this question. I am looking for a free (not only as in freedom) alternative to Comsol Multiphysics. Here is the tricky bit: I am not ...
Do you know what numerical software computes an eigenvector basis for a unitary matrix? Say I have a unitary matrix $U$. If its eigenvalues are simple (no multiplicities), then for instance Matlab computes an eigenbasis for $U$. However, if there are some eigenvalues with multiplicities, in the subspace for the eigenva...
This is a follow up to this question. I have a nonlinear BVP on $x=0$ to $L$: $$ (T^2)\frac{\partial^2 T}{\partial x^2} + T \left( \frac{\partial T}{\partial x}\right)^2 + Q = 0 $$ to which I apply a finite difference discretization. The parameter $Q$ is a constant.There is a Dirichlet boundary condition at $x = 0$ an...
I am solving the following PDE; $$ \nabla^2 u = \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} = \rho, $$ where $\rho(0.5,0.5) = 2$ (zero elsewhere), $0\leq x,y\leq1$ and the boundaries will satisfy the condition $u = 0$. I am solving by finite differences using both a 5 point second order stenci...
I was wondering whether there is some theorem that allows me to put an upper bound on the error introduced by omitting small matrix elements from a matrix before diagonalization. Let's assume we have a large matrix, whose matrix elements range from $1$ to $10^{-15}$. If I were to set all matrix elements smaller than $...
Consider the diffusion of some unknown $R$ on a physically discrete, 1-D ring: x---------x---------x---------x n = 0 1 2 3 We let grid point $n=0$ be the same as grid point $n=3$, giving us our ring. We are given a diffusion coefficient $D$, which is still multiplied by some to some not...
The wave equation, $$\ddot{u} = c^2 \Delta u,$$ can be generalized to abstract graphs by using the negative graph Laplacian in place of the physical Laplacian. Is there a graph-theoretic analog of Perfectly Matched Layers (PML), where "outward traveling waves" exit the graph without reflection? It is not clear to me...
I want to minimize the functional of the Blind Deconvolution model as given in: Total Variation Blind Deconvolution by Chan and Wong. Their model is given by: $$ z = h \ast u + \eta $$ Where $ \ast $ is the convolution operator, $ h $ is the blurring kernel, $ u $ is the sharp noiseless image and $ \eta $ is additive w...
It may be that we have a model where the following equation holds for some phenomenon: $$(1)\quad x + y + z = T$$ Importantly, $T$ is a constant, i.e.: $$(2) \quad \frac{\mathrm{d}T(t)}{\mathrm{d}t} = 0$$ We may be interested in the evolution of $x$, $y$ and $z$ as governed by their differential equations. If we want t...
Suppose I have a triangulated mesh and I have solved a differential equation problem and have a solution phi. From phi I can construct a vector field, how would I go about computing the gradient of this vector field? The mesh looks something like this. phi is solved for at the center of all of the cells in the picture....
Trying to solve stationary Navier-Stokes problem for incompressible laminar Newtonian fluid. I've found a couple solutions for instationary Navier-Stokes equations (like FeniCS examples or CFD Python), but nothing on stationary. As far as I understand methods are totally so this code couldn't be reused properly. Does ...
I decided to solve using finite differences one of the simplest differential equations which has an analytic solution, notably $\frac{du(x)}{dx}=2x$. The equation is first-order ODE with quadratic equation $u(x)=x^{2}$ as its solution. The problem can be categorized as a boundary problem because we know the value of th...
I've never run into a singular matrix before, so bear with me. I have a complex non-symmetric matrix (about 1000 x 1000) that I know has a couple zero eigenvalues. It isn't guaranteed to be diagonalizable, but when I pass it to ZGEEV, I see no apparent problems. I use all the eigenpairs for later analysis, but I am uns...
EDIT (26-12-14):In the Belytschko's EFG code, the domain of influence for uniform distributed node can be calculated using the code below; my question is how to calculate xspac and yspac when the nodes are irregularly distributed? % DETERMINE DOMAINS OF INFLUENCE - UNIFORM NODAL SPACING dmax=3.5; xspac = Lb/ndivl; yspa...
I have a simple question concerning the management of the output after running a Fortran code, having a NESTED LOOP.. I want to calculate for different k=1,5,9 the value $\mathbf{Sin(kx)}$ in the range $\mathbf{x=0:2\pi}$ with the step $\mathbf{h=0.01}$. As the range of $\mathbf{x}$ for all $\mathbf{k}$ is the same, I ...
I have an algorithm (in R) that maximizes a convex function on a compact convex set in every iteration. Based on the maximum principle, I know that the maximima are only attained on the boundary. But my current implementation searches in the whole space which is not necessary and time-consumer. To increase the time eff...
I am trying to Draw shear force diagram and bending moment diagram of beams. In this, I need to integrate second order differential. So, Anybody can suggest me, which numerical method should I use?
How to find all roots of an equation in Matlab? I tried and it gave me just one of the roots. For example: my equation is $F(x)=0$ where F(x) = (cos(7*x)).*exp(-2*x.^2).*(1-2*(x.^2))
Determining the intersection of two convex polygons is one of the fundamental problems in computational geometry . I'm asking for an algorithm having: INPUT: Given two convex polygons P and Q in 2D (note that the two convex polygons are represented with p & q points) OUTPUT : compute their intersection? Can any one hel...
Is there any reason to always solve the Kepler equation for the eccentric anomaly, $E$, instead of the more meaningful (at least to me) true anomaly, $\theta$? Solving for the eccentric anomaly usually would mean calculating the true anomaly from its solution and maybe even the initial guess of the eccentric anomaly fr...
I need to generate a sequence of increasingly denser high-quality triangular meshes for some pentagons in MATLAB. I want to supply as my input The coordinates of the 5 vertices of the pentagon The desired (approximate) mesh-node spacing or the number of mesh-faces in the output mesh. The output should be A high...
Let given $M =$ 1 0 1 0 1 1 1 1 1 and $b =$ 1 0 1 How to find the solution $x_3$ where $x=${$x_1,x_2,x_3$}? Solution: Based on Wiedemann algorithm we has $u_i=[0; 0; 1]$. I am getting confused in the Step2. How to find $M_s$? Is it just the $3^th$ columns of $M_t$ as $M_s=[1 1 1]$ or...
I am going to solve an linear iterative inverse problem. I have two functions in matlab which one of them play the forward and the other play the adjoint role. I am not familiar with inverse problems very much and I am going to test some algorithms to check which one can help me to obtain a sparse model. Since I have t...
To those who are familiar with the projected Newton's method or projected gradient method... We consider a constrained optimization problem with simple bounds. Particularly, minimize f(x) subject to L <= x <= U, where f maps R^n to R. x, L, and U are vectors in R^n. In the projected Newton's method that is used to solv...
I'm with the background of computer engineering and generally use FEM for graphics simulation. As far as I know, FEM formulation is usually expressed with respect to the reference configuration, i.e., the volume integration is over the initial domain and the stress-based force $f$ is computed using the first Piola-Kirc...
I was looking to brush up and/or pick up some languages for a hobby project on my free Amazon EC2, and I was going through the benchmark results for Java vs C (or Scala vs C)and Fortran vs C. It seems that the margin in Java vs C is nearly the same in Fortran vs C, which made me wonder if JVM (and its JIT optimizations...
Consider this problem: \begin{equation} \begin{array}{ll} \text{minimize } & f(x) \\ \text{subject to } & a \leq x \leq b \end{array} \end{equation} where $a,b,x \in \mathbb{R}^n$ and $f: \mathbb{R}^n \rightarrow \mathbb{R}^n$ is continuously differentiable. By this definition, the feasible set is clos...
I am trying to solve an almost incompressible problem with heterogeneous properties by domain decomposition. Solution with CG converges slowly or divergerces completely. My problem becomes ill-conditioned (condition number in the order of 10^5) due to the poissons ratio approaching to 0.5 and stiffness differences in b...
Is there some packages in java that can be included to eclipse in order to solve a non linear problem? I have used ipopt but when running, there is a notification which say "NOTE: You are using Ipopt by default with the MUMPS linear solver. Other linear solvers might be more efficient (see Ipopt documentation)." ...