instruction
stringlengths
43
28.1k
I'm doing research for academic credential on the use of metaheuristic optimisation of building envelopes/enclosures, focusing on the aspect of its thermal performance. The subject was handled with heavy emphasis on the integration of algorithm into the architectural design process by evaluating building thermal perfor...
I am trying to count the number of cache misses, total cycles, etc. per iteration of a for loop inside MatMult_SeqSBAIJ_2() . I've configured PETSc to use PAPI and I am using the PAPI API like shown in the skeletal code below. PAPI always fails (!PAPI_OK) while running ./main . Is there a setting in PAPI or PETSc that ...
I want to compute $a = \tan(f \theta)$ for $f\in [0,1]$, given $g = \tan\theta$. Obviously, I can compute $a = \tan(f\tan^{-1}g)$, but I'm wondering if there's a more efficient way that avoids having to evaluate two transcendental functions. I happen to also want the quantity $b = \tan[(1-f)\theta]$, and I believe the ...
I have a bunch of polygons and a coarse uniform grid. I want to implement two different range queries, for a rectangle aligned with the uniform grid: Does the rectangle intersect with any polygon at all? Give me all the polygons which intersect the rectangle. A simple data-structure would be to have for each cell a l...
Given an input parameters for the MARTINI force field such as: ;;;;;; HYDRATED CHLORIDE ION [moleculetype] ; molname nrexcl CL- 1 [atoms] ;id type resnr residu atom cgnr charge 1 Qa 1 ION CL- 1 -1.0 I wish to know which parameters go into which term in the equation. I'm afte...
Edit: I am trying to solve $$\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}=\nu\frac{\partial^{2}u}{\partial x^{2}}\\ u(0,t)=0\nonumber \\ u(1,t)=0\nonumber \\ u(x,0)=\sin(\pi x)\\ 0<x<1,\; t>0$$ I take $u_n(x,t)$ as an approximation to $u(x,t)$ $$u_{n}(x,t)=\sum_{n=-4}^{2^j-1}\phi_{n}(x)c_{n}(t),\quad j\...
When you have fine-scale features (e.g. boundary layers) in the solution, its FEM approximation on coarse meshes converge at strange apparent rates. Looking at Cea's lemma, is this behaviour because of: the best approximation error behaving strangely? or the constant changing with h? or should I actually look at Stran...
I want to use lanczos method to calculate the few lowest eigenvalue and eigen-vector of a large sparse symmetric matrix(~50k x ~50k). In http://www.netlib.org/lanczos/index.html I found the codes leval and levec are suitable for my situation. However, the instruction is too complicated to find how to use it and I don't...
Given a one-dimensional function (let's say infinitely differentiable) and a prescribed accuracy of an L2 (or H1) norm, what is the optimal mesh and (in general arbitrary) polynomial orders on each element so that the approximation has the least degrees of freedom? (For example if I have three elements, of orders $p_1=...
Could anybody please help with voro++ cause i am new to this software?My problem is how can i find the coordination number of an atom ,cause i checked it for a bcc lattice and it gave me 24 for all atoms which is correct cause the wigner-seitz polyhedron of bcc is a truncated octahedron with indeed 24 vertices. But wh...
I have a large, yet very sparse, matrix that I'd like to diagonalize. Both my own Lanczos implementation and the ARPACK that's built in with scipy fail to converge properly, though. I know that my Lanczos code itself is correct, and the ARPACK implementation should be correct too. One thing that I note about my matrix...
I have a need to get a variable value from another process rank of which I know. This happens in context of a parallel solver of a "A x = b" equation, for which process with rank 0 knows matrix A, and the other processes put some values (i,j) from this matrix into the matrix of a parallel solver data type (Petsc's Mat)...
I have the following Max Min optimization problem that appears to be non convex. link where t p c are my variables and all others are constants. I took the eigen values of the hermetian part of the hessian matrix of the 1st constraint(keeping all the constants as 1) and it comes out to be negative(hessian is indefinite...
Given $a\in\mathbb{R}^{mn\times n}$, find a $C\in\mathbb{R}^{n}$, $x\in\mathbb{R}^{m\times n}$ such that $$ 0 = f_{k}(\boldsymbol{C}, \boldsymbol{x}):=\sum_{i=1}^{m} C_{i} \left(\prod_{j=1}^{n} a_{kj}^{x_{i,j}} - 1\right) $$ for all $k\in\{1,\dots,mn\}$. (The rows of $a_{kj}$ are vectors of solutions to a system of dif...
I'm following Paul Constantine's Primer on Stochastic Galerkin Method, Section 3.1 (2D Poisson Example). In this matlab code, the example attempts to solve the PDE $$\alpha(w)(u_{xx}+u_{yy})=1 \text{ in } \Omega=[-1,1]^2$$ $$u=0 \text{ on } \partial\Omega$$ with $\alpha(w)$ a uniformly randomly distributed variable wh...
I'm looking at doing a finite-element simulation of air flow essentially for the purposes of approximating the response to an external audio impulse of a smallish (~10-30 cm scale), stationary 3D-printed structure containing a microphone. I'm mostly interested in the human-audible spectrum of 20-20000 Hz. The purpose i...
I have the following optimization problem and I am trying to check for its convexity. link As per the definition of convexity, "a continuous twice differentiable function is convex ON a convex set, iff the hessian is positive semi definite on the interior of the convex set." The feasible region where I am trying to che...
For example I have 2 matrices that can't fit in RAM. I need algorithm or library which can handle this.Preferably Matlab or Python. I think it can be some block matrix multiplication? Also I think there is an analogy hard drive<->ram, gpu ram<->cpu ram, cpu ram<->cpu cache, so we can take some cpu cache optimized techn...
I need to find the zero of a function $f(\lambda)$ which is of the form $\sum \frac{c_i^2}{(1+\lambda d_i)^2} -1 $. I tried using Newton's method, and it works sometimes, but it is highly dependent on the initial choice, and the chances of divergence are very high since the function is "almost" flat. What would be the ...
I would like to simulate a capacitor in 2d with freefem++. This is the code I used: int C0=0; int C1=1; int C2=2; border C01(t=0,4.25){x=t; y=0; label=C0;} border C02(t=0,2.25){x=4.25; y=t;label=C0;} border C03(t=4.25,0){x=t; y=2.25; label=C0;} border C04(t=2.25,0){x=0; y=t; label=C0;} border C11(t=0.25,0){x=1.75+t...
I have a function $f$ I'd like to determine numerically and I have a bunch of $(x, y)$ pairs which approximate the function in the following sense: all of the points satisfy $f(x) \leq y$, most of the points have $f(x) = y$ (at least to the accuracy I need), a few of the points have $y$ significantly bigger than $f(x)$...
What open source tool can be recommended for solving 2D instationary Navier Stokes equations (in simple geometries, but with high Reynolds numbers)? Most packages I found, I'm not very lucky with. OpenFOAM seems to be very powerful, but I think it would take some time to learn using it. FEniCS has a Navier Stokes demo,...
I am trying to reformulate the following problem to be solved efficiently (by MOSEK) $$ \min_{X} \text{Tr}(CX)+\lambda\sum_{i,j}|x_{i,j}| \\ \text{s.t.} \quad ||X||_F\le1 \quad \text{and} \quad X\ge 0 \text{,} $$ where Tr() is the trace, $C \in \mathcal{S}^{n\times n}$ a real symmetric matrix, $X \in \mathcal{S}_{+}^{n...
I'm currently working on my MS in CS and have developed an interest in astrophysics. Luckily one of my professors is a astrophysicist and is currently doing research through computational physics and he agreed to help me get started. I'm currently reading through Tao Pang's "An Introduction to Computational Physics" (T...
I'm writing prototypes for solving the Liouville Equations with Mathematica and C++. Perhaps the question about this may not be suited for this forum in a strict way, but it suits the people here because they're researchers who work with this kind of problems, I presume, and hope. So I'm looking for a model to store an...
I've seen that in Newton's method for interpolating polynomials, the coefficients can be found algorithmically using (in Python-ish): a = Y_DataPoints.copy() m = length(X_DataPoints) for k in range(1,m): a[k: m] = (a[k:m] - a[k-1]) / (X_Data[k:m] - X_Data[k-1]) But I don't really understand the model is subtr...
I am currently testing some new (embedded) processors for their double-precision numeric performance. The FPU capabilities vary wildly between platforms; For example, the ARM Cortex-A8 has a double precision FPU, takes 9 cycles per operation. The Cortex-A9 also takes 9 cycles, but is able to be fully pipelined, wherea...
I have a set of points P1(x1,y1), P2(x2,y2), P3(x3,y3), P4(x4,y4), P5(x5,y5) in the Cartesian plane. I am trying to find the closest point to P1 based on the orientation and Euclidean distance. What I mean is the following: Suppose that P3 is the closet to P1 and P5 is the second closest, but the angle between P1 and P...
Let $D = \left\{0, t_1, t_2, \ldots, t_n\right\} \times [0,1]$ and $$ f: D\to [0,1], $$ be a function of time and a one-dimensional space. There is no analytical formula for $f$, but $f(t_i, \cdot)$ is Lipschitz. The function $f$ can be computed with arbitrary precision at a finite number of points $\{x_{t_i, j}\}_{j...
I'm trying to apply the stochastic galerkin method to partial differential equation with multiple uniform random coefficients. I'm puzzled as to how to extend the corresponding orthogonal (legendre) polynomial basis into higher dimensions. Is there a systematic method for doing this? Is there is a paper/book that dis...
The Legendre polynomials satisfy $$\int_{-1}^{1}\phi_j(x)\phi_k(x)dx = \begin{cases} 0 &j\neq k\\\\ \dfrac{2}{2j+1} &j=k \end{cases}$$ Suppose that the best fit problem is given on the interval $[a,b]$. Show that with the transformation $t=\dfrac{1}{2}[(b-a)x+(a+b)]$ and a slight change of notation, we have $$\int_{a}^...
I was not quite sure what the right SE for this was, so I posted this also here on DSP. Please tell me which one to remove :) Problem statement I have a few hundred unrelated time series, say $P_i(t)$, with $i=1,2,...,N$. The sample times are all unequally spaced. It is known that during certain (unknown) intervals, th...
Let's start off by NUMERICALLY solving a 1-D steady-state heat transport problem using IMPLICIT FDM. $DT_{xx}=0; ~T(x=0)=T_{BL}; ~T(x=l)=T_{BR}$ where $D$ is diffusion; $T$ is temperature; subscript $ _{x}$ is the gradient with respective to spatial coordinate $x$. To implicitly solving the equation, we discretise as ...
For the function $f(x)=x$, how to compute the wavelet approximation using Haar basis? I'm new to wavelet, I'm looking for a package which will do something like this from mpmath import * mp.dps = 15; mp.pretty = True nb_coeff = 3 interval = [0, 10] fct = lambda x : x fourier_coef = fourier(fct, interval, nb_coeff) four...
Using the recursion formula for Chebyshev polynomials, show that $T_n(x)$ can be written as $$T_n(x)=2^{n-1}(x-x_1)(x-x_2)...(x-x_n)$$ where $x_i$ are the $n$ roots of $T_n$ The recurrence relation: $T_0(x)=1$,$T_1(x)=x$, and $T_{n+1}(x)=2xT_n(x)-T_{n-1}(x)$ I have an intuition that I need to use induction,but what i...
Many of the problems in Image processing are embaressingly parallel. But I want to know is it worth solving Image processing using parallel computing? Are there real practical problems in image processing that can benefit form parallel computing? If so what are those? I am not taking about mliticore CPUs, instead I am ...
Or can they just be used as an interpolation points and use some other "transported property" which are just evolved and propagated from boundary conditions like for eg. heat conduction through a solid metal bar. It seems to be possible, but isn't clearly elaborated. The force computation step is always used for fluid ...
I'm working on a heat diffusion problem, $$ \frac{\partial T}{\partial t}=\vec{\nabla}\cdot\left(\kappa T^{5/2}\,\vec{\nabla}T\right) $$ I know that, after discretization, the time step for the 1D case becomes, $$ dt= \frac{\rho\,dx^2}{\kappa T_{max}^{5/2}} $$ Does this imply/mean that the maximum wave speed is $$ \fra...
If you have a large multivariable ODE system, and certain processes occur at a much shorter time scale, how can you implement a solver that uses smaller time steps for state variables involved in fast processes, and large time steps for state variables involved in slow processes, while ensuring the result is still math...
generally, it is natural to use procedural programming approach (PP) to solve a partial differential equation by finite difference method (FDM). That is, one (1) defines matrices to store the properties at nodes and fluxes in between the nodes, (2) assembles linear systems based on discretization to the controlling equ...
Issue of data dependency with stencil code... How to parallelise this using openmp? I looked at the openmp manual, I figured out how to use DO ORDERED to get the same result as the serial version, but when run with openmp, it is x200 or so times slower. This is example code from the internet doing the update from neigh...
What is exactly the definition of "Straddle"? Can you please explain what do they mean exactly or a sketch? A segment P1P2 Straddles a line if point P1 lies on the one side of the line and point P2 lies on the other side. A boundary case of P1 or P2 lies directly on the line. (Taken from Introduction to algorithms 3rd)...
I have a system of 256 differential equations that I want to solve numerically. The system represents the Liouville equation, which is a first order, linear differential equation with complex numbers. What's the best method to solve this equation in parallel? Please advise. I'm a physicist, so I'm familiar with the bas...
How can we define the precision we require in a numerical differential equation solver? What is it that I have to optimize to know? And how do I know that I'm at a sufficient time-step value? For example, in those programs like Mathematica and Matlab, how does the differential equations solver know the suitable step si...
In general, is there a partial trace algorithm (ideally for systems of any size) that can be coded using basic matrix operations found in software like Mathematica or Maple? All of the methods I'm aware of seem to be suited for humans, and I am struggling to think of a way of implementing them in any programming langua...
This question interests me for a while. At one extreme, I found papers, and some thesis that were outcome of change of a single parameter in a CFD code, like in the case of "Atmospheric boundary layer" turbulence model, that was produced by a single change in $c_\mu$ constant of the $k-\epsilon$ model. On the other end...
I'm stuck on this PDE: $$\rho \cdot C \cdot \dfrac{\partial T}{\partial \tau} + u \cdot \rho \cdot C \cdot \dfrac{\partial T}{\partial r} = \dfrac{\lambda}{r^{2}} \cdot \dfrac{\partial}{\partial r}\left(r^{2} \cdot \dfrac{\partial T}{\partial r}\right) + K - \dfrac{\rho \cdot C \cdot T}{V} \cdot \dfrac{\partial V}{\par...
I have hjb equation where $V=V(x,t)$ and $u=u(x,t)$ $V_t + \sup(u) [A(x,u)V_x + B(x,u)V_{xx}]=0$ for $x$ in $[0,1]$ and $t$ in $[0,1]$ I have been able to successfuly resolve it numerically having theese boundary conditions: $V(0,t)=0$ all t in [0,1] $V(1,t)=1$ all t in [0,1] $V(x,1)=x$ all x in [0,1] I used finite dif...
I am trying to solve a set of couple ODEs: $V_l(r) - r W_l(r) - f1(r) W_l' = 0\tag 1$ $r^2 h''_l(r) + f2 r h_l'(r) + f3 h_l(r) - f4 U_l(r) = 0 \tag 2$ $\kappa (U_l + h_l) + V_{l+1} + W_{l+1} = 0\tag 3$ $\kappa (U_{l-2} + h_{l-2}) + f5V_l' + f6W_l' + f7 U'_{l-1} +f8U'_{l-2} = 0 \tag 4$ for $V_l,W_l,h_l,U_l$ and $\kap...
I have implemented Levinson algorithm for toeplitz matrix by book: Blahut "Fast algorithms for digital signal processing". Book said - modification of this algorithm for Hermitian matrices is simple job. But I could not do it. How I can modify this algorithm for Hermitian Toeplitz matrix?
In general, is there a partial trace algorithm (ideally for systems of any size) that can be coded using basic matrix operations found in software like Mathematica or Maple? All of the methods I'm aware of seem to be suited for humans, and I am struggling to think of a way of implementing them in any programming langua...
lets say I have a 5 dimensional grid where each dimension has 10 points. There are 100000 combinations. Let's say I want a subset of 10000, is there a deterministic algorithm that will choose a set of points that "covers" the region the best and converges to the limiting case of choosing every point? If I had a weighti...
Does Paraview or Visit have any filters to draw a smooth surface for a set of points?
The netlib BLAS implementation is an excellent reference, being mostly un-optimized and well documented (e.g. zgemm). However, it is in Fortran 77, making it somewhat inaccessible to those with a more modern programming education. Is there a reference-level implementation of BLAS, like netlib, in C/C++?
This is a peice of code written in Matlab: while flag==1 flag = 0; disp('end of loop'); end Surprisingly, this does not display the string. If I remove the disp statement a figure1 window appears. Can anyone explain why?
I want to do a simulation of sound waves including wave propagation, absorption, and reflection in 3D space. I did some research and I found this question in stackoverflow but it talks about electromagnetic waves not sound waves. I know I can reimplement the FDTD method for sound waves but how about the sources and doe...
Introduction: I have a vertical segment S That i want to move across a plane (Left --> Right), and find intersections with horizontal lines. Problem : The problem which i am having is the following: if the vertical segment intersects with multiple horizontal lines, as a result i'll get multiple intersections as you c...
What is a simple algorithm for computing the SVD of $2 \times 2$ matrices? Ideally, I'd like a numerically robust algorithm, but I'll like to see both simple and not-so-simple implementations. C code accepted. Any references to papers or code?
Have FETI-DP or BDDC methods been applied to alternative FEM discretizations - for example, least squares finite elements? My Google searching doesn't seem to yield many results, so I'm wondering if I've missed any field-specific papers. If not, is there a reason for this (beyond "lack of interest or funding")? Edit:...
This questions may be a bit off-topic in comp-sci. if it is needed please suggest where does it fit with. The question is regarding on how to manage all the simulation runs efficiently. let's say, for instance, a simulation requires fixing 2 parameters which has to be defined at a certain suggested value range. To fin...
I am trying to use the nonlinear fitting routines of MINPACK for fitting a rather complicated equation of state to a set of experimental data. A subset of the data is fitted fairly well to a simplified form of the EoS, which gives me some confidence that the implementation is, in principle, working. However, it seems t...
I am starting a self study course in computational fluid dynamics. I use ( An introduction to computational fluid dynamics : the finite volume method) I am learning Python programming language. The problem is that I cannot understand most things in the book what do I need before beginning this course ? Update My probl...
Problem Let's say I can write a model as the Hermitian eigensystem: $$ A x = \lambda x $$ where $A \in \mathbb{C}^{n\times n}$ is Hermitian, or as the generalized Hermitian eigensystem: $$ \tilde A \tilde x = \lambda \tilde B \tilde x $$ where $\tilde A, \tilde B \in \mathbb{C}^{\tilde n \times \tilde n}$ are Hermitian...
I would like use N-body simulation for measure a torque on an object in a liquid (helium). It's a 2D study. On the site : http://www.browndeertechnology.com/docs/BDT_OpenCL_Tutorial_NBody-rev3.html I can understand the method. But it's only for free object. How can I do for compute particles when they reached fixed wal...
I have a system of nonlinear equations of which I know it has a single root I am interested in, and has a continuum of roots I am not interested in. I am currently using Newton with line-searching in an attempt to find that single root, but the algorithm will obviously always converge to one of the roots from the conti...
Can anyone tell me some very good/efficient numerial algorthims for GPU/CUDA to compute multiplication/ between sparse matrices (its good if you can recommend me some research papers)? I googled some papers on sparse vectors, but it looks like they are more interested in the operations involves sparse matrix and dense...
I have a mixed integer programming problem. And I am current using GLPK as my solver. But I found that GLPK is good for Linear Programming problem, but for Mixed Integer programming, it requires much longer time, therefore doesn't meet our requirement. I am so seeking other software. Is there any other good open sourc...
Short version: Is it ever a good idea to use multiple languages in scientific codes? Long version: May be its just me but these days I often see scientific codes written in multiple languages. The argument is that one language is used for performance and other one for ease of use, pretty syntax, because everyone else i...
As it known, according to the Polar Decomposition, square matrix can be expressed in the next form $$M=QR$$ ($Q$ - orthogonal matrix $R$ - positive-semidefinite Hermitian matrix) I need to find this $Q$ factor for the case of $3\times 3$ matrix. For this purpose I use next well known iterative formula $$ Q_{i+1} = \fr...
Is there a master degree in HPC (High Performance Computing) in US? I am asking this question because in my early research I found no direct mentioning of HPC instead invidual courese in parallel programming , distributed computing etc in additional to cs generic core course. I did not found so far a focused program in...
Suppose I have the following interesting function: $$ f(x) = \sum_{k\geq1} \frac{\cos k x}{k^2(2-\cos kx)}. $$ It has some unpleasant properties, like its derivative not being continous at rational multiples of $\pi$. I suspect a closed form does not exist. I can compute it by computing partial sums and using Richards...
I have a code similar to this: import numpy as np import multiprocessing as mp a = np.zeros((4, 4)) # 4x4 array containing zeros def f(x, y): # uses scipy functions # takes long to compute #result = <someValue after calculation> global a a[x][y] = x+y # simple example function # since f takes l...
I am having trouble with calculating a mean of vector with sufficient accuracy. My current solution which works but it quite slow and has unpredictable performance: mean_sum = mean = math.fsum(values) / n values = values - mean mean = math.fsum(values) / n while np.abs(mean) > np.finfo(np.float32).eps: val...
How does Matlab optimization tools works? It just gets the error function and doesn't need Jacobian (first derivatives) or Hessian (second derivatives)? How it is possible? If it is finite difference how it determines the value of dx for different degree of freedom?
I have an energy dispersion curve obtained from the eigenvalues of $$E(k) = \text{eig}(T e^{ik} + T^H e^{-ik} + H_0),$$ where $H_0$ and $T$ are $N\times N$ square matrices, $T^H$ is the Hermitian transpose $T$, and $k$ is the wave-vector. So, there are just 2 matrices $T$ and $H_0$ that determine the problem. I want t...
if i draw a polar plot with Octave the axes are cartessian, not polar axes. But in Matlab it seems polar axes exists for polar plots. Is there anyway to draw with polar axes in polar plots in Octave? Thanks
I am taking a Thesis-based Master degree now and I am going to choose my supervisor soon. I plan to take a PHD degree after graduation, so if possible, I wish my PHD research area could be an extension of my Master Thesis ( so that the researching experience during my Master wouldn't be wasted). Currently I am interest...
I am trying to solve a system of equations (A x = b) for 3D heat diffusion (i.e. each equation has at most 7 terms not including the constant "b" term) using UMFPACK with boost numeric bindings to C++. e.g.: namespace umf = boost::numeric::bindings::umfpack; umf::umf_solve(A,x,b); I can populate the A matrix and the ...
Software such as ParMetis or PTScotch partition a graph. When one wants to use it for mesh partitioning (for example for FEM), a dual graph whose vertices represent cells of the original mesh is usually constructed first. This dual graph is then partitioned. I was wondering why one cannot simply interpret the connectiv...
Let $f(x)=\frac{1}{5}x^5+\frac{1}{3}x^3+x-1$ Show that $f$ has only one zero $r$ in interval $(0,1)$ To find approximation of $r$ we apply Newton's method $x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$. Show that for every $x_0\in(0,1)$ this method converges. Show that order of convergence is exactly quadratic First one is ...
I want to integrate a function over a radial domain $D=\{r<r(\theta)\}$. The change to polar coordinates yields: $$ \int_D f = \int_0^{2\pi} \int_0^{r(\theta)}f(r,\theta)rdr d\theta $$ so I tried calculating each integral using trapezoidal quadrature: $$\int_a^b f(x)dx \approx \frac{b-a}{m} (f(x_1)+...+f(x_m)) \text{ f...
Suppose I have two VTK files, both in structured grid format. The structured grids are the same (they have the same list of points, in the same order), and there is a field, call it "Phi", in each VTK file. I want to create a third VTK file, again with the same structured grid, and plot a field that is the difference b...
I'm reading up on the Finite Element Method (Zienkiewicz's Book), so I understand better what I'm doing in FEniCS and COMSOL. Currently, I'm wondering about this: Using FEM to solve fluid flow problems, do I have to re-assemble the entire system in each iteration of the solution process? I would assume not since re-...
My current project is a reprogramming of a protein folding model involving the solution of thousands of ODEs in C++. I've been making some stop and start progress as I'm writing the solver to run totally on the GPU. I finally got it integrating but when I try to solve dC/dt=-C using the fifth order solution from the R...
I apologize if this is a vague question, but here goes: Over the past few years, functional programming has received a lot of attention in the Software Engineering community. Many have started using languages such as Scala and Haskell and claimed success over other programming languages and paradigms. My question is: a...
I want to do engineering and scientific calculations im Maxima/wxmaxima. I do not want to manually check every time if my units make sense, how can I achieve this? I'm looking at Maxima because it's free and solves equations etc. symbolically if asked.
I would like to hear about scientific codes and commercial packages utilizing meshless methods like Element-Free Galerkin based on Moving Least Squares functions. By "serious" I mean they could be used to solve problems comparable e.g. in size to those solved by FEM. It's already more than fifteen years since their inc...
There is a least-squares problem. It can be solved using backslash in Matlab. If Ax = b, then x = A \ b. Let's assume that I have the same problem, but all x must be non-negative (>=0). How can I solve this problem in Matlab by analogy with the previous one (without non-negativity constraints)? I think it can be someho...
I am trying to find a good way to handle the following problem: Let C be an N by 3 array (corresponding to points in $\mathbb{R}^3$). There is a method I am interested in testing which requires constructing, for i=1....N, a matrix $A_i$ of size $n_i <<N$ and a vector $b_i$ of size $n_i$ using only data from the row i o...
I'm reading now Shu, C.-W. (1999). High Order ENO and WENO Schemes for Computational Fluid >Dynamics. (T. J. Barth & H. Deconinck, Eds.)Lecture Notes in Computational >Science and Engineering, 9, 439–582. doi:10.1007/978-3-662-03882-6_5 The author provides two formulations of WENO methods: finite-difference and finit...
This was so much easier in Python (so much so that I'm considering going back to matplotlib for data analysis). But really, trying to figure out ROOT and Boost graph library and mathgl makes me want to die. What I'm thinking for the short term is to somehow export my 2d array to a text file and then import that file i...
On one hand, one may seed the domain with particles and track their trajectories in the Lagrangian sense by implementing a Lagrangian particle tracking model. On the other hand, one may use the Eulerian approach and solve a scalar transport advection/diffusion equation for a passive scalar similar to what is done for t...
I have a function that is expensive to evaluate whose inputs are n-dimensional (n is the order of a dozen or two). I need the output of this function at each node and each time step for a PDE simulation. I know that the portion of the n-d space sampled is small since n-1 of the inputs are species mole fractions. I ...
I'm trying to solve a multipole system. It involves a matrix of 3x3 tensors $A_{ij}$ and a vector of 3-tuples $\mathbf v_i$. $$\left(\begin{matrix} A_{11} & A_{12} & \cdots & A_{1n}\\ A_{21} & A_{22} & \cdots & A_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ A_{n1} & A_{n2} & \cdots & A_{nn} \end{matrix}\right) \left(\be...
Given iterative method: $x_{n+1}=0.7\sin x_n +5 = \phi(x_n)$ for finding solution for $x=0.7\sin x +5$, I want to estimate $|e_6|=|x_6-r|$ as good as possible, with $x_0=5$, where $r$ is exact solution. This method obviously converges, because $\phi$ is contraction mapping, so $r=\phi(r)$ is a fixed point. So, with mea...
I'm searching for a way to generate a mesh that consists mostly of the same elements and i mean not only the same type, but the exact same size to ease the FEM-calculation. Is there a particular algorithm or software package i should look into?
I am a novice in the world of algorithms, ignorant of the taxonomy used.Please pardon me. I have two large sets of numbers A and B where A = {x| 0< x< 9999999999 } B= {y | 0 < y < 9999999999 }. The cardinality of these sets is more than a million. Which is the best algorithm to compute the set differences $A \setminus ...
I have a question relating to linear algebra. We have a fluid solver that solves the poisson equation for pressures. When there are areas of the domain that are entirely enclosed by Neumann conditions, the matrix has a nullspace and we must correct for this. We keep around a mask of the enclosed regions, and in each it...
The question is about the first-order exponential integration method described in this article. Consider a system of ordinary differential equations $$y'(t) = -A\,y(t) + \mathcal{N}(t, y), \qquad y(0) = y_0,$$ where $\mathcal{N}$ is a nonlinear function. The solution can be approximated using the exponential (explicit)...
The conjugate gradient method suffers from an accumulation of errors as it continues. For this reason it is unwise to use it as a direct solver. My question is, would it help to recalculate the residual every 5 or so steps in an attempt to mitigate these sorts of errors even when used as an iterative solver? I've not h...