instruction
stringlengths
43
28.1k
I am currently working on a project where I have used an RK4 integrator to attempt to solve the three-body problem. An interesting result that I found, was that decreasing the size of the time steps only improved accuracy until a certain point where the accuracy started to decrease. Is this normal for RK4 integrators o...
Do you think that the RobOptim optimization library (which I read about in C++ library for nonlinear constrained minimization) could be used for real-time optimization for the velocity control of a robot? Being more specific, I have a distance function that I want to minimize between a point of the robot and an obstacl...
I have a system of conductors for which there are two dense matrices of the (complex) mutual admittances, $Y_A$ and $Y_B$, which are symmetric. Then, an equivalent nodal admittance matrix $Y_N$ is calculated by the following: $$ Y_N = A^T \cdot Y_A \cdot A + B^T \cdot Y_B \cdot B $$ where $A$ is a directed incidence ma...
I am writing an Alternating-Directions Implicit Method for simple 2D diffusion ( \begin{equation*} \frac{df(x,y,t)}{dt}=D\Delta u \end{equation*}). Tridiagonal matrices are solved via Thomas algorithm (LU decomposing). def calculateADI(u,delta_t, delta_x, size, D): a1 = np.ones((size), dtype=np.float64) b1 = n...
I need some clarification regarding the time step used in the molecular dynamics simulations. In the first simulation the time step was 1 nanosecond and in the second simulation the time step in 10 ns. Now I want to compare the results of these two simulations. For example take mean-square displacement. $$ MSD(1ns) = \...
The R package rmarchingcubes implements a marching cubes algorithm. Given a voxel contructed from a function defining an isosurface, it returns a 3d mesh with some vertex normals. When I plot this surface, it is incredibly smooth. If instead of the rmarchingcubes normals, I use the classical normals obtained by averagi...
I have the following problem. I must sample from a discrete distribution that is changing at each sort. Let me explain, with a "vivid" description, I draw a color ball from a bag. The probability associated with each color is different (for this part I could choose an alias method, for example, the Vose's algorithm). B...
Given a rectangular finite elastic sheet $ABCD$ containing an arbitrary horizontal cut (or discontinuity) $EF$ in its interior. The edge $AB$ of the sheet is tethered but $CD$ is stretched by $\Delta$ such the horizontal cut is pulled down and "stretched open" as shown below. I would like to determine the function $x ...
In basic lectures on finite elements theory, people always assume $H^2$ regularity of the solution in order to derive $O(h^k)$ a priori estimates in the norms $H^{2-k}$, $k=1,2$. For simplicity let's restrict to the usual Poisson equation. I would be interested in a reference of what rates can be expected, in both norm...
I am trying to solve for the order parameter ($A$) in the Ginzburg Landau equations. I had asked on the math SE site but was recommended to ask here. We are trying to solve the following equation, (with the implied sum over $j$, for each component identified by $\mu$, $i$), $K_i$, $\beta_i$, and $\alpha (T)$ are known ...
Having a single parity bit gives a Hamming distance of 2, so only one single bit can be corrupted to reliably detect an error. The next step I know of would be a Hamming code, which uses at least 3 parity bits. However, is there a method which uses two parity bits and performs better than just a single parity bit? I do...
I am pretty new to using FE solvers. I am trying to solve a system of (up to) 9 complex equations. We write these as a matrix equation (here), (with the implied sum over $j$, for each component identified by $\mu$, $i$), and known parameters (or at least constant wrt position): $K_i$, $\beta_i$, and $\alpha (T)$; $$ K_...
I am trying to mesh a geometry using the gmsh python api, however it seems like my algorithm selection option (i.e. gmsh.option.setNumber("Mesh.Algorithm", 8) ) is being ignored. Can anyone tell me if this is a bug or if I am simply making a mistake. This code replicates the problem: import gmsh import sys h=1.0 ...
I'm dealing with the numerical resolution of advection-diffusion-reaction equations. I've encountered references on CFL conditions for conservation laws as well as advection-diffusion equations. I'm wondering if any references exist on CFL conditions involving reaction as well. I don't have any preferences on the numer...
A linear space in mathematics is a set whose elements (vectors) have operations of addition and multiplication by a scalar defined in such a way that certain properties are satisfied (commutativity, associativity etc.), and the result of those operations belongs to the same linear space, i.e., the linear space is close...
In high energy physics we oftentimes encounter the following problem. For a given parametrized matrix $\{H_{ij}(\Lambda)\}$, we know that in the limit $\Lambda\to\infty$ some of its entries become large: $$ \text{For some $(i,j)$: }H_{ij}(\Lambda)\to\infty\text{ as }\Lambda\to\infty. $$ We also know that in the limit ...
I'm comparing two optimization algorithms for deep neural networks. To that end, I train a network with the same data and starting rom the same initial weights using two different optimization algorithms. Then, I visualize the optimization trajectory within the loss landscape using this method. Besides the qualitative ...
I'm interested in mixed discretizations of the diffusion (and related) equations: $$\begin{align} \frac{\partial h}{\partial t} + \nabla\cdot \mathbf q & = f \\ k^{-1}\mathbf q + \nabla h & = 0 \end{align}$$ where $h$ is a scalar field representing thickness or hydraulic head and $\mathbf q$ is a vector field represent...
Maybe that is not the best place for the following question, if such, let me know and sorry. I would like to model the flow of expanding bentonite in a fracture following the given reference. In order to take into account the swelling pressure, they modified the Stokes equation (momentum equation) by adding the swellin...
The SDP problem is $$ \min_{Z \in S^{n},Y \in S^{m}} {\rm trace}(Z) +{\rm trace}(Y)\\ {\rm s.t.} \begin{bmatrix} Y & X\\ X^T & Z \end{bmatrix} \succeq 0\\ X \in C $$ Where $C$ is a convex set.But I have some difficulty in transforming it to the standard form: $$ \min_{X}\operatorname{trace}(CX) \\ \text{s.t.} \ \operat...
In my optimization problem there are elements consisting of a time and a value, i.e. $(t_0, v_0)$. These pairs are stored in a vector $v = [(t_0, v_0), (t_1, v_1), ... , (t_n, v_n)]$. The vector $v$ serves as an input to an optimization function $f$ that computes a cost value from the input. Is it mathematically common...
How do I find the first derivative of a coordinate set using Python? I have a list of (x,y) coordinates (plotted below in red) representing a dotted-line perpendicular between two points (connected in blue). For each red point along the dotted-line, I can get the grayscale value of the pixel over which the dot runs, a...
Crossposted on Mathematics SE CVXPY is a famous software as a solver for optimization problems. Nowadays, I use it to run a program presented in a paper, the Example 7.1, and the program runs as follows (I haven't found out how to insert my codes here, otherwise I would post them) all matrices are $4 \times 4$: $O_0$ ...
The author of the SIAM News article "Optimization Theory and Perspectives on the Field of Machine Learning" mentions: ... For unconstrained convex optimization, GD (gradient descent) convergence rates do not depend on the space’s dimensionality. In other words, if we measure a notion of how close we are to the global ...
I am trying to replicate a finite element analysis given in a research paper titled On the Detection of Stress Singularities in Finite Element Analysis 1 by G.B.Sinclair et. al. The geometry of the problem is given in Figure 1. and boundary conditions are $$ (x, y) = (D/2 < x < L + D/2) \hspace{0.5in} \sigma_y = -p, \...
I'm trying to understand autodiff better, and specifically the connection between autodiff and dual numbers, and why dual numbers are needed in the first place. The pytorch help pages about autodiff [1][2], for example, does not mention dual numbers at all. The wikipedia page, as well as other sources, suggest that it ...
I'm numerically solving a system of coupled ODEs where time is the independent variable. At each time, I can solve for the equilibrium values of my state variables where their respective derivatives go to zero and classify the equilibria as stable or unstable. For one of my variables, the equilibrium value is stable at...
When solving non-linear systems of equations, @Arnold Neumaier suggested in How can I precondition a non-linear problem before linearization? to use an approximate LU decomposition of an approximate Jacobian at the starting point to precondition nonlinear conjugate-gradient to minimize $\|F(x)\|_2^2$. Can anyone point ...
I'm trying to implement the scheme he describes on his book "Computational Fluid Mechanics and Heat Transfer" on Chap.9 and I'm having trouble imposing BC. I don’t get how he imposes them. I get up to the point where, following the Beam and Warming scheme and after linearizing each flux vector with the flux vector U, h...
I have cumulative data for concentration versus time. I would like to fit the following model to the data: $$\frac{1}{\Gamma(n) \bar{t}}\int_{0}^{\frac{n t}{\bar{t}}}z^{n-1} e^{-z}dz$$ $n$ and $\bar{t}$ are the variables that I would like to fit. I tried to make a function with integral included but I wasn't successfu...
I am working on a primitive 2D DIY magnetic "FEA" solver for a class project. It's really just a big NumPy array where each element in the array can be one of the following: Air Current carrying wire with current into or out of the screen (Biot-Savart applied to every other element in the array) A permanent magnet (cu...
I am interested in an optimization problem of the form $$\min_{\boldsymbol z} \max_j \vert f_j(\boldsymbol z) \vert = \min_{\boldsymbol z} \Vert f_j(\boldsymbol z) \Vert_\infty. $$ Here, the optimization/decision variables are $\boldsymbol z \in \mathbb C^{N} $ and $f_i: \mathbb C^N \to \mathbb C$. The $f_j$ are essent...
Suppose I have an $m \times n$ matrix $A$ that is only accessible through matrix-vector products $Ax$. These are expensive, is there a way to approximate vector $x$ of $n$ column norms of $A$ by using less than $n$ calls to the matrix-vector product? $$ \begin{aligned}a_{1}=\left[ A\right] \begin{pmatrix} 1 \\ 0 \\ 0 \...
I am wondering what are the standards for convergence of Lyapunov exponents (and Kaplan-Yorke dimension)? For example, I have a MATLAB code to calculate Lyapunov exponents for the classic Lorenz attractor using QR decomposition: clear all; close all; % parameters par = [10; 28; 8/3]; % initial conditions x0 = [1; 1; ...
Preliminary definitions: I have a code that uses TEBD (https://en.wikipedia.org/wiki/Time-evolving_block_decimation) to perform time evolution of a given Matrix Product State (MPS), lets call it $|\Psi\rangle$. I am starting from a product state (Neél state) $|\uparrow,\downarrow,\uparrow,..,\downarrow\rangle$ for a ch...
Moore-Penrose inverse for an arbitrary matrix $X\in \mathbb{R}^{n \times p}$ is defined by a matrix $X^\dagger$ satisfying all of the Moore-Penrose conditions, namely \begin{align} (1) \;\;\;& XX^\dagger X=X \\ (2) \;\;\;& X^\dagger X X^\dagger = X^\dagger \\ (3) \;\;\;& XX^\dagger = (XX^\dagger)^T \\ (4) \;\;\;& X^\da...
The 1D diffusion equation with a chemical source term has the following form: $$\frac{\partial Y}{\partial t} = D \frac{\partial^2 Y}{\partial x^2} - k Y,$$ where $Y$ is the molar concentration of the diffusing species (mol/m³), $D$ is the diffusion coefficient (m²/s), and $k$ is the reaction rate coefficient (1/s). Th...
I have a 3D grid in real space of grid spacing $L$ and say 21 grid points in each direction, containing e.g. a charge distribution. This is stored as a numpy array of shape (21, 21, 21). The grid points themselves are of course vectors and so are stored as a numpy array of shape (3, 21, 21, 21). I also have a set of pl...
I want to develop a finite element method to solve for $u(x,t)$ the PDE: $$u_t+c u_x= \frac{-c}{x}u$$ where $c$ is a constant. so I am trying the following ( as Rothe's method? ) : Letting $k= t_n- t_{n-1}$ ( we begin by time discretization? ) we can write $$\frac{u_i^n-u_i^{n-1}}{k}+ c\left(\frac{u_i^n-u_{i-1}^{n}}{...
I was working on a problem recently (calculating all flows in a network given input and output flows, basically what Hardy-Cross tries to achieve) which can be formulated as a well-determined system of $N$ equations (with $N$ variables), of which $M$ equations are linear and $K$ are non-linear (so $M + K = N$, and gene...
I am looking for possible numerical methods to solve the PDE $$u_t+c u_x= \frac{-c}{x}u$$ I am particularly interested in a Finite elements method, although I am also curious if you can expose some other methods.
Suppose we define $A^{*}$ of positive definite $A=X'X$ using following two steps: let $B=A^{-1}$ scale columns of $B$ to obtain a matrix with $1$'s on the diagonal For the case of singular $A$, we could use a tiny amount of Tikhonov regularization: $A^*=\lim_{\epsilon\to 0}(A+\epsilon I)^*$ Is there a name of this op...
I would like to do a 2D projection from a 3D geometry saved in a stl file and know the distance between the two projected planes. In order to explain better the concept I will start with an almost ideal model or simple example: Let's say I have a minimal cube model such as the vertex are comprissed between x=-+1, y=-+...
Suppose $X$ is a dense $m\times n$ data matrix and we seek to find $w$ by approximately iterating least-squares filter equation: $$w = w - \mu (X'X)^{-1}X'(Xw-b)$$ What are known approaches for $10^9<m<\infty$ and $n\approx 10^6$? This setting comes up in Machine Learning and people tend to invent their own techniques...
Consider the problem $$\partial_t u-\Delta u = f\\ u(\Sigma_1)=f_D\\ \partial_\nu u (\Sigma_2)=f_N\\u(0)=u_0$$ where the sides of the space-time cylinder $\Sigma_i$ are disjoint (one of them could be empty, so as to recover a non-mixed problem). Do you know of any reference where a priori estimates using finite element...
I am trying to compute the integral of a 2D hemisphere dataset $f_r \, (\theta, \phi)$ where $\theta \in [0, \pi / 2[$ and $\phi \in [0, 2\pi]$. I am making the measurements myself, so I can choose the number of values and their coordinates. My first idea was to use the different points to triangulate my definition set...
I tried many formulas to find the components of the second Piola Kirchhoff. I need help to derive equations 27-29 on reference 1. [![enter image description here][1]][1] we have $$ \mathbf{C}=C_{11} \mathbf{T} \otimes \mathbf{T}+C_{12}(\mathbf{T} \otimes \mathbf{N}+\mathbf{N} \otimes \mathbf{T})+C_{22} \mathbf{N} \oti...
I want to solve electrostatic problem for potential. Charge density and medium permittivity are known, so is the potential of a grounded surface. I know how I can implement that. But I would like to add an ideal conductor (of unknown potential) to the system. How can I introduce an equipotential surface/volume? I g...
I want to mathematically describe a vector containing a series of time points. The time points must lie on an equidistant time grid of 15 minutes of a day. Thus, elements of the vector can contain values that occur at times $[t_1 = $ 00:00$, t_2 = $ 00:15$, ..., t_n = $23:45$]$. Example: vector $\pmb{t} = [$00:00, 01:1...
I've been working on a code to solve the Tolman-Oppenheimer-Volkoff (TOV) equations for a while and recently I've got it right but only for one specific equation of state, the bag model, which is not what I need since it should run for any hadronic equation of state. The code has given only wrong results for any EoS ot...
Historically, iterative methods for solving relatively simple-structured systems $Ax=b$ with $A$ being a $4\times 4$ matrix or to find the eigenvalues of that matrix assuming in both problems that $A$ is non-singular were not quite popular and were not needed in pre-1950s as stationary methods or perhaps classical iter...
I am currently trying to evaluate surface forces on a structure. I came across P356 in Bathe's Finite Element Procedures 2014 (example 5.8) in which he related the edge derivative from the global to natural coordinates through this equation: $dl = det(\mathbf{J}^S) \ dr$ where $r$ is the natural coordinate along the ed...
In Fourier transform spectroscopy (FTS) I am calculating a broadband interferogram (e.m. frequency 190-300 GHz top-hat), then back-retrieving the spectrum by FT. Here in the figure, you can see the result: I expect the retrieved spectrum to be the same as the "injected" one but there is the effect of the top-hat bandpa...
I have wrote this code to solve an equation , I know the behavior of this function has very rapid oscillations, when I RUN it gives bogus values for some "m[x]" and some "t"'s, with this error: C:\Users\dani\anaconda3\lib\site-packages\scipy\integrate\odepack.py:247: ODEintWarning: Excess work done on this call (perha...
In RBF-FD methods (see Fornberg & Flyer. A Primer on Radial Basis Functions with Application to the Geosciences. SIAM, 2015. Chapter 5.), the finite-difference stencil coefficients for a set of nodes $\{\vec{x}_1,\vec{x}_2,\dots,\vec{x}_n\}$ are found by solving a linear system which involves the block-structured and s...
I face a feasibility problem of type $$ c_i(\boldsymbol x) \leq 0, i = 1, \dots, \mathcal{I} \\ c_e(\boldsymbol x) = 0, e = 1, \dots, \mathcal{E} $$ where $\mathcal{I} + \mathcal{E} \gg \text{dim}(\boldsymbol x) \sim \mathcal{O} (10^1) $. Currently, I solve this with Ipopt but since it takes quite some time (many ite...
I have matrices ($S_0$ thought $S_N$) and I have a recurrence relation that link successive matrices together. $$S_i + S_i(aS_{i-1}^{-1})S_i=C_i+aS_{i+1}$$ We can assume for this problem that $S_0=S_N=I$, the identity matrix. The $C_i$ in this equation are all known beforehand. All matrices $S_i$ are definite positive ...
My question is how to keep track of the "mass" being advected out of a model domain, for the 1-D advection equation, and an upwind differencing scheme. Following is the background Consider the continuity equation $$\frac{\partial u}{\partial t} + \frac{\partial \Phi}{\partial x} = 0$$ Suppose the flux $\Phi$ is given b...
I am trying to solve a DAE with a non-linear constraint. The governing equations have the following form. The second equation is a constraint and it must be satisfied everywhere. Is there a way to use the ode solver in MATLAB to solve this type of system? If so, for example, ode15s, how could we couple the constraint ...
This question relates closely to another question I asked earlier this week. Let's say that I want to find a set of matrices $S_i$, with $0\leq i\leq N$, that minimizes some objective function with numerous terms. I can easily compute the gradient of the objective function, with regard to each matrix. This provides me ...
I have a dataset with values of multiple curves. An example plot is shown below. I want to shift the curves (up/down) so that all curves overlap. This would mean the data points in each curve is scaled up/down by a factor. I am not sure how to frame this as a mathematical problem (to minimize the vertical distance betw...
I am new to Eigen C++ programming. I am trying to create an Rcpp function to call from R. The function takes a list of matrices (Xlst), and two lists of vectors (ylst and smwlst). In each for-loop iteration, the function should perform standardization of the columns of a matrix and then multiply with the corresponding ...
In my numerical linear algebra class we mentioned this problem briefly and according to some other lectures on the internet especially in data driven environments one mostly has to deal with such over- or underdetermined systems. Nevertheless in our lecture we mostly deal with direct methods (mostly matrix decompositio...
I want the code to integrate equation(1) or (2) over the limits using mathematical or mathlab to get equation (3) as the answer of $Z$ vibrational partition function, giving the following additional information $$ \begin{aligned} Z_{v i b}(\beta) &=\sum_{n=0}^{\lambda} e^{-\beta E_{n}}, \quad \beta=\frac{1}{k T}, \\ \l...
Is there a permutation used in sparse QR factorizations that better locates small elements on the diagonal of R to the end of the diagonal? As an example, consider the following snippet of MATLAB code: A = [1 1 1; ... -1 -1 1; ... 0 0 -1; ... 0 0 1; ... -1 0 0; ... 0 -1 0]; s = [1e-8;1e...
I am working on Singular Value Decomposition for complex matrices. I implemented One Sided Jacobi algorithm. It gives exactly the same result as the svd function in Matlab for the real matrices. However, it does not give the same result in complex matrices. It confirms the formula A = UEV* however I am not sure whether...
In the physical sciences (which are physics, chemistry, astronomy, materials science, etc.), we learned that the uncertainty is +/- the smallest unit (which is 1) of the last significant figure if the uncertainty is not given in a recording of data. So, if we have a digital measuring device that measures to the nearest...
This is related to my previous post here I have a dataset with values of multiple curves. An example plot is shown below. I want to scale the curves (move up/down) so that all curves overlap. The following is a sample dataset which includes that data points corresponding to 5 curves and coordinate inputs below scale = ...
This is related to my previous post Minimize distance between curves. I have a dataset with values of multiple curves. An example plot is shown below. I want to scale the curves (move up/down) so that all curves overlap. The following is a sample dataset which includes that data points corresponding to 5 curves and coo...
Consider the continuity equation $$\frac{\partial u}{\partial t} + \frac{\partial \Phi}{\partial x} = 0$$ $$\Phi = au + b\frac{\partial u}{\partial x}$$ Suppose I want to solve the above using centered finite volumes. Below, $U_j \approx \overline{u}_j$ where $\overline{u}_j$ is the spatial average value of $u$ in a fi...
Suppose we solve an $m\times n$ full-rank system of equations $Ax=b$ by iterating the following for a small enough $\mu>0$ $$x=x+\mu B(b-Ax)$$ Is there a nice description of kinds of $B$ which make this iteration convergent? For instance, for $n=1$, $A,B$ can be viewed as vectors, and this iteration converges iff their...
I'm looking for a technical term or literature that describes a problem when creating mechanistic computer models. By mechanistic computer model, I mean a computer model of a physical system where the different components of the physical system are modelled by components of the computer model, each model component repr...
What are the prerequisites to learning BEM? In which order is it advisable to learn BEM and FEM - either one before the other, or does it not matter? What are some good resources to self-learn BEM? P.S. I am mainly interested in contact mechanics of surfaces. I am a mechanical engineer (senior) by trade, and I have b...
Consider the Laplace equation, $$ \nabla^2 f(r,\theta,\phi) = 0 $$ in spherical coordinates. We know that the solution to this equation can be derived analytically, and is given by, $$ f(r,\theta,\phi) = \sum_{l=0}^{\infty} \sum_{m=-l}^l \left( A_l^m \frac{1}{r^{l+1}} + B_l^m r^l \right) Y_l^m(\theta,\phi) $$ where the...
Let $f: \Bbb R \to \Bbb R$ be continuous. What are efficient algorithms to finding all the zeros in an interval $[a, b]$? I am actually only interested in the smallest zero in that interval, if there's an algorithm that can provide me with just that.
I have a real valued function $F$ for which I am looking to find its global minimum. The function is well behaved and I can obtain its Jacobian. I could also compute the Hessian but the function depends on a large number of variables so it's not practical. We can still assume that the Hessian is definite positive over ...
I'm not a deal.II expert, and while studying step-6 I was reading the documentation of the MappingQ1 class in the deal.II documentation. At some point in the description (https://www.dealii.org/current/doxygen/deal.II/classMappingQ1.html) , there's written: Note, however, that in 3D the faces of a general, trilinearly...
The time dynamics of an atom interacting with a reservoir of spectral density $J(\omega)$ are obtained by solving the following integro-differential equation: $$ \frac{\mathrm{d}c(t)}{\mathrm{d}t} = - \int\limits_0^t \mathrm{d}\tau~ c(\tau)f(t-\tau),$$ where $$f(t-\tau) = \int\limits_0^{\infty}\mathrm{d}\omega ~ J(\ome...
I have read that matrix regularisation can improve the stability of LU or Cholesky decomposition of ill conditioned problems. The idea is to add a value to the diagonals of a matrix: $B=A+cI$ In the above mentioned case $A$ is the initial matrix, $c$ is the constant, $I$ is the identity matrix and $B$ is the regulize...
I am asking a follow up question to this question, but I could probably have written it as an answer instead. However, I don't know if what I am doing here makes sense or is too complicated for my problem so I am not sure it's the correct answer! As I explained in the other question, I have basically a very standard un...
I have a set of coupled ODEs that I'm solving numerically. The independent variable is time and runs from values of $10^{15}$ to $10^{17}$ in units of seconds. The state variables in their usual physical units have large numbers like $10^{10}$ and $10^{50}$. As these state variables evolve with time, their values syste...
I have an equation that is a bit similar to a Sylvester equation. The equations is $AXB^T+X=E$, where all variables are matrices. I could try to inverse $B$ and rewrite the equation as $AX+XB^{-T}=EB^{-T}$, which is then the standard form for the Sylvester equation, but I need to invert $B$, which is usually not a good...
Can anyone recommend a good software for solving generalized symmetric eigenvalue problems of the form, $$ A x = \lambda B x $$ where $A,B$ are symmetric and sparse, and $B$ is positive definite? I have only 1 machine so I would prefer something based on OpenMP rather than MPI if possible.
I was reading the paper given in the link http://www.unige.ch/~hairer/preprints/parareal.pdf and I have a problem in understanding in page 10 for the Burger equation on implementing Parareal method for Burger equation. In section 4.4, the line "... fine time step $\Delta t=1/100$, which gives a numerical accuracy of $4...
I have a matrix $X=CC^T$ that I want to diagonalize. Here $C$ is a known $n\times n$ matrix, which I could also factor as $LM$ if it helps, $L$ being a lower triangular matrix and $M$ another matrix. Is there a shortcut to compute the eigenvectors and eigenvalues of $X$, in particular knowing $C$? The matrix $X$ is sym...
I'm doing FEM and have a problem about getting numerically stable solution for ODEs problems like: $$ \frac{\mathrm{d}}{\mathrm{d}x}\mathbf{Y} = \mathbf{AY}, x\in[x_1,x_2]$$ in which $\mathbf{Y}$ stands for a large-scale vector (greater than $1000000\times1$), and $\mathbf{A}$ is its corresponding coefficient matrix. T...
I'm learning how to do Finite Element calculations using Comsol Multiphysics. In Comsol, Linear Elastic Material and Nonlinear Elastic Material are available as material models: Using Linear Elastic Material, you can add Plasticity, and define Initial yield stress as well as the tangent modulus: I'm wondering, if we ...
What are the "job programming languages" for computational science? What are their use cases? C obviously. But what standards, and what are some central use cases? C++? But what standards, some particular subset? Fortran. How relevant is this still? What about in the future? Java. What are the use cases for a GC'ed...
I am attempting to solve a nonlinear diffusion equation of the form $\partial_t u = \partial_x (\kappa(u) \partial_x u)$, where the conductivity function $\kappa(u)$ is a power law $\kappa = u^{5/2}$, using the LSODA time integrator in Python interfaced through SciPy. The equation is discretized by finite difference on...
What are the parts of C++ that make C unsuitable to be used for scientific libraries? Someone could argue the merit of C (or Fortran for that matter) to be simplicity. However, why do developers choose to expand onto C++, rather than remain in C?
I am looking for an example of a certain pair of ODEs. Consider two independent ODEs $$ \frac{\partial x}{\partial t} = f(x)\ \text{and}\ \frac{\partial y}{\partial t} = g(y) $$ where $x \in \mathbb{R}^n$ and $y \in \mathbb{R}^m$. Now we combine them into a joint ODE $$ \frac{\partial z}{\partial t} = \begin{pmatrix}f(...
Are there techniques for interpreting practical viability of some method? That is, if one comes across some mentioned technique, then is there some way to gauge, how much prevalence it has for practical usage? Some theories may stay at a theoretical level for some time, and they're perhaps not a good use of time for so...
Here is my objective: I want to code a ray tracing engine in C++ that can be run on any GPU. That means that it should work on NVIDIA GPUs, AMDs, or even Intel Graphics chipsets. The choice of C++ was made because the final program will be used by a third party user who will not be able to install anything on his machi...
I am trying to numerically solve the following ODE's of an electric circuit which models the battery of a vehicle: $\dot{u_{1}} = \frac{-u_{1}}{R_1C_1}+\frac{I(t)}{C_{1}}$ $\dot{u_{2}} = \frac{-u_{2}}{R_2C_2}+\frac{I(t)}{C_{2}}$ $\dot{SoC} = \frac{-I(t)}{Q_{n}}$ In my case, the current $I(t)$ is computed based on a pow...
What are the numerical methods available to compute integrals over $S^2$, for the particular integration : $$\int_{S^2} f(\omega)\,d\sigma(\omega)\ , \quad \text{ where $d\sigma$ is the usual measure on the sphere }S^2 $$ And $\omega= (\theta, \phi)$ is a direction (or a unit vector) given by a point on this sphere. I ...
I have dense $d\times d$ matrices $A$, $B$, $C$ with $d\approx 1000$ and want to find the top $10^5$ eigenvalues of the following positive definite matrix: $$ \Sigma= \left(\begin{matrix} A\otimes A & C^T\otimes C\\ C\otimes C^T & B\otimes B \end{matrix}\right) $$ Cheap: assume $C=0$ and compute $\lambda(A)$, $\lambda...
I am investigating ways to solve an optimal control problem in an embedded way, preferably in Java. The system is modeled with triple integrator dynamics $u=\dddot{x}$ and solved with multiple shooting, with continuity constraints put on $x$, $\dot{x}$ and $\ddot{x}$ which are solved with Runge-Kutta-4 integration and ...
It seems common practice to store only the upper or lower triangular part of a sparse symmetric matrix to save memory. Now I am wondering how, e.g. the SpMV kernel in CSR format is designed and how the matrix elements are accessed which are not stored explicitly when only the upper triangular part is given (typical mat...
I'm interested in solving an inverse coefficient problem for a PDE. Let's say the field to be estimated is $\theta$. The conventional approach would be to use a finite element discretization for $\theta$ and add a Tikhonov regularization term to the objective functional in order to penalize unphysical values. Instead, ...
I'm teaching an introductory course on scientific computing (programming in C/C++) and am looking for application problems which the assignments can be centered around. I'm thinking of ODEs for particle dynamics $$x_i'(t) = u(x_i, y_i, t), \quad y_i'(t) = v(x_i, y_i, t)$$ where particle positions $x_i(t), y_i(t)$ are s...