instruction
stringlengths
43
28.1k
Quite a small scale question but I have gotten myself confused. Inside Ansys Fluent I am simulating a wing at different angle of attacks, instead of rotating the airfoil I have rotated the inlet velocity, into its X and Y components as such that the flow will enter from a slight angle below the airfoi like so. which w...
In the 2016 SIGGRAPH notes on MPM the authors explain how to do an implicit update in section 11.4 throguh by this formula: It is not clear to me what the $j$ is over in this case (for eq 202), is it over the velocities of all grid nodes? Or is it just over the velocities of the nodes in a local neighborhood or over s...
== I have been trying to write an input file for lammps to simulate the shape transition of a nanoparticle of silicon using multiple potentials to obtain the best structure, which I will compare with a density-functional-theory simulation results. However, I have encountered an issue with the structure of the nanoparti...
I have the following computation I'm trying to program and accelerate with the FFT. $$ \phi(x) = \sum_{y \in Y} K(x, y) q(x), \> \> \forall x \in X $$ Where $X$ and $Y$ are sets of Cartesian coordinates in 2D. and $K(x, y) = \frac{1}{2\pi} \ln(\sqrt{(x_1 - y_1)^2 + (x_2 - y_2)^2})$. I want to accelerate this convolutio...
The following is the well-known nonlinear differential equation for director's distribution at static equilibrium in liquid crystal displays(LCD). I want to obtain weak form of the given differential equation for FEM simulation. $(\epsilon_{\parallel} - \epsilon_{\perp}) E^2 sin(u) cos(u) + (k_{3} - k_{1})sin(u)cos(u) ...
I'm very new to finite difference method and I am just introduced to methods of solving differential equation using finite difference method via sparse matrix method. I find that the main idea is to approximate the differentials by central differences and writing the differential equation at different points in domain ...
Velocity Verlet is often held to far more accurate than forward Euler while being no more expensive. Technically, this requires some degree of regularity on the potential. But, is there a convincing example of a potential for which Velocity Verlet will be no more accurate than forward Euler?
I am asking these terms as used in the following link. I understand k-neighbor but not k neighbor global scale. When I used CGAL it for the 10 points 0 to 9 on x-axis(That is (0,0,0),(1,0,0),....(9,0,0)), it reported, Global K scale = 6; Global range scale was 3. But I don't understand why. https://doc.cgal.org/latest/...
Suppose you have a set of N random integers. ( aka bytes 0..255 ) You then consider each subsequent neighbor as "ascending" or "descending", counting the number of consecutive neighbors who are also of the same kind. ( i.e. 1234 is a "run" of 3 ascending neighbors; 123431 is a ascending run of 3 followed by a descendin...
The Taylor-Maccoll equations below govern the gas dynamics around a supersonic, axially oriented cone. Using the notation from Anderson's Fundamentals of Aerodynamics, which uses a dimensionless variable $V^\prime$ which can be found with: $$V^\prime = \left[ \frac{2}{(\gamma -1) M^2} + 1 \right]^{- \frac{1}{2}}, \\ V...
I wish to solve the following equation, $$\frac{\partial f}{\partial t}=\frac{\partial}{\partial x}\left(D(x)\frac{\partial f}{\partial x}\right)$$ using an exponential integrator. I discretize this equation in the following way, $$\frac{\partial f}{\partial t}=\frac{D_{i+\frac{1}{2}}\frac{f^{n}_{i+1}-f^{n}_{i}}{x_{i+1...
after searching in the python numpy, scipy and sklearn module, there is no function who can generate p samples of a gmm (gaussian mixture model) for parameter means, covariances and the weight of each multidimentionnal gaussian of dimension n. Any clue or guidance please to generate that ? Thank you for your time
I am trying to solve 2D heat equation using the physics-informed neural networks approach. The training loss is decreasing, but my final network outputs make no sense. I am using Python/Pytorch. 2D heat equation: $$\frac{\partial u}{\partial t} = \alpha \left(\frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\par...
I would like to solve the following equation, $$\frac{\partial f}{\partial t}+\frac{\partial}{\partial x}\left({\mathcal A}f\right)=S(x,t)$$ where $f$ is a function of $x$ and $t$, ${\mathcal A}$ is a function of $f$ and $S$ is a source independent of $f$ but depends on $x$ and $t$. My problem is I can find second orde...
Various literature and library implementations like petsc use preconditioners based on simple smoothers that themselves could be used the solve the systems directly. e.g. say I have a function void do_jacobi_smooth(const matrix A, vector x, const vector b); which updates $x$ for the system $Ax=b$. Say I have a system ...
I know the strength of attraction for a single attractor might vary from place to place. Say, if I calculated the Lyapunov exponents for a small portion of the attractor and they have already converged, is it possible that they could diverge again had I followed that same trajectory longer such that it has traversed mo...
What would be the courant condition for the following diffusion equation, $$\frac{\partial f}{\partial t}=A(x)\frac{\partial}{\partial x}\left(D(x)\frac{\partial f}{\partial x}\right).$$ For $$\frac{\partial f}{\partial t}=\frac{\partial}{\partial x}\left(D(x)\frac{\partial f}{\partial x}\right)$$ I know the courant co...
Consider a simple ODE system describing the evolution of two chemical species undergoing the reaction $A = B$ : $$ \frac{dn_A}{dt} = - k * n_A $$ $$ \frac{dn_B}{dt} = k * n_A $$ We can discretize that system and solve it using any classical numerical scheme (e.g. implicit Euler). However, I can also recast that syste...
Suppose that we are given a random, symmetric matrix $A$, and a random vector $q$. For concreteness, assume the dimensions of $q$ and $A$ are both $1,000$. I would like to use the Lanczos algorithm to compute the tridiagonal matrix, $T$, which is uniquely defined by $A$ and $q$. I don't necessarily need access to the e...
I'm trying to solve the problem where $u_n$ and $v_n$ are sequences that converge to the solution $u$ and $v$ and $\lambda$, $\sigma$, $f$ and $g$ and K_lambda are all given. I thought of using the scipy module integrate with a while loop, but obviously I don't know how to implement the condition of convergence. I als...
The definition of convergence for root finding algorithms is given in a few sources as: A sequence ${x^k}$ generated by a numerical method is said to converge to the root $\alpha$ with order $p\geq 1$ if: $\exists C > 0 : \frac{|x^{(k+1)} - \alpha |}{|x^{k} - \alpha|^p}\leq C \qquad \forall k \geq k_0$ Where the order ...
I'm trying to code a fixed-point method to solve the following system using scipy.integrate $$ u_{n+1}(s)=\int_0^TK_\lambda(t,s)\left(\lambda u_n(t)+\sigma(t)+f(t, u_n(t),v_n(t))\right)dt\\ v_{n+1}(s)=\int_0^TK_\lambda(t,s)\left(\lambda v_n(t)+\sigma(t)+g(t, u_n(t),v_n(t))\right)dt $$ while n<N or err>epss: u = [inte...
I have been trying to perform some global optimization with SciPy optimizer SHGO and I've had issues with the sampling method 'sobol'. Specifically, I get an error of the type: TypeError: <lambda>() takes 1 positional argument but 3 were given. The thing that makes me suspect it may be related to something wrong with...
The ARPACK manual for znaupd on pp. 128–129 says: Mode 2:[...] OP = inv[M]*A and B = M. [...] IDO = 1: compute Y = OP * Z and Z = B * X where IPNTR(1) is the pointer into WORKD for X, IPNTR(2) is the pointer into WORKD for Y, IPNTR(3) is the pointer into WORKD for Z. I interpret that as: When IDO=1, compute the matr...
I tried to compute the value of the following expression in Matlab: $$ 2^l\sum_{i=0}^{n-1}{N\choose i}\varepsilon^i(1-\varepsilon)^{N-i} $$ where $N=16272$, $n=499$, $l=107$, $\varepsilon=0.02$. I tried to use nchoosek(n, k) but I got warnings of “Result may not be exact. The coefficient has a maximum relative error o...
I'm looking for the reference of the high explosive material model in LS-DYNA, which is represented by keyword MAT_HIGH_EXPLOSIVE_BURN. The theory manual has an entry for this material model but it is quite vague and does not point to a good reference. Does anyone know a good literature behind it?
I've created a JavaScript file to execute and log average energy and magnetization values of 2D lattice classical Heisenberg model. I run the simulation with parameters, L=32 (Number of atomic spins on each side of the lattice) N=L*L (total number of spins) J=1 (exchange constant) T=0, 0.25, ..., 4.75, 5.00 (temperatu...
I tried to solve the 2D heat equation with the finite element method, using triangles as elements. Currently generated by a Delaunay triangulation. The base function I'm currently using is basically just the first barycentric coordinate. Assuming a triangle with $a, b, c$ as vertices: $$ f(x, y) = \frac{(b_y - c_y) (x ...
I am trying to have a Python code for the following nonlinear BVP: $$\frac{\partial N}{\partial t}=\frac{\partial^2 N}{\partial x^2}+N(1-N)-\sigma N$$ $$N(0,x)=\sin(2\pi x)$$ $$N(t,0)=0 \hspace{3mm}N(t,L)=0 \hspace{1.5mm};\hspace{2mm}t>0,0<x<L.$$ Without the non-linear part I discretize with explicit FTCS method. $$\fr...
I have a $D$-way tensor of dimensions $n\times n \times \dots \times n$ $(D)$- times. I want to sum the First vectors in all directions. For example, let $\boldsymbol{H}$ is 3-way tensor of dimensions $n \times n \times n$. Then the desired output, $Res = \boldsymbol{H}(:,1,1)+\boldsymbol{H}(1,:,1)'+reshape(\boldsymb...
I am trying to understand the basic LOBPCG algorithm, as used in popular python libraries, primarily from the suggested resource on wiki. LOBPCG involves a subroutine to compute the coefficients of the orthonormal basis. This computation is equivalent to another eigenvalue problem; it is equivalent to finding the optim...
from sympy import * from sympy.abc import A,B,C,D,E,F,x,y,U,V,W,X,Y,Z curve = A*x**2+B*x*y+C*y**2+D*x+E*y+F Now that we know such codes above will form the polynomial curve like $$A x^{2} + B x y + C y^{2} + D x + E y + F$$ However, the six terms of the polynomial are sorted only relevant to the upper cases. To be su...
Let us say that I have a $3 \times 3$ matrix $\bf X$, that has to be reshaped into a vector and rearranged as follows: $$ {\bf v} ({\bf X}) = \begin{bmatrix} x_{22} & (x_{23}+x_{32}) & (x_{21}+x_{12}) & x_{33} & (x_{13}+x_{31}) & x_{11} \end{bmatrix} $$ where the indices indicate the position of the elements in the ma...
Currently, I use Eigen3 for linear algebra operations on sparse matrices and either UMFPACK or CHOLMOD from SuiteSparse to solve sparse linear systems. However, as my model grows larger and the need for iterative methods to solve nonlinear equations arises, I am facing a bottleneck in the code's performance, particular...
Hypothetical question for some code that I'm writing. Suppose I have an matrix-free linear operator $A$, i.e. the only thing I know about it is the forward action $v \mapsto Av$. For simplicity, let's further assume that $A$ is symmetric positive definite. Are there any methods that would allow me to generate a 'decomp...
The real-life problem Assume I put a spherical roast with initially constant temperature of start_temp=25 (°C) into an oven with oven_temp=80. A meat thermometer is inserted at the core. At what time will the roast be ready, i.e. at target_temp=57? No discussion about rare or well-done, please, this is serious science....
So far, I have been looking into linear and nonlinear differential equations(Boundary value problem) that look like the following: $\frac{d^2 \theta}{dz^2} + \sin(\theta) = 0$ I am now familiar with numerical methods of using finite difference or finite element methods to approximate the derivatives and Newton's method...
I'm trying to write a very simple simulation of volume/water displacement. Every timestep a sphere gets lowered a bit further into a cylindrical container filled with water. While the physics behind this should be quite clear, I just can't wrap my head around how I would go about calculating the change in water height ...
For a FEM simulation of a Neo-Hook solid model, how do we know we are in the "regime" of nonlinearity of the solid? In other words, how do I know the hyperelastic material law is really used, and not just a needless additional computational cost because it can be modeled with a linear elastic Hook law. Following these ...
How or where can I find the mass matrix of a 10 nodes tetraedron element for FEM computation? Every nodes has 3 dof (x,y,z) so that the element has 30 dof. The Stiffness Matrix is a 30x30 matrix and the Mass matrix should have the same dimensions
What is the name of the numeric data type where a float has its exponent bits replaced with another floating point value to use as the outer float's exponent? This is a tip-of-the-tongue problem, as I recall having a casual conversation with a friend of mine on exotic data types. A normal float may be constructed from ...
The data type is a doubly unsigned float. This is where the value and exponent are both strictly positive. The range of this number should include $0$ and $[1, ~2^{\text{exponent}})$, skipping all values between 0 and 1. My use case for this would be implementing a certain incremental game (Cookie Clicker) for an older...
I'm trying to use this method Plot 2D piecewise constant in matlab in a finite elements mesh for my data. However, I have problems with the values of n1, n2 and n3. I guess this is why it doesn't show a figure for what I have written. What values would be appropriate for n1, n2, n3?
The Stokes equations are $$-\Delta \mathbf u + \nabla p = f \text{, in }\Omega,$$ and $$ -\nabla \cdot \mathbf u = g, \text{ in } \Omega$$ where $\mathbf u = \left( u, v \right)$ is the flow velocity, and $p$ is the pressure. I tried to solve the equations by the finite difference method and marker-and-cell scheme, a...
I have a silly question. Is it always more computationally efficient to use iterative methods to solve for some matrix $A$, $Ax=b$, where $x$ and $b$ change but $A$ stays constant, compared to computing the inverse $A^{-1}$? The rationale for computing the inverse would be that after computing the inverse it can be reu...
I've been working with Tensor calculus using the Python module PYTEARCAT. (See: https://arxiv.org/abs/2106.15016 and https://github.com/pytearcat/pytearcat.) It calculates quantities such as the Ricci curvature and Einstein tensor from a metric tensor, and this part works just fine for me. However, I can't seem to find...
Correct me if I am wrong, but I take it that people actually think the classic Lorenz system is fully characterized, i.e. we know what the attractor looks like and the various fractal dimensions of it, and it's always (with all parameters fixed; no bifurcations) going to be deterministically chaotic (with a thin fracta...
I am comparing reflectance intensity of silicon structure with a hole. I am getting oscillating solution for 0 roughness factor in equation based model. but spectrum shape of fdtd and equation based model solution starts matching if i increase the roughness factor. does this mean there is some default roughness factor ...
I was attempting to solve the diffusion equation for a solid sphere using a naive FDM scheme. The governing PDE for the scalar concentration field $u(r,t)$ is $$ u_t = r^{-2}(r^2 \alpha u_r)_r, \quad r \in [0,1], $$ and is accompanied by the boundary conditions $$ u_r(0,t) = 0, \quad u(1,t) = 0 $$ The initial condition...
Consider a high-dimensional ODE, which comes from semi-discretization $$ \frac{d\mathbf{u}}{dt} = f(\mathbf{u}), \qquad \mathbf{u}\in\mathbb{R}^N \tag{1} $$ If we want to build Reduced Order Models (ROM), we typically say $$ \mathbf{u} = \mathbf{u}_{ref}(\mathbf{x}) + \mathbf{\Phi}{\mathbf{\hat{u}}}, \qquad {\mathbf{\h...
I want to sample from a bounded space, say $[0,1] \times [0,1] \in \mathbb{R}^2$. I have read about a so-called grid walk that fixes a starting point $x_0 = (x_{0,1}, x_{0,2})$ and then proceeds via $x_{t+1}= x_t + \epsilon_t$ for MC draws indexed by $t$. What is the advantage of this scheme relative to sampling like $...
I am trying to solve numerically the flow of a gas through a porous, spherically symmetric body. The non-dimensional equations read: $$ \frac{\partial\rho}{\partial t}+\tau\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\rho v\right)=g_P\\ v=-\frac{\partial \rho}{\partial r}\\ $$ where $\rho$ is the gas density, $t$ t...
I am using Spectra to iteratively solve large-scale eigenvalue problems. I like it because it readily works on windows, and is header-only. I would like to know if it supports complex-valued matrices. Here is a list of eigensolvers that lists Spectra and says it supports both real and complex problems. But the API Docu...
Given a matrix $P\in \mathbb{R}^{n*k}$ (just for ease of notation, no matrix or linear algebra is actually needed; bound to $(0,1)$ if necessary), select one number from each row and compute the sum. Find the choice that the produced sum is closest to a given number $x$. $$ \arg\min_{1\leq j_1,\cdots,j_n\leq k}{|x - \s...
I am interested in solving the following minimization problem: $$ \begin{array}{cl} \displaystyle\min_{x,y}&\displaystyle\frac{1}{K}\sum_{i=1}^{K}\left(\frac{x_{i}}{y_{i}}-\frac{X}{Y}\right)^{2} \\[0.4cm] \mathrm{s.t.}&\sum_{i}x_{i}=X \\[0.2cm] &\sum_{i}y_{i}=Y \\[0.2cm] &x_{i}\leqslant y_{i},\quad i=1,2,\ldots,K \\[0....
Currently, I'm working on a mechanical mechanism where nodes are connected via beams. This is very comparable to planar truss mechanism analysis, but in my case, the deformations are large (relative to the mechanism). Instead of deforming beams, for which Hooke's law is often used, my beams act as (linear) springs, whi...
For a hyperelastic problem, I understand the variational formulation can be written as the minimisation of $\Pi$ with $\Pi = \int_{\Omega} \psi( \pmb{u} )dx - \int_{\partial\Omega} \pmb{T}\cdot \pmb{u} ds$ With $\Omega$ the reference configuration, $\pmb{u}$ the displacement, and $\pmb T$ the traction force on the ref...
I'm working on a research project with my professor where we're trying to figure out how to determine the necessary semiconductor composition for a solar cell to have a particular bandgap in order to maximize the power efficiency. Specifically, we're attempting to simulate the effect of using alternating layers of AlG...
I have the following quadratic problem: $max$ $a^Tx+0.5x^TAx$ $s.t: 1^Tx=1$ in which $a=[a_1, a_2,...,a_n]$ is a non-negative vector, and $1^T=[1,1, ..., 1]$. The hessian matrix $A$ has the following structure: \begin{bmatrix} -n\alpha\beta/a_1&\beta_{12}&\beta_{13}&...&\beta_{1n}\\\beta_{21}&-n\alpha\beta/a_2&\beta...
I want to write a function $f$ and it is defined as $f = - \nabla \cdot(|\nabla u|^{p-2} \nabla u) $ and I exact solution $u(x) = \tilde{u}(r) = 1 - \frac{p-1}{p-2} \left( s^{p/{p-1}} - (1-s)^{p/{p-1}} + 1 - \left(\frac{p}{p-1}\right)s \right)$ if $r<R$ and 0 if $r \geq R$. The following is the code block where I defin...
I'm currently working on the 3-body problem, and I was writing a code to plot the trajectories of all 3 bodies while also manipulating the angular momentum of the system. I found a code online and tweaked it a little bit to match what I want. I was successful in plotting their trajectories; however, I couldn't measure ...
I've been trying to create a box mesh in gmsh with a structured and refined layer in the middle, here is the .geo code for it: lc = 100.; Mesh.CharacteristicLengthFromPoints = 1.; Mesh.CharacteristicLengthExtendFromBoundary = 1.; Mesh.CharacteristicLengthFromCurvature = 1.; Mesh.CharacteristicLengthMin = 10.; Mesh.Char...
I am trying to do a 2D simulation of the classical XY model in order to observe vortexes in the system. I am not really interested at the moment in calculating variables such as Magnetization because i am struggling to evolve the model. Probably because of the update step misinterpretation. Here is how i proceed, keepi...
I've been searching the whole afternoon for some documentation or code sample showing how to assemble a sparse matrix of a problem to be solved with PaStiX, but couldn't find any. The relevant module seems to be SPM, but its documentation is missing in the manual. Besides, the official examples load a matrix from disk,...
I've just started a project, trying to do simulation of electrodynamics using the well-known Maxwell equations: $$ \nabla \cdot \mathbf E = \rho \\ \; \\ \nabla \cdot \mathbf B = 0 \\ \; \\ \nabla \times \mathbf E = -\frac{\partial \mathbf B}{\partial t} \\ \; \\ \nabla \times \mathbf B = \mathbf J + \frac{\partial \ma...
I want to understand how important it is that I learn to write decent C++ code, for the sake of a career in scientific computing (FEM, fast solvers, etc). By this I mean that I want to acquire skills that are in demand and that are reusable. From what I hear, C++ is difficult to master, and I imagine that once I know h...
I'm currently playing with the surface mesh parameterizations of the C++ library CGAL. For a mesh with a boundary, the computed uv-space (parameterization domain) is either a disk or a square, and so it is easy to deal with. I use the parameterization to map a texture to my meshes, for example a checkerboard: But for ...
I want to simulate 1D diffusion with a constant diffusion coefficient using the Crank-Nicolson method. $$\frac{\partial u (x,t)}{\partial t} = D \frac{\partial^2 u(x,t)}{\partial x^2}.$$ I take an average of the approximations at the points $(x_i, t_j)$ and $(x_i, t_{j+1}):$ $$\frac{u_i^{n+1} -u_i^n}{\Delta t} \approx ...
I have an msh file, which is generated from a third party software(Pointwise). The geometry is a complex cylindrical pipe like structure with lot of branches. I need to refine the mesh further only on the wall region alone. How can i do this, without an .GEO file for the corresponding mesh. ( The GEO file is also very ...
Is it possible to estimate whether automatic differentiation (AD) techniques could enable a more efficient way to repeatedly compute the derivative $\delta L / \delta u^*_{ij}$ of a specific loss function $L$ than using an analytic expression? Here, I consider the specific loss function, $$ L(U) = \sum_{n=1}^N (U^\dagg...
I've been trying now for quite some time to numerically solve the nonlinear water wave equation [Craig and Sulem, JCP (1993)] by using FFT to discretize the space. I present my code below. By testing different aspects of the code, I have narrowed down the problem to the implementation of Dirchlet-Neumann operator (DNO)...
I'm new to gmsh. I would like to produce a mesh of quads where some nodes are shifted. I managed to have construct a structured mesh of quads. However, I would like now to shift some of the points to produce the mesh i'm interested in as in the figure Can someone help me? or have any different idea on how to do this? ...
In the textbook definition of the stress tensor it is defined at each point in space and therefore position dependant. When three dimensional periodic boundary conditions are used, I have seen it often, that a stress tensor is given for the entire material which is of course not position dependent anymore. (Electronic ...
I am trying to generate the .pp and .cube file using pp.x -i (input file name) command. But, the .cube file is not getting generated and the output.log file also shows an error message. this is my pp.x input file: &INPUTPP prefix='cspbi3' outdir='relax-bulk' filplot='CsPbI3_pristine.pp' plot_num=11 / &PLOT nfile=1 file...
I am looking for a way to numerically solve the Naiver-Stokes equations for steady incompressible flow using FDM over a surface with various angles?
I have a very long time series $f(t)$ (hours) dataset taken at a very high sample rate (250 MHz) and would like to understand its frequency structure at many different frequency scales (from milli-Hz to 100 MHz). Naively taking a Fourier transform of the whole data would give unnecessarily noisy results (too many point...
The max-cut algorithm divides a graph into 2 subsets, for instance: While I understand the algorithm, I do not quite understand the meaning of the result. In the above picture, what does the groupings of black circles vs white circles mean? If these lines were internet connections between different locations, what do ...
I need to simulate magnetic field of corrosion in my project. How can we simulate two different module both magnetic field and cathodic protection in comsol.
I'm working on an orbital body simulation as a personal project. I understand that it's not going to be as good as professional software, but I'm wondering what contemporary, general purpose, iterative, professional software looks like. What kind of methods are used? How accurate are they? What kind of runtime efficien...
Let's say we have the the weak form laplace problem Find $u$ $\in$ $H^1$ what satisfies \begin{equation} \int_\Omega \nabla u \cdot \nabla v \, d\Omega = \int_\Omega f v \, d\Omega \end{equation} for all $v$ $\in$ $H^1_0$ To find an approximate solution we project on a subspace $V \subset H_1$. Let's say $V$ is the ...
In my reading on various aspects of FEM, Petrov-Galerkin methods often arise in the study of solutions of convection-dominated systems, such as Hughes' work on Navier-Stokes, or systems where optimal test spaces or test bases are desirable, for example, some of the discontinuous PG work of Demkowicz, and least-squares ...
This is my first time asking a question here, so please tell me if I have made a mistake or if anything is unclear. I am working on my high school research project on the motion of a ball falling through flowing water and derived eq. 1. $b$ is the height of the ball in the situation. This equation was derived by addin...
Considering the following COO sparse matrix format, with repeated indices: std::vector<size_t> rows{0, 0, 1, 2, 3, 4}; std::vector<size_t> cols{0, 0, 1, 2, 3, 4}; std::vector<double> values{2, -1, 2, 3, 4, 5}; that represents the matrix \begin{equation} \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 & 0 \\ 0 & 0 &...
Does anyone know good literature about thermal-hydro-mechanical (THM) coupling in Abaqus? In particular, I would like to know the theory behind the C3D8PT element. Thanks.
I'm not entirely sure whether this question belongs here or in DSP but I think this is the proper site. I'm following these videos (first video, second video) to calibrate a camera for photogrammetry using Scilab. The method is pretty simple but I can't get proper results. I'm not sure whether I have misunderstood some...
I’m currently developing a FDM/FVM (using contravariant coordinates) code using Fortran and Co-Arrays (SIMD, in general), and so far I have all sparse matrix (BiCGStab, working on AMG) solvers and data-structure (CCS) libaries developed and working (I think), but so far I haven’t come up with the correct abstraction fo...
I am trying to solve the Orr-Sommerfeld equation numerically, using the techniques given in this article. This leads to solving a generalized eigenvalue problem, that is, given two matrices $\mathbf A,\mathbf B$ with possibly complex entries, we would like to find a pair $(\lambda,\boldsymbol v)$ where both $\lambda $ ...
I am currently trying to solve Nozzle Flow problem from JD Anderson Book. Here's my entire python code - import numpy as np import matplotlib.pyplot as plt nx = 31 x = np.linspace(0,3,nx) dx = x[2] - x[1] gamma = 1.4 gamma_inverse = 1/gamma; nt = 20 cfl = 0.5 #initial profile rho = 1 - (0.3146*x) T = 1 - (0.2314*x...
I have a tridiagonal antiHermitian matrix ($-i*Hami*t$) with nonzero elements only along the upper diagonal and lower diagonal, and the goal is to know the action of exponential of such matrix on a given vector. Currently, I am using scipy.sparse.linalg.expm_multiply function in Python to check the action of a million ...
I need to solve a nonlinear ODE of the form $$ \frac{d^2 y}{dx^2} + \frac{1}{x}\frac{dy}{dx}-\frac{1}{x^2}\sin(y)\cos(y)+\frac{2}{\alpha}\frac{\sin^2(y)}{x}-\sin(y)=0 $$ numerically, subject to the boundary conditions $$ y(0)=\pi,\, y(\infty)=0 $$ I'd prefer to do this in python, but I'm having a lot of trouble zeroing...
I've coded a framework that can be used to simulate the dynamic behavior of a system discretized by particles (nodes) that are connected by spring-damper elements. However, I want to compare it to a method that directly solves the equilibrium position of such a discretized system. I've identified the Direct Stiffness M...
i am trying to write a julia code for linear elasticity in my case i dont have body force and traction but there is a nonzero drichlet bc(ubc) i want to engage the bc in weak form in linear part. is my linear and bilnear part as below a = ε(v) ⊙ σ(u) b = ubc * ε(v) ⊙ σ(v)
I am asking this here for the possibility that someone here is familiar with OpenMP offloading. Is there some other way to parallelise Fortran array operations outside of unrolling the loops of the array operations? I know for multithreading !$omp workshare seems to work but not for target regions. An example piece of ...
Page 460 of Numerical Optimization by Nocedal and Wright contains the following algorithm under the name projected conjugate gradient However, Jonathan Richard Shewchuk list what seems to me to be the same algorithm on page 46 of his classic "An Introduction to the Conjugate Gradient Method Without the Agonizing Pain"...
I am doing an MPM simulation of water colliding against a solid, I am currently encoding the model for collision forces and I am realising something isn't clicking. Let us assume the fluid experiences no friction from the solid itself, only viscous forces. The fluid we will assume has a density of 1 g/ml. The solid has...
I would like to know if the following discretization is correct. Here D is the dispersion, C is the concentration. Both D and C are varying with space. Here n+1 represents the unknown time level. I was trying to implement a second-order implicit finite difference scheme. After applying the product rule, I discretized ...
I have a physical function $f(x)$ which I intend to measure. Problem is that I cannot read it directly, but through a response function $g(x)$ which is known to me with great accuracy and any one measurement is actually a convolution $M(y) = \int f(x)g(y-x)dx$. What is known about $f(x)$ is that its sharply peaked arou...
Say that I have a generalized eigenvalue problem of the form $$Ax=\lambda Bx.$$ Using MATLAB, some naive ways that one may solve this is by either directly inverting $B$ then applying the eig function in order to compute the eigenvalues and eigenvectors, or simply applying eig to both matrices i.e. eig(A,B). The is...
So I have this code where I am designing a hollow hemispherical shape and I want to create a 3D volume to input it into FEBio software. I am using delaunay triangulation for meshing. But the problem is when I rotate to see the bottom, I am seeing is that there are triangles there of this 3D model as shown below How d...
I have a set of measurements $y_i$, $1 \leq i \leq N$, and I want to model these measurements with a linear model. I have two possible models I can use, $$ y \approx A c $$ and $$ y \approx B d $$ where $A$ is $N$-by-$P$ and $B$ is $N$-by-$Q$. The vectors $c,d$ are unknown coefficients that I would determine with a lea...