instruction
stringlengths
43
28.1k
Consider a planar graph, where each node is associated with a weight. I would like to partition the graph such that the sum of the node weights in each group satisfy a minimum requirement. However, I would also like as much 'resolution' as possible - that is, I want to maximize the number of groups (minimize the number...
I am solving elliptic PDE problem, for which, Euler scheme looks as following: $$ \nabla [\gamma ( |\nabla u|^2) \nabla u] = 0,$$ where $$\gamma(|\nabla u|^2) = (1 + |\nabla u|^2)^{-1/2}. $$ I am aiming to define minimization problem for problem above. Does anybody have any suggestion how it should look like? Or some ...
I'm just starting at scientific computing and I'm seeing that results can be generated merely by plotting the variables. Of course more variables lead to more axes/dimensions so e.g. a three variable system could be or would need to be modeled as a 3D plot. What I was thinking though was e.g. a 2D case. Does visualizat...
The governing equations are listed here of my notes on page 4. It's a reproduction of other's paper which solves the equations with COMSOL. The problems arise when I want to solve for the consistent initial condition of the algebraic components, $\phi_1$ and $\phi_2$. They consist of a kinetic reaction term for five re...
In my answer to a question on MSE regarding a 2D Hamiltonian physics simulation, I have suggested using a higher-order symplectic integrator. Then I thought it might be a good idea to demonstrate the effects of different time steps on the global accuracy of methods with different orders, and I wrote and ran a Python/Py...
Multigrid introductions normally use a rectangular grid. Interpolation of values is then straight forward: Just interpolate linearly on the edge between two adjacent nodes of the coarse grid to find the value of the fine grid node on that edge. For an FEM application I have a grid which is "topologically" rectangular s...
I have been trying to solve the following nonlinear ordinary differential equation: $$-\Phi''-\frac{3}{r}\Phi'+\Phi-\frac{3}{2}\Phi^{2}+\frac{\alpha}{2}\Phi^{3}=0$$ with boundary conditions $$\Phi'(0)=0,\Phi(\infty)=0.$$ My solution is supposed to reproduce the following plots: Now, to produce the plots given above, ...
As a general programming enthusiast and aspiring Bioinformatician student I have an intermediate understanding of computing (languages) as well as Java, and to a lesser extent C++. Having knowledge in a declarative as SQL and the intent to learn a functional as R; I found myself in need of interpreted/scripting languag...
I have a 3000 x 2301 matrix 'xfinfin' in MATLAB that I want to plot in the following way: for i=1:2301 ome = 0.4 + 0.001*(i-1); plot(ome,xfinfin(:,i),'k.'); hold on end But this very quickly leads to MATLAB using 100% RAM and an error shows up in the MATLAB commnad line 'Out of memory'. Basically, this al...
I have this type of question (ODE-constrained optimization) to solve: $g(x,p)=0$ is the simulation, where $x$ is state variable and $p$ is parameters aimed to optimize; $f(x)$ is the objective function (a measure of merit). I read that some people deal with this by discretize the ODE, but there seems another method cal...
I got this problem thrown at me, unfortunately I lack context at the moment but I thought Maple or Mathematica would solve it anyways. I have a function $f$ over $x$ and $y$ such as this (Maple) f := (y-1.298*exp(-1.311*x)-.3435*exp(.3602*x))*(x-3.059865611)*(y+1.875*exp(-.8384*x)+0.7033e-1*exp(.838*x))*(y+.5774*x+3.53...
A while ago I came up with an algorithm which can be used to numerically solve optimal control problems, which basically came down to discretizing the control input $u(t)$ and interpolating this to get a continuous function. I tried to optimize the cost function for each discrete value by using the golden search method...
I want to stop immediately an MPI program, that has N processors and each processor runs a different algorithm (with different computational complexities). Processors share information to each other using an unidirectional token ring topology. As soon as one processor ends it should notify its neighbor and all processo...
I am trying to apply SVD to large sparse matrices. I already compared the performances of Propack and irlba to those of the matlab svd and svds. These two packages enhance significantly the computing time but I still have to handle the memory issue. Therefore, I am looking for a free matrix SVD algorithm which allows m...
My faculty advisor recommended that I take a look at the lattice Boltzmann method as an introduction to scientific computing and potentially an undergraduate honors thesis topic. I cooked up a some Java code (kind of unconventional, but I only know Java and Python right now), and I had a simple 2D simulation. Upon test...
When setting up a finite element system you have to use quadrature to calculate the integrals. I'm having trouble understanding what order rule to use. I know of some rules of thumb, for example with the 1D Hemholtz you end up with the matrix $M + S$, where $M_{ij} = (\phi_i, \phi_j)$ and $S_{ij} = (\phi_i', \phi_j')$....
Is there an efficient way to measure similarity/distance between two sequences of ranked numbers/letters. The two sequences are of different length, and only have some elements in common? For example, if I have three rank ordered numeric sequences like this: sequence A: 1,2,3,4,5,6 sequence B: 2,3,4,5,6,7,8,9,10 sequen...
I am trying to do a Molecular Dynamics Simulation of a complex fluid, confined between solid surfaces. I would like to find the flow rate as a function of fluid film thickness, $h$, for a plane poiseuille flow. (The flow rate is not expected to show an $h^3$ dependence, in general, if $h$ is small, in the order of a fe...
I am basically looking for a good open source C++ IDE with scientific and visualization libraries built in. Can any one suggest few projects?
I understand that the constant in the Courant-Friedrichs-Lewy condition is defined as $\mathrm{CFL} = \frac{u \Delta t}{\Delta x}$, where $u$ is the principal coefficient. I came across this post: Estimating the Courant number ..., which basically suggests that the CFL number can be used to decide on the time step size...
I'm trying to develop an inferential procedure for a multivariate dependent Markov process. Basically, the procedure could be considered as a non linear regression, with a known dependence structure among observation belonging to the same time-point and independent from the others. The non linear trend correspond to a...
I need to calculate $\log(\det (\mathbf M_i))$ where the $\mathbf M_i$'s are large sparse matrices, which are real, symmetric and positive semi-definite. I hope to have between $10$ and $100$ of those. Physically, each $\mathbf M_i$ is the stiffness matrix of a large system, and if it helps, I know how to write it as ...
I have this very simple ODE-contrained optimization problem: $h(x,x',p,t) = x'-A(p)x-b(p) = 0$, the constraint $g(x(0)) = x_0$, the initial condition with no parameters involved $F = \int (X-X_{obs})^2 dt$, the objective equation According to adjoint method, I need to Integrate constraint equation: $$x'=A(p)x+b(p...
As far as I know, for getting a unique solution to a PDE we should impose some boundary conditions to the PDE. "The number of required auxiliary conditions is determined by the highest order derivative in each independent variable. " My questions are: In any numerical method, especially in finite element method, is it...
For a grid-based numerical simulation, I am looking for a load balancing/partitioning algorithm that not only distributes my grid elements, but also determines (approximates) their respective weights. Does anyone know of existing approaches for this problem or can give me some pointers into which kind of mathematical f...
I derived a bicopter dynamical model with two servos and two BLDC motors. And now am trying to simulate it using Matlab. As base for simulation I used this paper and this code Unfortunately, the obtained model always blowing up in case of asymmetrical control input signals. For example, with identical speed on both pro...
Can one employ convex optimization for symmetric but not positive definite problems? I tried using MATLAB's quadprog() function to solve this problem: $\mathrm{min}\frac{1}{2}\mathbf{x}^T\mathbf{H}\mathbf{x}+\mathbf{x}^{T}\mathbf{g}$ $\mathrm{s.t.} \mathbf{Ax}=\mathbf{b}$ Where $\mathbf{H}$ is a symmetric but not posi...
I am analysing the stability of a series of 1D linear equations of the form \begin{equation} \frac{d}{dt} x = A x \end{equation} discretised using upwind and central finite volume methods, etc, with the explicit Euler time stepping scheme (to begin with). What I have done so far is that I have calculated the eigenva...
I have a simple C code with many function calls, which I profiled using gprof. % cumulative self self total time seconds seconds calls s/call s/call name 71.93 907.85 907.85 201280 0.00 0.00 ForceCalcs 2.61 1237.18 33.00 1258 0.03 1.00 ...
I have the following optimization problem $$\begin{align} &\min_{ X_{1}, \dots,X_{k} } \max_{ \theta, \phi } \left|P_{d}(\theta,\phi) - \sum_{k=1}^K \operatorname{Tr}(a_{k}(\theta,\phi)a_{k}^{H}(\theta,\phi)X_{k})\right|\\ &\text{subject to} \sum_{k=1}^K \operatorname{diag}(X_{k}) = \frac{E}{M_{t}N_{t}-(K-1)} 1_{M...
Initially I modeled my objective function as $$\arg \min \operatorname{Var}(f(x),g(x)) + \operatorname{Var}(c(x),d(x)) + \cdots$$ where $f$, $g$, $c$, $x$ are linear functions. To be able to solve the problem with linear solvers I have change the problem as follows ($\operatorname{abs}$ stands for absolute value): $$\...
I have a mixed integer quadratic problem and my objective function is as follows $$\arg \min \operatorname{Var}(f(x),g(x)) + \operatorname{Var}(c(x),d(x)) + \cdots$$ where $f$, $g$, $c$ $d$ are linear functions and $Var$ indicates variance and $x$ is a vector of 3000 binary variables. If I want to solve the problem wit...
I am trying to enforce the discrete maximum principle (i.e., ensuring non-negative concentrations) for diffusion-type problems that have an anisotropic diffusivity tensor (e.g., tensor dispersion from velocity). For the standard diffusion equation, I could employ convex optimization since I will have a symmetric and po...
Considering any two cylinders, defined as: the center of their bottoms $A_i$, the radius of their bottom $R_i$, the unit vector $W_i$ of their axis direction, and the length $L_i$ of the cylinders, where $i=1,2$: what is the necessary and sufficient condition of the intersection of the two cylinders? I want to numeric...
I am working to solve Poisson's equation in 2D axisymmetric cylindrical coordinates using the Jacobi method. The $L^2$ norm decreases from $\sim 10^3$ on the first iteration (I have a really bad guess) to $\sim 0.2$ very slowly. Then, the $L^2$ norm begins to increase over many iterations. My final matrix is weakly dia...
I want to ask questions like 'what family is this species in, and which other species are in this family?'. I am aware of Wikispecies/Wikidata but are there any other good open and linked databases/APIs that would be worth looking at?
I have the system which is described by several ODE. The solution looks good for me. Now I need to implement the sensitivity analyses of parameters which I used in the model. Therefore, I have the following questions: I have an output in the form of the vector(solution in time). But the sensitivity routines (such SALi...
This question is probably related to chemical engineers that are around this forum. I am looking into writing a solver for a precipitation reaction (struvite to be precise): A+B+C+D <=> E+F A, B, C, D, F - liquids; E - solid (for now I ignore the 'solid' part and focus only on mass transfer) So far I have tried to avoi...
The equation at the left of the interface is \begin{equation} \displaystyle\frac{\partial C_i}{\partial t} = D_i \nabla^2 C_i - z_i \frac{D_i}{RT}F \nabla \cdot (C_i \nabla \phi_2) \end{equation} The equation at the right of the interface is \begin{equation} \displaystyle\frac{\partial \epsilon C_i}{\partial t} = \nabl...
I have several files of data created by LabView of hydraulic pressure testing over the course of a few days. This data is mostly time with various pressure and temperature measurements. Can you recommend software that will plot several hours worth of data and then let me zoom/pan and select certain intervals? I need to...
So first off: *** This code is not being used in production software. It is a personal project of mine, trying to understand approximation theory and advanced curve fitting. In other words, I'm trying to understand how it works, not trying to get a currently existing solution. So I have been trying to implement the...
I have implemented in matlab a neural network that uses rprop's algorithm to update its weights. Strangely the error on the training set does not converge to a local minimum, but oscillates. Here is the graphics plot of the error function on trainingset: Here is the rprop's algorithm: function [net] = resilientBackPro...
I have a simple question that is really hard to Google (besides the canonical What Every Computer Scientist Should Know About Floating-Point Arithmetic paper). When should functions such as log1p or expm1 be used instead of log and exp? When should they not be used? How do different implementations of those functions d...
I have implemented in matlab a neural network that uses rprop's algorithm to update its weights. Strangely the error on the training set does not converge to a local minimum, but oscillates. Here is the graphics plot of the error function on trainingset: Here is the rprop's algorithm: function [net] = resilientBackPro...
Is the projection method of integrating Navier-Stokes equations exact? Take the incompressible flow equations: $$ \frac{\partial\mathbf{u}}{\partial t} = -\mathbf{u}\cdot \nabla \mathbf{u} -\nabla p + \mu \Delta \mathbf{u} \\ \nabla\cdot\mathbf{u} = 0 $$ along with some meaningful boundary conditions. Using a projecti...
I have to do some numerical calculus using gamma functions. I am using the tgamma incluided in the C++ cmath library. The problem is that the arguments inside the gamma functions are positive and big, so I always get a nan. I know that I can use a log-gamma function, lgamma in C++, to avoid numerical overflow during th...
I am a newbie in DFT calculations. I did potential energy scans with GAUSSIAN 09 for different dimers, i.e. # b3lyp/6-31G(d) scan test title 0 1 Ni 0.0 0.0 0.0 Ni 0.0 0.0 r r 20.0 19 -1.0 Unexpectedly, the energy at large distances does not converges to zero, but some finite negative value. ...
What type of numerical methods are there to solve PDE of the sorts of: $$\begin{align} &f(x,t,u(x,t))u_{xx} - g(x,t,u(x,t))u_{tt} = F(x,t,u(x,t))\\ &u(x,0)=G_1(x)\\ &\frac{\partial u(x,0)}{\partial t}=H_1(x)\\ &u(0,t)=G_2(t) , \frac{\partial u(0,t)}{\partial x} = H_2(t) \end{align}$$ Where $f,\ g,\ F,\ u \in C^\infty...
Background: I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for spatial discretizations and time discretizations. I have also taken more symbol-manipulation coursework applied to NS. Som...
I have come across the paper titled: A monolithic fluid structure interaction algorithm ... For a 1D grid, at the boundaries the paper uses virtual nodes $x_{0}$ and $x_{N+1}$ (page 372) and for instance for velocity v at the boundaries ends up via extrapolation with (page 374) $x_{0} = 2 x_{1}-x_{2}$ and $x_{N+1} = ...
I try to write tests to the implementations of numerical methods. The best way to do this is to study the observed order of accuracy and check that it matches with the theoretical order of accuracy. However, I noticed that the observed order of accuracy lies in a band $$ [p_{\mathrm{theor}} - \Delta, p_{\mathrm{theor}}...
I'm currently attempting to turn my code for solving the laplace equation using finite element approximations into an adaptive one using the dual weighted residual as my error estimator: i.e. my indicator for element i: $η_i=(f[i]−∑_0^N A_{ij}U_h[j])∗z[i]$. i.e. I set up f, A and z over a very fine mesh and solve U_h o...
As I am new to all these stuff I would like to verify whether my procedure is correct. I need to calculate the Lennard-Jones potential, potential energy of the system and the forces. The procedure is as follows: 1) Read the input data: side lenght of the square -a, number of particles -N, the parameters $\sigma$, $\e...
Lots of algorithms for semidefinite programming make use of the Frobenius projection onto the cone of semidefinite matrices: $$\mathcal{P}(A) = \min_{X\succeq0} \|A-X\|_{\mathrm{Fro}}^2.$$ Let's assume $A$ is symmetric. The standard trick for this projection is to compute the eigendecomposition of $A$ as $A=X\Lambda X^...
would someone be so kind as to explain me the difference between the ordinary givens-rotation and the fast givens-rotation? I know that the fast givens Rotation reduces the Count of operations to approximately the half. How is this possible? Thanks in advance for any hints :-)
I want to implement an implicit ODE solver, but don't know what to do when the differential equations (DEs) have discontinuities of the form: More common type: $$\lim_{x\rightarrow 0}\frac{\sin(x)}{x} \enspace .$$ Less common, as it occurs in only one DE $$\min(\alpha x, \beta) \enspace .$$ I am trying to implement t...
I have the function $f(x) = \begin{cases} 0 \:\: (x < a) \\ 1/2 \:\: (x = a)\\ 1 \:\: (x > a) \end{cases}$, where $a$ is unknown. I can compute the function for any value of $x$, and seek to determine $a$ (to some degree of accuracy). Given an initial bracket $x_{0} < a < x_{1}$, I subdivide the bracket by defining ...
I want to solve the following differential equation using control volume approach on a Cartesian mesh: $$\frac{\partial T}{\partial t} + \frac{\partial T}{\partial x} + \frac{\partial T}{\partial y}= \lambda[\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2}]$$ Probably, there would be no harm in wri...
Given a 2D stochastic differential equation: \begin{align} \dot{x}_{i}=f_{i}(\textbf{x})+g_{ij}\xi_{j}(t), \end{align} where $i=2$, $g_{ij}g_{jk}=2\epsilon\delta_{ik}$ and $f(\textbf{x})=-\nabla\phi(\textbf{x})+l(\textbf{x})$ with $\nabla\phi(\textbf{x})\cdot l(\textbf{x})=0$, we have its action functional for trajecto...
I have a question on the use of moving mesh to solve the inviscid euler equations. I have solved the following equations: $$\frac{\partial}{\partial t}\left[\begin{array}{c} \rho\\ \rho u \end{array}\right]=\frac{\partial}{\partial x}\left[\begin{array}{c} \rho(u-w)\\ \rho u(u-w)+p \end{array}\right],$$ where p is a l...
I'm new to the modelling of inviscid euler equations. I have come across few different upwind schemes that are used instead of central differencing schemes to model such flows, such as flux vector splitting and Godunov. My question is, do I definitely need to know the eigenvectors/eigenvalues of the system if I need to...
I urgently need help with a problem I am having for an assignment for university. I do not expect a full solution, but I am really in need of guidance. I am required to write a FEA program in VBA, I have managed to do that. However, I am having problems when trying to find the inverse transformation of isoparametric q...
I'm implementing a finite-difference WENO scheme for a simple advection equation $$ \frac{\partial u}{\partial t} + \frac{\partial u}{\partial x} = 0 $$ with periodic boundary conditions. I'm not quite sure my scheme is conventional since it is mixing ideas from finite-difference and finite-volume methods in the follo...
I am trying to solve two non-linear equations self-consistently in a Gummel loop. Sometimes (every once in a while), I get to a situation when the loop repeats itself with wrong solutions and a certain error persists. As a simple example, consider the following two equations: \begin{align} &y = -x + 1 \\ &y = \sqrt{x} ...
I Need to to solve an generalized Eigenvalue Problem and to compare two Methods (QR and QZ) concerning their convergence rate and execution time. I started with the Basic QR-Algorithm, implemented in Matlab, tested the results and in the last step i included double-shifts and Deflation strategies. Now it is time to imp...
I am having problems with solving a hyperbolic wave problem with Dirichlet BCs. I have tried reducing the time step sizes, which does not affect the results, and notices increasing the number of nodes makes the results worse. I have concluded the problem is with the boundary or certainly spatial. My code is 1D, and the...
I'm writing up a code to calculate the local energy for electrons in hydrogen like ions for a given wavefunction. My code is giving me weird results, which leads me to believe something is wrong. Firstly, am I going about accepting/rejecting moves the right way? And am I doing anything weird in the accumulation phase w...
I need to compute some integrals numerically. The integrand is this: $$f(x,y) = \left ( \sum_{mn=-j}^{j}A(m,n)\dfrac{\tan^{2j+m+n}(x/2)}{(1+\tan^2(x/2))^{2j}}e^{iy(n-m)} \right )^{N}$$ Note: sums are finite. And I have to compute $$\int_0^\pi \int_0^{2\pi}f(x,y)dydx$$ I have to do this for different values of $N$. I wa...
I have an absolute value optimisation problem $$\min_x \sum |r-Cx|$$ where $x$ is small around 200 dimension. But $C$ has lots of rows, $C_{30000\times200}$ and $r$ is $30000\times1$. So this will introduce large number of help variables for the absolute value. Could someone recommend a package in Python that can solve...
Given variables $a_1$, $b_1$, $c_1$ and $a_2$, $b_2$, $c_2$ representing the vertices of two plane triangles, how might one specify the requirement for the two triangles to intersect as an objective in a mathematical programming solver such as CPLEX?
Are upwind schemes such as Godunov type methods superior to central differencing schemes? Do the reasons include superiority in modelling hyperbolic problems with Dirichlet BC's?
I want to create a stairs plot with solid horizontal lines and dashed vertical lines. You can see an example of what I am trying to do in this question (scroll down a little bit). In the example, however, they use Python, but I want to do this in MATLAB. My (simple) code is k=-4:1:4; a= (2*k +1)/2; t=-4:0.1:4; figure(...
I would like to optimize a function of the following form: \begin{equation} \sum_{i,j=1}^N c_{i,j} \mathbf{x}_i \cdot \mathbf{x}_j, \end{equation} where $\mathbf{x}_i \in \mathbf{R}^d$. Is it possible to state this as SDP? I guess that an SDP variable would be somehow related to the Gramian $G$ of the vectors $\{\mathb...
I am using Fourier series to find the analytical solution to the 2D heat equation. The problem is that the integrals which are used to calculate the coefficients of the series cannot be solved analytically. I am currently using GSL's Monte Carlo integration to compute them an this introduces error to the series. My qu...
I am looking for an efficient algorithm to calculate the surface area of an irregular N-dimensional polytope. I have a description of this polytope both as coordinates of the vertices as as linear inequalities.
I'm having difficulty understanding how to apply Newton iteration to nonlinear PDEs and then use a fully implicit scheme to time step. For example, I want to solve Burgers equation $$u_{t} + u u_{x} - u_{xx} = 0$$ So discretising time using a Backward Euler $$u_{t} = \frac{u^{n+1} - u^{n}}{h}$$ we find that \begin{alig...
I'm interested in how much 'signal' is retained from including k singular values in a Singular Value Decomposition, but I'm having trouble conceptualizing (or creating) a metric for 'signal retention'. I can create $A_i$, a matrix which is created from the first $i$ singular values of $A$, but how do I compare $A_i$ wi...
I just read Chapter 3 in "A Multigrid Tutorial" by Briggs/Henson/McCormick, link. The text is about Multigrid cycles such as V-cycle, mu-cycle, FMG. What caught my eye: In most iterative procedures one checks whether it has converged to the desired tolerance/accuracy and if so, the procedure stops. But Briggs/Henson/M...
I'm trying to solve coupled PDE by Crank-Nicolson (CN) and Newton-Raphson method with MATLAB. I have used CN method but not for coupled problem. Please if someone could help let me know to add more details about the equation. Thanks in advance Detail of coupled equation: I’m going to solve Poisson-Nernst-Planck system ...
I am using my own Routine to calculate the Cholesky-Factorization of a complex, positive definite symmetric Matrix. My Code Looks like this: void CholeskyDecomposition(Complex **L, Complex **A, const int dim) { Complex sum, t; Complex sum1; for (int k = 0; k < dim; k++) { // First, calculate th...
I am solving a 1D advection problem of the the form $$d{Q}/dt = [A]{Q}$$ where {Q} is the vector of unknowns and [A] is the matrix of coefficients of spatial discretisation. I have worked out the eigenvalues of [A] to get an idea about the stability of the semi-discretised system and I am getting eigenvalues with posit...
I have a problem with assesing the accuracy of my numerical calculation. I have a 2nd order ODE. It is an eigenvalue problem of the form: $$ y'' + ay' + \lambda^2y = 0, $$ and the boundary condiations are: $$ y(0) = y(1) = 0. $$ This equation describes a vibrating string, clamped at x=0 and x=1, with a certain mass dis...
I am a bit of SAGE newb, so I apologize if this is a simplistic question. I want to use SAGE to compute some invariants of elliptic curves defined over rings which aren't the integers $\mathbb{Z}$ or the rationals $\mathbb{Q}$. More specifically, I am interested looking at elliptic curves defined over the ring $$ \ma...
This answer to this question works only for situations in which the desired solution to the coupled functions is not restricted to a certain range. But what if, for example, we wanted a solution such that 0 < x < 10 and 0 < y < 10? There are functions within scipy.optimize that find roots to a function within a given i...
I want to solve a pair of ODEs using the FEM solver of Abaqus. Is it possible for the user to supply the equation and ask Abaqus solver to solve the equations?
Whilst working with MATLAB recently I encountered something odd that I cannot explain. I was using the ode45 solver to solve a system of two coupled second order ODEs. I wasn't convinced about the results, so I tried something easier, just to see where it goes wrong. I uncoupled the equations and I swapped one of them ...
I designed an algorithm to find the global minimum of a function and implemented it in MATLAB. And I also implemented the "Tunneling algorithm" for the global minimum of a function in MATLAB. But now, I want an intelligent way to compare these two algorithms and see which one gets to the global minimum faster. Using th...
I have seen a lot of literature, lecture videos, etc. on solvers/preconditioners for non-symmetric and/or indefinite systems. However, now I want to solve the mixed poisson/Darcy equation using the least-squares finite element method: $$\int_\Omega\left(\boldsymbol{u}(\mathbf{x}) + \nabla p(\mathbf{x}) - \boldsymbol{g}...
I want to build a new desktop PC for MD simulations of relatively simple protein/carbohydrate systems using mainly GROMACS and Amber force field. No ab initio or QM-MM simulations are intended for now. For instance, I have been working with a protein of approximately 1500 atoms in the presence of small carbohydrates (<...
I am looking to find an algorithm/method by which I can detect regions of flow in a video. The video is that of a grayscale heatmap where the majority of the image is not in motion. The areas that are in motion generally appear as flickering/moving white dots, whereas in the rest of the image the dots do not move. The ...
I am looking for an algorithm with the following characteristics: It is used to generate the set of integer vectors $\mathbf k=(k_1,\ldots,k_m)$, where $k_i\leq K_i$, $k_i\geq 0$, and $K_i$ are given positive integers. That is, I am looking for the cartesian product of the sets $\{1,\ldots,K_i\}$. Call $k=k_1+\ldots+...
I want to solve a system of 7 coupled differential equations and 1 algebraic equation in MATLAB with the method of lines. I could do it for each independent equation with some assumptions, but I can't solve these 8 equation together. Can you help me?
I want to maximize an objective function using quasi-newton optimization method. But i couldn't find any function for maximizing a function. All inbuilt functions are for minimization. For eg. fminunc in matlab. How can i change my objective function to give it as an input to a minimization function, say fminunc and ge...
You have questions through out the course that are worth 2 (if you get it perfect), 1 or 0 marks. The professor only takes into account the top 80% of questions, for example 2/2, 2/2, 1/2, 1/2, 0/2 and only 2/2, 2/2, 1/2 would count towards your grade. You are given the number of 2's, 1's, 0's and the total amount of q...
I have an object with surface charge $\sigma$ for which I want to caclulate tangential electric field which would correspond to mathematical formulation: $$ \vec{E}(\vec{x}) = \nabla_x \int \frac{\sigma_y}{|\vec{x} - \vec{y}|} dS_y $$ where afterwards normal component $\vec{n} (\vec{E} \cdot \vec{n})$ is substracted. ...
I have solved a numerical problem using two different sets of non-linear governing equations. I want to get an understanding of the stability of the methods relative to each other. To do so, I solving the problem with each method whilst keeping the time stepping schemes, time step and mesh sizes the same. I then run th...
I am developing a finite element simulation and want to evaluate the errors in $H^1$ and $L_2$ norms. The problem is the classical Poisson equation, with Dirichlet B.C.: $$-\Delta u=f\mbox{ in }\Omega,$$ $$u=g_{D}\mbox{ on }\Gamma_{D}.$$ I am using Lagrange bilinear 2/3D elements in the Galerkin approach. The error es...
I have just started using dl_poly classic to work in Molecular Dynamics simulations. It produces a HISTORY file which records the trajectory after applying boundary conditions. Now, here I don't understand, how I am suppossed to calculate diffusivity using folded trajectories. Secondly is there a way in dl_poly to unfo...
My question concerns the following paper: A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier–Stokes Equations (http://www.sciencedirect.com/science/article/pii/S0021999198958909) It describes a second order accurate projection method to solve incompressible Navier Stokes equations....
I need to solve a diffusion equation in periodic boundary conditions using fipy but I would like to have a drift term that depends on the position so like this: $$ \partial_t u(x,t) = \partial_x^2 u(x,t) + \partial_x(\omega(x)u(x,t)). $$ I am new in fipy and I am able to solve diffusion with diffusion coefficient spati...