instruction
stringlengths
43
28.1k
I need to solve the following hyperbolic equation in x and phi co-ordinates $$\frac{\partial \left ( -s/f \right )}{\partial \varphi }+\frac{\partial \left ( 1/f \right )}{\partial x}=0$$ $$\varphi >0\rightarrow f=\left ( 1+\frac{\left ( 1-s \right )\left ( 1+0.4\varphi e^{-x} \right )}{10s} \right )^{-1} $$ $$\var...
What ODE solvers are optimized for solving stiff systems with sparse Jacobian? Such systems appear, for instance, when a parabolic PDE is discretized in space using typical finite difference or finite element methods.
So, lets say for the family of the explicit Runge-Kutta methods: $$y_{n+1} = y_n + \sum_{i=1}^s b_i k_i$$ where, $$k_1 = hf(t_n, y_n)$$ $$k_2 = hf(t_n+c_2h, y_n+a_{21}k_1)$$ $$\vdots$$ $$k_s = hf(t_n+c_sh, y_n+a_{s1}k_1+a_{s2}k_2+\cdots+a_{s,s-1}k_{s-1})$$ Is there any high-order Runge-Kutta scheme (preferably more tha...
Assume that we have the following equation and the following assumption. The scope is to solve for some particular variables expressed later. Update $$E_{t}\left[ b(A_{t+1})^{1-\gamma} *R_{t+1}^{-\gamma}*[r_k(A_{t+1},a)-r_h(A_{t+1})+\eta)] \right]=0$$ where $R=(1-\theta_1-\theta_2)*r^f + \theta_1*r_k(A,a)+\theta_2 *[r...
So my fellow numerical computational peeps it may be that I am suffering from sleep deprivation but I'm struggling to numerically compute a function $u \rightarrow h(u)$ defined implicitly as follows: $$ u^{h(u)} + u^{-h(u)} = a u $$ for some constant $u$. To be clear, that's just saying $u$ raised to $h(u)$ etc, and t...
Does anyone have any experience on Domain Decomposition using PETSc library? I have used PETSc for creating my vectors and matrix within my C++ code. I also used KSP to solve the linear system. I used following examples to learn about Domain Decomposition in PETSc but they were not helpful: http://www.mcs.anl.gov/petsc...
Does someone know a method to get cheap approximation of harmonic problems (and possibly local approximations)? Let me explain: I need to compute the solution of an harmonic problem \begin{equation} div(\alpha(x) \nabla u) = 0, \quad x \in \Omega \\ u(x) = x,\quad x \in \partial \Omega\end{equation} on a very fine mes...
I want to maximize the sum of Rayleigh quotients: $$\max_x\sum_{i=1}^n\frac{x^\top A_i x}{x^\top B_i x}$$ where $A_i$ and $B_i$ is positive definite. I've found a similar question here: minimization problem: sum of Rayleigh quotients. But it only deals with the case $n=2$, and therefore it seems that the methods there ...
Goal: I need to evaluate numerically an integral of the following form: $$ \int_0^\infty \frac{dx}{(a^2+x)\sqrt{(a^2+x)(b^2+x)(c^2+x)}} $$ where $a,b,c \in \mathbb{R}$ are in the interval $(1,1000)$. This needs to be done in Python. Problem: The integration algorithm does not converge, but I know the integral is conve...
I am modifying a conservative form of the Euler equations with gravity in the energy flux (see previous question: Energy Conservation in Conservation Laws with Source Terms) for use in a Riemann solver. I'm seeing some unphysical/unstable results despite total energy conservation to roundoff. The conservation law equa...
I understand some basic analysis techniques (local truncation error, global error, zero-stable, absolute stable, etc.) of numerical integration. But I find it hard to apply these techniques in practice. In my case (a hair/cloth simulation for computer games), I usually do a numerical integration step followed by constr...
I want to minimize $f(x) = \mathrm{Tr}(\sqrt{\mathbf{X}^{T}\mathbf{X}}\mathbf{A})$, where $\mathbf{X}$ is an matrix variable of dimension $d \times d$, and $\mathbf{A}$ is a known matrix. I tried the following code: cvx_begin variable x(d,d) minimize(trace(sqrt(sum_square_abs(x))*A)) subject to x(s...
I've been taught that when simulating a biomolecule in thermal equilibrium, it's best to use the Langevin thermostat - an algorithm which produces a trajectory, which is a realization of a stochastic process given by the Langevin (stochastic differential) equation. I haven't had a doubt about this algorithm's power to ...
I have two algebraic equations I am trying to solve in Maple. They are: $14\,{a}^{26}{b}^{2}-91\,{a}^{24}{b}^{4}-364\,{a}^{22}{b}^{6}-1001\,{a} ^{20}{b}^{8}-2002\,{a}^{18}{b}^{10}-3003\,{a}^{16}{b}^{12}-3432\,{a}^{ 14}{b}^{14}-3003\,{a}^{12}{b}^{16}-2002\,{a}^{10}{b}^{18}-1001\,{a}^{8 }{b}^{20}-364\,{a}^{6}{b}^{22}-91\...
I have implemented a version of Visscher's method for numerically solving the TDSE (A fast explicit algorithm for the time-dependent Schrödinger equation) (also described in Are there simple ways to numerically solve the time-dependent Schödinger equation? ). $$R(t+\frac{1}{2} \Delta t)=R(t-\frac{1}{2} \Delta t)+\Delta...
I'm trying verify that a 2nd order finite difference in space and time approximation of the 1D wave equation is really 2nd order. My Matlab implementation tells me otherwise - I'm not sure of what I've done incorrectly. For simplicity I've decided to use the smooth solution $u(x,t)=\cos{(ct)}\cos{x}$. The PDE has per...
I am trying to find a good reference on a proper weak formulation for mixed DG (Raviart Thomas and DG) formulation for a Poisson equation with mixed boundary conditions. Can anyone suggest a good reference? Since what follows is lengthy, I am happy to offer a modicum of recompense (of your choice) for good answers. Bas...
I used Gurobi with a MIQP with 26 binary variables and 26*4 interaction term without any other constraint. The speed is very slow already.... I want to ask what is the state of art of MIQP solvers. Generally how many variable can it handle or do we need to manually input linearization techniques to enhance the speed. t...
In combinatorial optimization, there are many problems that can be formulated as either Network Flow model or Mixed Integer Programming (MIP), e.g. supply chains, transportation, and graph-base problems. Some solvers make use of logical and/or graph-base syntax to efficiently solve network problems. And then the Networ...
I'm trying to plot this function func=exp(x-sqrt(2))-cos(x-sqrt(2))-(x-sqrt(2)) in Matlab using 101 evenly spaced x values. If I just say fplot(fun, [-1 3], 'o') the graph is the correct shape but the actual values of the points are determined by Matlab to give the best shape of the graph. I want to tell it exactl...
Sometimes it is meaningful to remove the influence of some old data from a SVD-based model, so as to reflect the most updated trends and provide more accurate results. I've seen there're incremental SVD approaches adding new data, e.g, a simple one is called folding-in. I am wondering is there any inverse operations wh...
My 2D-Poisson solver is build for simulation of semiconductor. The algorithm is Gauss-Seidel iterative method. If I use simple PN junction for simulation testing, it diverged while I applied high voltage on electrode. But it is fine while there is no applied voltage or very low voltage applied on electrodes. The follow...
I would like to get the result of Fresnel-Kirchhoff integral in paraxial approximation to the cylindrical diffracted wave and here is a part of my code and if it is solved gonna be carrying the other parts out. It is a Matlab code. vpa(int(exp(-1i*2*k*(n_cl-n_s)*sqrt(b^2-x_p^2))*exp(1i*k*((x-x_p)^2)/2z),-b,-a)) with ...
I use B-spline curve fitting to obtain one smooth curve. If I obtain two smooth B-spline , how can I connect then smoothly. For example, I have 59 points((x0,y0,z0),...,(x58, y58, z58)) and I have two fitted B spline. One B-spline is for the first 30 points, another is for the next 30 points and the two point set share...
I have a a function $f(k)$ (calculated in Maple) which is huge and stored in a variable called 'sum' on my drive (with the help of 'save' command in Maple). Since the function is huge, Maple is unable to plot it and is taking endless time. Thus, I want to read the variable 'sum' into Matlab and plot it. I am unable to ...
I have a lengthy expression which is calculated using symbolic differentiation of a rather complicated function. I now intend to call this resulting (symbolic function) in a for loop many times, and so I would like to avoid having to perform the symbolic differentiation step every single iteration, rather I would like ...
I am trying to find the minimum of the so called Beale’s function given by $f(x_1,x_2) = (1.5-x_1+x_1x_2)^2 + (2.25-x_1+x_1x_2^2)^2 + (2.625-x_1+x_1x_2^3)^2$ Using Newton iteration $x^{(k+1)} = x^{(k)} - \alpha^{(k)} \eta^{(k)} $ with $ \eta^{(k)} = \left( \frac{\partial ^2f}{\partial x^2}(x^{(k)}) \right)^{-1}\frac{\...
I have been working on a particularly challenging problem and was hoping for some guidance. Here is my problem. I have a point cloud containing millions of points. For each point in the set, I need to determine whether there exists an enclosing circle of radius r that can be drawn around the point (the point can lie an...
I am trying to develop a library for finite element methods in C++ and for that I am looking at the data structures for meshes. Based on what I've read up on fenics and deal.ii, the general understanding seems to be that a basic mesh class should have the following members: Cells, Faces, vertices. Connectivity relat...
If we optimize some parameter using 4 optimization algorithms, 2 of which are population based (say A and B) and 2 trajectory methods (single point search)(say C and D); what statistical test can be used for comparing 4 of these. The initial population of A and B is the same, so is for C and D. However, population size...
Consider the polynomial $$ p(x) = -514-462 x+359 x^2+1129 x^3+165 x^4+490 x^5-418 x^6+497 x^7-227 x^8+60 x^9-10 x^{10}, $$ whose root $A\approx 3.14$ is very close to $\pi$: $$|A-\pi|=2.0746\times 10^{-33}.$$ Let's say I am given as input the eleven integer coefficients above, and nothing else. Is there a way to do ca...
I'm working on my thesis and a part of it has to do with adaptive mesh refinement. As a computer science major, I'm not too familiar with this field. The best way I can put my knowledge of AMR is: I understand the purpose and programming part, but I don't understand what it is. Sorry, I'm having difficulty wording it c...
I read the whole list of this question: Where can one obtain good data sets/test problems for testing algorithms/routines? But the answers are in different areas and I want to ask a specific area. I am looking for resting problems for wave equation, telegraph equation or Klein-Gordon equation, etc. What they have in co...
I want to maximise the score of the following table, choosing one item from each column/row, so no two items are on the same row or column. Score to maximise is just adding all the choices together. $$*\quad A\quad B\quad C\quad D\quad E$$ $$\alpha\quad 16\quad 16\quad 18\quad 18\quad 18$$ $$\beta\quad 20\quad 18\quad ...
can any one recommend numerical solver (c/c++ library preferred) for stochastic optimal control problems? For deterministic optimal control I found something like that: http://abs-5.me.washington.edu/ocp/index.html Now looking for something similar for stochastic OCP.
Bathe's Finite Element Procedures shows the "nonlinear strain stiffness matrix" for a 2D truss element as $$ \frac {^tP} {L_0 + \Delta L} \left[ \begin{array}{ccc} 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \\ -1 & 0 & 1 & 0 \\ 0 & -1 & 0 & 1 \\ \end{array} \right] $$ But other sources, such as this http://people.duke.edu/~hpga...
I have come across (state of the art) softwares on MAX-SAT PBO or WBO: examples are WBO, open-WBO, SAT4J, scip. They all seem to work in a way that only command line instruction is involved. I want to construct a C++ programme that involves solving some PBO system (equivalently MAX-SAT or WBO) then do a huge bunch of o...
I'm new with FEniCS and Python and I'm stuck with this issue: is there a way to write a 4th order tensor in an easy way to implement? I have to compute the following stiffnes tensor: $A_{ijkl}= \lambda \delta_{ij}\delta_{kl} + \mu (\delta_{ik}\delta_{jl} + \delta_{il}\delta_{jk})$
I am working with the simple example of an oscillator: $$(1) \; \; \ddot{u} + u = 0, \; \; u(0) = u_0$$ I know that Forward Euler does not preserve an invariant of the above system: $$(2) \; \; \dot{u}^2 + u^2 = 1$$ I can get the eigenvalues of a matrix that approximately solves for the solution of $(1)$ using Forward ...
I have been working on a multigrid solution to a non-homogeneous Dirichlet boundary value problem. However, the function goes to infinity on the boundary. This causes numerical overflow errors to be raised in calculating the discretized derivatives. Does anyone have a suggestion on how to overcome this problem? I a...
I'm trying to find some finite temperature properties using ab-initio simulations; and for this, I'm looking for a tool to be used as an auxiliary to DFT simulations (in VASP) to implement Quasiharmonic approximation (QHA). I'm facing some problems using Phonopy, so, could anyone tell me what's a popular package for QH...
Most methods for oscillatory integrals I know about deal with integrals of the form $$ \int f(x)e^{i\omega x}\,dx $$ where $\omega$ is large. If I have an integral of the form $$ \int f(x)g_1(x)\cdots g_n(x)\,dx, $$ where $g_k$ are oscillatory functions whose roots are only known approximately, but some kind of asympto...
What is the best MAX-SAT solver problems for Ising spin glass? I tried Scip-Max-sat and open-wbo. While open-wbo cannot solve the instance with only 27 variable Scip-max-Sat fail to solve the one with 200+ variables (while it can solve model with 100 variables in 30 secs).... I am not sure whether I have missed somethi...
recently, I try to write a Matlab codes to implement a sparse approximation inverse factorization method proposed by M. Benzi in his paper http://www.mathcs.emory.edu/~benzi/Web_papers/ainv.pdf this codes to generate the incomplete factorization as $A^{-1} = ZD^{-1}W$ or $A^{-1} = \hat{Z}W$. I had written the followin...
I have a vector containing acceleration measurements and the corresponding vector of times in which measurements are taken. To obtain velocity and displacement I used the cumtrapz() function already implemented in MATLAB. This should be fine, as I read here Numerical integration of non-uniform acceleration samples and ...
I am studying fluid-structure interaction across integrated circuits packaging by using Ansys Fluent (I'm a beginner). Currently I had an issue about the time step size. When I set time step size of 1 s it takes about more than 100 s for a complete fluid flow. While for time steps of 0.1 s and 0.01 s takes about 50 s a...
I tried to plot a surface in MATLAB but, since it is the first time I had to do something like this, I need a confirmation on the process I followed because it is important for my project to plot the right surface. I have 3 vectors obtained from measurement data: $x$ (displacement), $v$ (velocity) and $p$ (force). The ...
today, I encountered a confused problem by accident, but I have no ideas to deal with it fully. The question can be described as follows: for example, when we need to use FDM/FEM to discrete the partial differential operator with variable coefficients, $\mathcal{L} = d_1(x,y)\frac{\partial^2 u(x,y)}{\partial x^2} + d_...
I have an equation: $\ddot{x}+(\delta+\epsilon\cos{t})x=0$ known as the Mathieu equation.The $\delta-\epsilon$ parameter space of this equation looks something like The red lines in this diagram indicate that if a point on the red lines is chosen, and the corresponding value of $(\delta,\epsilon)$ is plugged into th...
The Fast Iterative Method is a way of solving the Eikonal Equation on a discrete grid, similar to the Fast Marching Method discussed in another question here. The paper describes the overall algorithm, as well as providing a method for solving the quadratic, as follows: SolveQuadratic(a, b, c, f) Returns the value $u ...
I'm writing a mod for a game that models orbital physics (Kerbal Space Program, or KSP). I'm attempting to model the effects of thrust on spacecraft in certain states where the game only models them as a Keplerian orbit (The ship is 'on rails'), and I'm having some difficulty with numerical stability - even if I don't ...
Say we have $x_i, \ldots, x_n \in R ^ D$ with positive, real components and use Jaccard distance $d(x_i, x_j) = 1 - \frac{\sum_{d = 1}^D\min(x_i^d, x_j^d)}{\sum_{d = 1}^D\max(x_i^d, x_j^d)}$ to find $k$ nearest neighbors for every point. I wonder, is it possible to get exact solution (all $k$ neighbors are found) witho...
I've been reading a lot of papers on ADMM lately, and also tried to solve several problems using it, in all of which it was very effective. In contrast to other optimization methods, I can't get a good intuition as to how and why this method is so effective (of course, I've seen convergence analysis for a few cases, bu...
Are there any instances of scientific numerical problems where the choice of rounding mode matters? There are usually a number of different rounding modes available: to $0$, away from $0$, to $\pm\infty$, nearest ties to even, nearest ties down. Apart from various currency-manipulation problems where rounding is mandat...
I'm wondering if it's possible to create functional intensity plots in matlab. Examples of what I'm looking for are below found in this paper: These figures were (guessing) probably made in R, but is this possible for matlab? I can't seem to find anything related to intensity besides an image intensity plot. THanks
I want to write a code that generates a function I(t) that satisfies the following condition: $\frac{\big<I(t)^2\big>}{\big<I(t)\big>^2} > 2$ In other words, $\frac{\lim_{T \to \infty}\int_0^T I(t)^2dt}{(\lim_{T \to \infty}\int_0^T I(t)dt)^2} > 2$ Is it even possible to do that? If not, please tell me what am I mis...
The simplest way to add 8 numbers would be something like this, sum = one + two + three + four + five + six + seven + eight; This (in C) would add one and two, and add the result to three and do the same till eight. Instructions for adding three,four and so on till eight will have wait the first instruction to complet...
I have the following problem: \begin{align} \frac{\partial w}{\partial t} = \frac{1}{r^2} \frac{\partial}{\partial r}\left( r^2 D_1 \frac{\partial w}{\partial r} \right) \\ \\ \frac{dr_d}{dt} = C_1\frac{\left(C_2 + C_3 \left( \frac{r_d}{r_{d,0}}\right)^{0.5} \right) D_1}{2r_d} \end{align} Where \begin{align} D_1 &= A...
I am concerned with numerical solution to the following problem on $[0,1]\times[0,1]$. $\dfrac{\partial\theta}{\partial t}+u(x,t).\nabla \theta(x,t)=\kappa \nabla^2\theta(t,x)$ with Dirichlet boundary condition $\theta(t,x)=0$ on the boundary of rectangle. My question in general situation, and in particular for the pro...
I have a set of paths between two fixed points (marked in red below). Each of these paths consists of an ordered series of $\{x, y\}$ points (marked in blue). I am trying to find the ordered set of points which comprise the boundary of these paths. This boundary is shown in gray. Note that this boundary would contain ...
In Gram-Schmidt process, is it better to do normalization after orthogonalization of all the vectors in a basis, or to normalize each new vector immediately after it is created, from computational point of view?
I've been looking at the book "Computational Fluid Dynamics - The Basics With Applications", by John D. Anderson, and his solution for the one-dimensional subsonic-supersonic nozzle flow using the MacCormack scheme. I was wondering if there are any book chapters or academic papers out there explaining, in the level of ...
I have found that MATLAB solves 1D parabolic-elliptic system incorrectly by using pdepe function. Here is a system: $$ u_t = u_{xx} + 2, $$ $$ 0 = v_{xx} + u. $$ Boundary conditions: $$ (-u_x+u)|_{x=0} = 2t, \;\; (u_x+u)|_{x=1} = 2t, $$ $$ (-v_x+v)|_{x=0} = 0, \;\; (v_x+v)|_{x=1} = 0. $$ Initial conditions: $$ u|_{t=0}...
Question: Consider the iterative improvement algorithm below. Starting with $Az_i = r_i$ and $(A + E)\hat{z}_i = r_i$ derive a formula showing how the absolute error in the $(i + 1)^{st}$ iterate $\Vert\hat{x}_{i+1} - x\Vert$ is bound by a multiple of the absolute error in the $i$-th iterate $\Vert\hat{x}_{i} - x\Vert...
The B-spline basis function is given by one recursive formula. However,I hope to obtain popular expression: a0x^n + a1x^(n-1) + ... + an. From the answer How to build a recursive spline function in C++, it seems that Piegl's algorithm can do that. Can anyone give more information about the algorithm?
In Matlab Tensor Toolbox there is a tensor type called "Kruskal tensors", I found its form is similar to the CP decomposition. Wikipedia mentioned: "As such, many of the methods have been independently invented several times, often with subtle variations, leading to a confusing literature. Abstract and general mat...
Imagine you are given 20 random numbers in a row. The original order must be maintained. From this set you can choose 2 groups of 3 numbers each. The position of these groups must be separated by at least 4 numbers. The goal is to maximise the sum of values in both groups. How can you ensure that optimal groups are tak...
I wish to study the 2D heat transfer of the soda can using Fluent. For my geometry I took a circle. My problem while meshing the circle; Because i need to mesh it from inside. I used the mapped faced meshing then I used the edge sizing for the edge of the circle with no bias and then I sized the line that I create. [I...
I am trying to derive the correct variational form for the Poisson equation with pure Neumann boundary conditions, and an additional contraint $\int_{\Omega} u \, {\rm d} x = 0$, as described in this link. As I understand it, the problem can be defined as: Find $(u, c) \in V \times \mathbb{R}$ such that $F(u, c) = \fr...
How do I plot a flow diagram (given certain initial conditions, the trajectory in y-x space) for a RG (renormalization group) flow given by the following recursion relations? \begin{eqnarray} x^{\prime}&=&\frac{x(1+y)^2}{(x+y)(1+xy)} \\ y^{\prime}&=&\frac{y(x+y)}{1+xy} \\ \end{eqnarray} I have explored several option...
I want to pass additional parameters to the ode45 function in MATLAB. There are many questions already on this, but I also have a 'flag' argument in my function. function [xdot,isterminal,dircn]=spp(t,x,flag,f) Usually, while calling ode45, something like this would work if spp did not have a flag argument. options=od...
I need to fit a curve, obtained from experimental data, with a piecewise linear model (4 knots and therefore 3 lines). I tried using the MATLAB function coeff = lsqnonlin(@fun,X0,[],[],[],x,y); where $fun$ is a function defined as: [f] = fun (X,x,y) A = X(1); . . . F = X(6); if x(i) <= kn1 f(i) = A+B*x(i)-y(i);...
I was just implementing the upwind scheme for a linear transport equation $u_t + cu_x = 0$ where $c=0.5$ and I saw that the solution was indeed advected but over time it starts to diffuse. Can anyone provide some references to understand where does it comes from?
Consider Euler equation of gas dynamics in polar coordinates as $$ \left( \begin{array}{ccc} \rho \\ \rho u_{r} \\ \rho u_{\theta} \\ E \end{array} \right)_{t} + \frac{1}{r} \left( \begin{array}{ccc} r \rho u_{r} \\ r (\rho u_{r}u_{r} + p)\\ r \rho u_{r} u_{\theta}\\ r u_{r}(E + p)\end{array} \right)_{r} + \frac{1}{...
We know that principle component analysis (PCA) is a eigenvalue problem. Let $A$ be the covariance matrix of $X$, PCA aims to find the eigenvalue of $A$: $\max v'Av$, subject to $v'v=1$ Multiple PCs can be found by deflation: Let $\hat{X}=X-\sum_{i=1}^k v_iv_i'X$ (or equivalently $\hat{A}=(I-\sum_{i=1}^k v_iv_i')A(I-\...
I want to minimize $$W\, \text{tr}\left([A-Y_{pie}][A-Y_{pie}]^T\right) + \lambda\Vert A\Vert\, \enspace ,$$ however, I encounter the following problem: Disciplined convex programming error: Only scalar quadratic forms can be specified in CVX. Would you like to solve with this, please? Thank you! Ypie=T*Y; % Y is k...
I have a certain 2-D function. More properly, I have not the function itself, but the matrices $[X,Y,Z]$, where $X,Y$ are $1\times n$, and $Z$ is $n \times n$. Now, I want to calculate a a new matrix, $\hat Z$, whose value at each point is the average of $Z$-values from a small region around that point. In other words,...
Earlier it was considered that frozen coefficients method for Neumann stability analysis for finite difference scheme is more heuristic than rigorous. But I have read some information in a book by Gustafsson,Kreiss,Oliger that there are some conditions, which give us possibility to use frozen coefficients+Neumann analy...
I have a tree data structure (rooted, unbalanced, with unbounded branching factor), where each individual node has an associated 'weight'. For every node $n$ in the tree, I'd like to compute the cumulative weights of all the nodes in the subtree rooted at node $n$. For example, in the tree below I'd want to compute the...
The PETSC function VecSwap after a few layers of abstraction calls the BLAS primitive swap, which essentially copies data around (unless I am missing something). It seems to me that there should be a O(1) implementation that can be obtained just by exchanging pointers, at least if the vectors are identical in all thei...
I'm a Mechanical Engineering student interested in the field of aerospace engineering where, I'm told, Fortran is still commonly used. Which version of Fortran should I invest my time to learn?
I am trying to validate that the Schwartz-Christoffel mapping does indeed take the upper-half plane $\mathbb{H} = \{ z: \mathrm{Re}(z) > 0\}$ to a polygon. This involves integrals of functions of the type and computing at every point. $$ f(z) = \int_0^z \frac{dx}{\sqrt{(x-a)(x-b)}}$$ where $a < b \in \mathbb{R}$. I...
I was reading through this document about FVM. I understood all up to the point where we have on page 15 the following $$(\bar u^{n+1}_i - \bar u^n_i) \Delta x + \int^{t^{n+1}}_{t^n} f(u(x_{i+1/2},t))-f(u(x_{i-1/2},t)) dt = 0$$ How am I suppose to compute the integral from $t_n$ to $t_{n+1}$ of the flux?
I am new to numerical methods and I cannot think of a way to start solving the following problem. I know the mantissa, base and the boundaries are related when defining a number but I cannot really put it in together. The question is as follows and I need to know how these terms are related and how to approach a questi...
I am trying to write a simple finite volume method code but there are some concepts I'm still not really getting right (perhaps I'm overcomplicating things) Given a uniform grid, the idea is to approximate the solution by computing cell averages as $$\bar u(x_j,t^n) = \bar u_j^n = \frac{1}{h}\int^{x_{j+1/2}}_{x_{j-1/2}...
I'm analyzing experimental data, and I've produced graphs that look similar to the attached sketch. When I look at the graph, I see structure in the connections (connections tend to be local, there is one central collection of nodes and three branches). I'm wondering if anyone can point me toward areas of graph theory ...
I originally asked this question at StackOverflow, and was suggested to bring it here. I've seen this question about the representation of molecules in memory, and it makes sense to me (tl;dr represent it as a graph with atoms as nodes and bonds as edges). But now my question is this: how do we check and see if two mol...
I want to use it in Matlab or Java. Will these two languages be much slower for computing the algorithm compared to C, C++, in case efficiency is an important factor? I'm aware of that there's a PROPACK and SVDPACK, etc. Seems quite old. What are some popular choices? Are there any paralleled versions existing? If ther...
I want to compute a few tens of the smallest eigenvalues of a linear system which is a discretization of a linear elasticity. In the presence of additional constraints like Dirichlet boundary conditions, does it help to use the rigid body displacements to deflate the linear system? In that case they might only be appro...
I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible to establish if the system under study is linear or not by plotting a surface in the phase-space. To verify my code I ap...
The set-up is the following: We have $K$ finite sets of real numbers, i.e. sets $G_i, i=1 \dotsc, K$ and $|G_i| = n_i < \infty$. Furthermore, assume that we have a function $$ h: \mathbb R^K \to \mathbb R $$ which is monotonically increasing in each component. Similarly, there is another function $$g: \mathbb R^K \to ...
I need to sample from the generalized beta of the second kind (GB2) distribution (McDonald, 1984, Econometrica). Its PDF has the form $$ f_{a,b,p,q}(x) = \frac{|a|x^{ap-1}}{b^{ap}B(p,q)(1+(x/b)^a)^{p+q}}. $$ Its CDF does not have a closed form, so I cannot use an inverse transform method. Does anyone know how to sample...
In a recent SIAM News article, there is a long article describing a systematic organization of the finite elements, aptly dubbed the Periodic Table of Finite Elements. Its really quite fascinating to see how classification can be accomplished via finite element exterior calculus. As the authors indicate: Just as th...
I was checking the unity condition on a smoothing kernel for SPH, however I don't understand why the integral is not giving 1. The kernel function is $\displaystyle W(||\vec r||,h) = \frac{315}{64\pi h^8}(h^2-r^2)^3$ if $0 \leq ||\vec r|| \leq h$ I tried to approximate the integral with the following matlab code W = @(...
I recently stumbled upon interesting site that has interactive 3D representation of radial electron distribution (atomic orbital). here is the url: http://winter.group.shef.ac.uk/orbitron/AOs/1s/e-density-dots.html (java is needed) clicking on the "equations" or this link http://winter.group.shef.ac.uk/orbitron/AOs/1s/...
I am investigating a physical process where I believe the 1-D advection-diffusion equation: \begin{equation} \frac{\partial u}{\partial t} = -\frac{\partial}{\partial x}[\mu(x,t) u(x,t)] + \frac{\partial}{\partial x}[D(x,t)\frac{\partial}{\partial x}u(x,t)] \end{equation} may be applicable. I have a set of experimental...
I am trying to solve the Duffing's equation in MATLAB. $ m\ddot{y}+c\dot{y}+ky+k_{3}y^{3} = f(t) $ where $ f(t) = A \sin{\omega t}$ To do that I wrote a function to be given to the ode45. function [F] = ode_fun(t,y) F = zeros(size(y)); F(1) = y(2); F(2) = -k*y(1)-c*y(2)-k3*y(1)^3+A*sin(omega*t); end And then I call...
Is there any solver for convex optimization in C++ (or some dedicated scheme while no solver is yet available) that could solve a convex optimization problem with objective function value given by an oracle? Thank you. My specific problem is this: \[\mathop {\max }\limits_\lambda \mathop {\min }\limits_{\sigma \in {...
In going from double precision to quad (or higher) precision, roughly how much of a performance hit is taken on various architectures and frameworks. Do floating point operations take twice as much time? Ten times as much time? One hundred times as much time? What frameworks are currently available that support quad ...
I have a sparse matrix such as A = (1,1) 1 (3,1) 1 (1,2) 1 (2,2) 1 (1,3) 1 (3,3) 1 (4,3) 1 (4,4) 1 The full matrix of A can see look like as following: full(A) = 1 1 1 0 0 1 0 0 1 0 1 0 ...