instruction stringlengths 43 28.1k |
|---|
I am trying to implement an algorithm to find the Jacobian ratio for each triangle in mesh as a part of mesh quality check.
Let's say that I have vertices of the triangle: $P_1(x_1, y_1, z_1)$, $P_2(x_2, y_2, z_2)$, $P_3(x_3, y_3, z_3)$. Having this data how to determine the Jacobian ratio of the triangle?
|
Does someone have a reference for the minimum number of elements (or maximum mesh size) for electromagnetic simulations where a mathematical or numerical explanation is given?
I have found several recommendations but alas no justification:
For instance, here at least 5 second-order elements per wavelength are recommen... |
I have solved numerically the following system:
\begin{cases}
\partial_t{u} + \partial_x{v} = 0 \\
\partial_t{v} + \frac{1}{\varepsilon^2}\partial_x{u} = -\frac{1}{\varepsilon^2}(v-f(u))
\end{cases}
with periodic boundary conditions by finite volume method (IMEX-Runge Kutta).
I was wondering if, as it happens in a lot ... |
I am new to octave and still learning what I can and cannot do with it.
I am asked to write a following function ('trigmin'):
[a, b, c, info]=tigmin(x,y)
Where x, y are vectors of the same length (let's say n) and the function output is the triple [a, b, c] where the triple minimizes the following expression
$$\sum_{i... |
The four-noded bi-linear rectangle element, which sometimes goes under the name Melosh element, is non-conforming unless the element sides are aligned.
Out of curiosity I have implemented this element for two-dimensional elasticity problems. The figure shows a mesh with three such elements. The element sides are not al... |
I have been solving problems of the form $$max \ log(det(A)) \\ s.t. \ A = A^{T} \succeq 0, \\ p_{i}^{T}Ap_{i} \leq b_{i}$$ where $b_{i}$ and $p_{i}$ are input vectors (to be clear there is more than one vector $b_{i}$ and $p_{i}$), using CVXPY and SCS. What I am finding is that the transformation into canonical form ... |
I recently found the following article where it was stated that using 16 bit numbers can be used to increase the computational performance of AI applications. According to the article numbers above 16 bit must be scaled to fit into the 16 bits.
Could this technique also be applied to solutions of linear system using i... |
I want to optimize a function w.r.t. $n$ circles parametrized by centers and radii:
$$\min_{C, R} f(C,R)$$
where $C\in\mathbb R^{n \times 2}$ and $R\in\mathbb R^n$. For example,
C[1,1]: x-coordinate of the first circle
C[1,2]: y-coordinate of the first circle
R[1] : radius of the first circle
While optimizing, I wan... |
We can numerically integrate first order differential equations using Euler method like this:
$$y_{n+1} = y_n + hf(t_n, y_n)$$
And with Implicit Euler like this:
$$y_{n+1} = y_n + hf(t_{n+1},y _{n+1})$$
If I have a differential equation $y' - ky = 0$, I can integrate $y$ numerically using Implicit Euler:
$$y_{n+1} =... |
I am trying to optimise a function, but the function can be noisy and give varying results for the same parameters. Furthermore, it needs to be online, as the data from each new iteration happens slowly (and begins with no data).
I have used gradient descent, which works sometimes, but even then not very well due to no... |
What numerical methods are used to model deformations in elastic physics? For example, here's an example of a hyperelastic deformation in Ansys:
Perhaps more simply than hyperelasticity, for linear elasticity, we have the equations:
$$
\nabla\cdot\sigma + {F} = \rho\ddot{{u}}\\
{\varepsilon} =\tfrac{1}{2} \left[{\nab... |
I have to use the leapfrog method to solve the simple harmonic oscillator and I having trouble writing it in code. This is what we were given in class
$$
\frac{v_{n+1/2}-v_{n-1/2}}{\Delta t}=-\omega_0^2x_n\\
\frac{x_{n+1}-x_n}{\Delta t}=v_{n+1/2}
$$
This is what I have written for the code
import numpy as np
import mat... |
I really have a problem here. I have not found a solution yet. The system I need to solve similar to this:(Basic idea)
$$c_1 = \dfrac{dx}{dr}+y$$
$$c_2 = \dfrac{dy}{dr}+x$$
Both $c_1/ c_2$ are equal to 0 meaning the desired system is:
$$\dfrac{dy}{dr} = -x$$ and $$\dfrac{dx}{dr} = -y$$
The ODE system I wanna solve is t... |
I've got a question about a good way to find the quickest algorithm for my problem:
problem:
I've got a 3D cubical grid containing voxels that are either 1 or 0. It is stored as a flattened array. If multiple 1-voxels are neighboring each other, they form a cluster together.
I want to detect clusters smaller than a giv... |
In solving nonlinear hyperelastic solid mechanics problems, to converge to the correct solution we need to do step-by-step loading which makes the deformation at each step very small (for my particular problem $\mathcal{O}(e^{-11})$). Moreover, due to the material properties, the nonlinear weak form and consequently th... |
I have numerical issues with a poorly scaled one-dimensional non-linear diffusion equation in physical co-ordinates
$$ \frac{\partial{u}}{\partial{t}}(x,t) = \frac{\partial}{\partial{x}}\left(D(u) \frac{\partial{u}(x,t)}{\partial{x}}\right)$$
$$x \in (0,L),\ t \in (0,t_\text{f}) $$
with initial conditions
$$u(x,0) ... |
I know there is efficient way to construct chebyshev differentiation matrix $D_N$. The idea is to fit the function $f(x)$ with a polynomial of $p_N(x)$ of order $N$, and use the derivative $p_N'(x)$ to approxiate $f'(x)$ at chebyshev points $x_0,..,x_N$.
I wonder if we know f(x) is an even function on $[-1,1]$, and we... |
I wrote some FEM code and found some strange results when using a very small time step. So, I decided to analyze the discrete equations.
Consider the following linear diffusion problem in 1 dimension:
\begin{equation}
\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2}
\end{equation}
where k is a positi... |
I am reviewing stability of finite difference methods. I am using the von Neumann method to study a linear PDE and an explicit finite difference scheme. The goal is to develop an expression for an amplification factor $G$.
I've read that if $G$ is a complex function it can be plotted in the complex plane to more easily... |
I would like to use full approximation scheme(FAS) for solving nonlinear PDE. I am looking into practical implementation of FAS in parallel(MPI) settings. I noticed the most common/effective smoother choice is GaussSeidel-Newton iteration. Are there any other possibilities? Are there any parallel variants of GaussSeide... |
I've the following system of equations for studying information flow in the below graph,
$$ \frac{d \phi}{dt} = -M^TDM\phi + \text{noise effects} \hspace{1cm} (1)$$
Here, M is the incidence matrix of the graph
$\phi$ is a vector with variables [ A B C D E F].
I've solved the above ode's to obtain the time series d... |
Given the following code, how can I perform a mesh generation around the line, to make a 2D form in GMSH API? Extrude or Mirror functions? I want to add a mesh around the line, for example, 1cm to left and 1cm to right.
#include <gmsh.h>
int main(int argc, char **argv)
{
gmsh::option::setNumber("General.Terminal", ... |
I'd like to simulate the propagation of a pulse, and have different options for solving that.
On the one hand, I can use the non-linear schrödinger equation
$$\partial_zE=\frac{i}{2k_0}\nabla^2_\perp E$$
with $k_0$ the propagation constant. I can solve it either in the cartesian coordinate system (using a fourier trans... |
(I previously asked this question on Sage's dedicated Q&A site, but got no response, so I figured it would be worth trying here.)
I have a way of constructing hyperplane arrangements in Sage, which involves taking the restriction of a larger arrangement to one of the hyperplanes in it. I want to output a list of the si... |
I have a little trouble formulating my question since I am not really sure what conclusions I am supposed to draw from the results I have obtained. I am sorry for the long problem formulation below, but I will keep it as short as possible. I was given a general scheme,
$$
U^{n+1} = Q(t_{n})U^{n} + \Delta t F^{n},\\[3mm... |
I am simulating the behaviour of a single bar composed of two node points by fixing one point and applying a force on the oder node with $F_x = 1$ and fixing $u_y=0$. I am assuming the material to behave elasto plastic with isotropic hardening.
My loading simulation for $F_x = 0$ to $F_x = 1$ with increment $1/10$ see... |
In my research department we plan a small seminar on the new c++20 language standard. There are exhaustive lists online presenting the new features of the language standard, some of which will be of interest to this community, some will be inconsequential.
I think I understand the advantages of:
concepts (wiki) - c... |
I have
$$S = QLQ^T$$
I know $Q$, $L$, $Q^T$.
How can I get the $R$ and $R^T$ for the Cholesky decomposition $S=R^TR$?
|
I am attempting to numerically solve the following system of ODEs:
$$\begin{gather}\frac{dT_1}{dt} = f_1(T_1,T_2), \quad T_1(t=0)=T_{1,0} \\[3pt]
\frac{dT_2}{dt} = f_2(T_1,T_2), \quad T_2(t=0)=T_{2,0}\end{gather}$$
The functions $f_1$ and $f_2$ have $T$ and $T^4$ terms and therefore are non-linear. I tried the forward ... |
For context, I'm creating a linear algebra library from scratch for learning purposes in C. Right now I'm working on calculating eigenvalues but my implementation of the QR Algorithm is diverging. Below is my understanding of the QR Algorithm, and after the first block of code is (what I believe to be) the meat of the ... |
How do I get an .inp file from Gmsh? I need to create a simple geometry and mesh it and define the boundary conditions in Gmsh and export it as an .inp file at the end (because I need to use it in a third party solver). I couldn't find much help from the documentation of Gmsh it seems there exists a mesh file format in... |
This is a follow-up to my previous question here
I've the following system of equations for studying information flow in the below graph,
$$ \frac{d \phi}{dt} = -M^TDM\phi + \text{noise effects} \hspace{1cm} (1)$$
Here, M is the incidence matrix of the graph
$\phi$ is a vector with variables [ A B C D E F].
I'... |
import cvxpy as cp
import numpy as np
n = 3
PP = cp.Variable((n,n),"PP")
KK = [[2,1,3],[1,2,1],[3,1,2]]
s = np.array([[.1, .4, .5]]).T
t = np.array([[.4, .2, .4]]).T
e = np.ones((n,1))
x = PP.T@e - s
y = PP@e - t
for b in range(1,21):
obj = (1/4/b) * (cp.quad_form(x,KK) + cp.quad_form(y,KK)) - cp.trace(KK@PP)
... |
Take a Fredholm integral equation
$$
u(x) - \lambda \int_{-1}^{1} K(x,y)u(y) \, \mathrm{d} y = f(x)
$$
and discretize it via (say) Gaussian quadrature with nodes $\{x_j\}$ and weights $\{w_j\}$ to get
$$
u(x) - \lambda \sum_{j} w_j K(x,x_j)u(x_j) = f(x)
$$
It feels natural to use the same set of quadrature nodes over $... |
I am working on 2D Ising model, when I plot "specific heat vs temperature", I can't see any discontinuity at critical temperature around Tc ~ 2.7K. I am enclosing results of all other thermodynamic quantities, which are correct except the specific heat.
Edit 1:
As asked by @Daniel Shapero, I ran the simulation for 64 x... |
Consider the PDE $$u_t = b_{11}u_{xx} + 2b_{12}u_{xy} + b_{22}u_{yy},$$
where $b_{11}, b_{22} > 0$, and $b_{12}^2 < b_1b_2$.
In Strikwerda's book, the ADI scehme \begin{align*}
\left( 1 - \frac{k}{2} b_{11} \delta_x^2\right)v^{n+1/2} &= \left( 1 + \frac{k}{2} b_{22} \delta_y^2\right)v^{n} + kb_{12} \delta_{0x} \delta... |
I am working with the Shallow Water equations that is a system of non-linear PDEs that simulate water waves propagation on some domain, in my cases the $x$-axis. I have here a GIF showing the results (is it possible to insert the GIF into the post? Because I have not figured out how). I will try to keep it short and wh... |
This is a follow up to my previous post here
I'm interested in performing trajectory optimization from the problem mentioned in abov link.
I want to supply the following as dynamical constraints to MATLAB's fmincon.
$$ \frac{d \phi}{dt} = -M^TDM\phi + W \hspace{1cm}(1)$$
$\phi$ is a vector with variables [ A B C D ... |
I have to compute the mass matrix of a Hexahedral mesh.
There are 3 methods to compute mass matrix. I'm interested in one method which consists of dividing the mass of the element by the number of nodes and attributes this mass at each node for each degree of freedoms.
My problems is that: I don't know how to compute t... |
I am trying to solve the time-independent Schrodinger equation in two dimensions via discrete matrix diagonalization. I want the energy eigenvalues and the corresponding eigenfunctions for a given potential.
Eventually I want the solutions for the following potential (although as shown later I can't seem to get it wor... |
I am trying to implement the algorithm contained in this article here. It is about solving a 2 and 2.5D Fredholm integral, focused on bidimensional NMR experiments. I've made significant progress, despite this being my very first time doing any computational science. The output I get is clearly wrong, but seems shifted... |
My goal is to find all eigenvalues (and eigenvectors) in a given range of magnitudes of a complex symmetric matrix with real off-diagonal elements (only diagonal elements are complex). Currently I'm using PARPACK for non-hermitian matrices and discard eigenvalues outside of the window of interest, but this method is mo... |
I am trying to simulate a 3D Ising spin system (+1 & -1) using Monte Carlo Metropolis Algorithm. I want to get different physical quantities from this simulation like magnetization, Average Energy, Susceptibility, Specific Heat. I have used exactly similar code for 2 dimension that gives perfect result but for 3D it fa... |
i am working on an assignment problem:
Consider a two-dimensional rectangular plate of dimension L = 1 m in the x direction and H = 2 m in the y direction. The plate material has constant thermal conductivity. The steady-state temperature distribution within this plate is to be determined for the following imposed boun... |
I'm trying to solve an ODE problem. Let's say $\mathbf{x}(t)$ represents the position of a particle at time $t$, and $\mathbf{u}(\mathbf{x},t)$ is a velocity field defined in Cartesian coordinates on some manifold $\mathbb{M} \subset \mathbb{R}^3$ represented as a level set of the form $F(\mathbf{x}) = 0$. Then, the pa... |
I am doing a Monte Carlo Simulation of the properties of a 3D Ising Spin system. I want to get the free energy surface of the spin system from the simulation. It is a magnetization vs free energy curve. Free energy is defined as F(m)=-kT ln(P(m)) where m is magnetization and P is the probability of occupying the corres... |
I am simulating a Lennard-Jones fluid using MC simulation. The code always uses a reduced unit. I want to find the potential energy of the system. Periodic boundary condition implemented. I have simulated with 2 particles to find out if the simulation gives correct result. For 2 particles the equilibrium separation is ... |
I want to estimated the parameters $\ \hat{\theta} $ of a model using an iterative search for the minimum of a cost function. The cost function is defined as follows:
$$ V_N(\hat{\theta}) = \frac{1}{N}\sum_{i=1}^N(y(t_k)-\hat{y}(t_k|\theta))^2 $$
where $\ y $ is the output of the system and $\ \hat{y} $ is the estimate... |
I am using LeVeque's book:
https://faculty.washington.edu/rjl/fdmbook/
Suppose I want to compute $u''$ using FDM with $\alpha=\beta=2$ (centered) so the FDM is
$$ u''=\sum_{m = - \alpha}^\beta a_mu(x_i+mh) $$
Before acutally determining the coeficients ($a_m$'s) can we say anthying about how what the maximum attainabl... |
Suppose I have a long, possibly infinite, sequence $x := [x_1, x_2, ...]$, and I want to use it to compute another sequence $y:=[y_1, y_2, ...]$ where each element is the sum of the last K elements of the input sequence. i.e.
$y_i = \sum_{j=max(1, i-K)}^i x_j$
The naive, inefficient way to do (in Python) this would be:... |
I'm recently studying for the spectral solver to implement EM-PIC code. I read an article and have some questions.
Many PIC codes uses spectral solver to overcome numerical artifacts on FDTD.
In the high-order approximation of spatial derivative in PSTD and PSATD scheme,
$$
\partial_{x}E_{x}|^{n}_{i,j,k} = \Sigma_{l=0}... |
Suppose to calculate the continued fraction expansion of $\pi$, the common-sense algorithm would be to take the decimal part, perform inversion, which will give the next term as integer part, and the process is repeated for the decimal part.
However, this algorithm has the complexity of order $\mathcal O(n^2\log(n))$ a... |
Suppose there are two arrays (They have the same length), I want to give a quantitative description about the similarity between them. I define a formula like this, which means we can shuffle them arbitrarily. If we use the stupidest method, i.e. calculate every possible result, we need to keep array B unchanged and ke... |
I am trying to implement the algorithm in this article. I have already asked a question before about it here, and I am trying to figure out what I am doing wrong. This time, it's this section of the article that I am struggling with (bold part is mine).
[...] it can be shown that the vector $c_r$ that satisfied (29) c... |
A decade ago I saw a ~20 coupled state + random number problem that was used as a benchmark for meteorological CFD tools. It had a fractal dimension (of the chaotic attractor) around 2.3, I think. I saw matlab code for it.
I'm looking for the method now, and can't remember what it was called. To be clear it was enti... |
I am solving an optimal control problem of the form
$$
\min_u \qquad\int_0^T \langle u(t), u(t) \rangle \, \mathrm{d}t \\
s.t. \quad \dot{x} = \tilde{f}(x) + u, \quad x(0)=x_0 \\
\qquad \tilde{\Phi}(x(T)) = 0\}
$$
reformulated as
$$
\min_{\xi(T)} \qquad \xi(T) \\
s.t. \quad \dot{z} = f(z,u), \quad z(0) = z_0 \\
\qquad... |
I have two sparse general matrices stored in CSR format I need to multiply. Is there any chance to gain performance using AVX2? In general the matrices are big (hundreds of millions of non-zeros and sizes by about 3million x 3million). The number of non-zeros per matrix line should be sufficient but I am not sure if th... |
I'm looking to learn C++ primarily from a scientific computation perspective. The approach of the textbook seems ideal to me as it covers C++ from first principles with an emphasis on numerical computation.
However, the textbook was published in 2001. Will studying from this textbook teach me methods which are now not ... |
I've encountered a program where np.tensordot was used, so I tried looking it up but I can't really understand what this function is doing...
I feel rather confident in my understanding of tensors in a abstract context (i.e. in pure maths/physics), but I don't really understand what this tensordot is supposed to do. I'... |
I'm looking for an open-source library for the generation of random n-dimensional orthogonal matrices in C++.
In python, it looks like such a function is available in the NumPy package. But I was not able to find yet a solution in C++. Any suggestions?
|
I tried to generate 3 very simple cylinders, each other connected to it end, however the cylinder get connected to an unexistent point in space as the image shows:
It was supposed to each segment be 45º, 90º and 60º of inclination.
The code:
#include <gmsh.h>
int main(int argc, char **argv)
{
gmsh::initialize()... |
Between the two ears in the following bunny images, there are some degenerate triangles I want to detect. It looks like a volume-less thin slits.
If the question is not clear, please let me know.
|
How long should the hyperelastic equations be solved before updating the mesh? To be specific, I'm interested in the hyperelastic model with a neo-Hookean solid:
$$
\nabla\cdot\sigma + f = \rho\ddot{{u}}\\
\sigma = \mu F + (\lambda\log\det F - \mu)F^{-T}\\
F = I + \nabla u
$$
where
$\sigma$ - Stress tensor
$F$ - Defo... |
I am doing a molecular dynamics simulation of Leonard Jones 6-12 potential. But instead of converging to a particular value. It always stays between -5.58 to -5.62. The standard value is -5.517. The problem is that however long it runs (I have tested up to 30000 steps) it does not converge to even 1 digit after the dec... |
I am using the XMDS library for solving the stochastic (projected) Gross-Pitaevskii equation
$$i \hbar \partial \Phi\left(\mathbf{r},t\right)_t=\hat{\mathcal{P}}\left\{(1-i \gamma)\left(\hat{H}_{\mathrm{GP}}-\mu\right) \Phi+\eta\left(\mathbf{r},t\right)\right\}$$
where $\eta\left(\mathbf{r},t\right)$ is a stochastic no... |
I'm trying to solve the following equation with FVM
$$u_t + f(u)_x = g(u)$$
where $g$ is some smooth function of $u$ and $f(u) = \frac{u^2}{2}$. This is really similar to Burger's equation, except for the source term. My main problem is that I don't know how to derive correctly the numerical scheme since I have a sourc... |
I am trying to solve an ODE with solve_ivp, but I am getting strange errors.
Documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html
from scipy.integrate import solve_ivp as solve
import numpy as np
import matplotlib.pyplot as plt
def fun(t, y, beta, eps):
u = 1/eps * (-1... |
The classical Clenshaw recurrence (see Algorithm 3.1 here) is less accurate as $x\to \pm 1$. So Reich proposed a modification to it, which is discussed as Algorithm 3.2 as well as by Oliver.
While trying to derive a point of transition between the two algorithms I generated ULP plots for these two algorithms, and was s... |
I have been learning petsc recently and made a simple solver for stokes equation on 3D staggered grid.
My code is running on server with 200GB ram, but if I run a solver on 256^3 grid, memory used by the solver is over 200GB.
Checking with the -log_view flag, I've figured out most of the memories were used by the matr... |
I've successfully implemented a 1D DG code with non-normalized Legendre basis and I've now moved onto developing a 2D code using tensor products. For my 2D code I've chosen to have normalized Legendre polynomials,i.e.
$$
L_{0}(x) = \sqrt{\frac{1}{2}}\\
L_{1}(x) = \sqrt{\frac{3}{2}} x.
$$
My question is: If we normali... |
I recently read the paper "On Spectral Clustering: Analysis and an Algorithm" by Ng et al.
Much of the paper centers on Theorem 2 and equation 8.
To me, it appears there is no given or referenced proof of this Theorem.
I am hoping that someone can point me in the right direction to understanding the derivation of this ... |
We have a 3-dimensional grid of voxels (or cells), with individual voxels being of volume $dx\,dy\,dz$ where $dx=dy=dz=1$.
A cone-like surface is defined by some function, $z = f(x, y)$, which in this case is specifically (where $\epsilon$, $w_0$ and $r_0$ are constants):
$$z=\left(\frac{x^2+y^2}{w_0^2r_0^{-2\epsilon}... |
For sure, there has been many highly optimized library on this. But I am working on a matrix-free context since the problem size does not allow explicit storage of sparse matrix elements. I'd love have a general knowledge on how people handle this sort of problem, especially on how to alleviate the memory bottleneck.
... |
I'm a master's student in Math interested in Numerical Analysis. I know there are lots of questions like that on this site, but I think this is the best place to ask. So, I'm looking for an introductory book to C++ with a focus on scientific computing.
Let me clarify my situation: I've been an intensive Matlab user an... |
In the BFGS method we perform iterations by calculating an approximation $\boldsymbol{H}_k$ to the inverse Hessian $\boldsymbol{H}$ of the objective function. This method belongs to a family of methods in which $\boldsymbol{H}_k$ is guaranteed to preserve the positive definite nature of $\boldsymbol{H}$ for all $k$, pr... |
For a scalar quantity $u = u(x, t)$, I'm considering the transport equation
\begin{align}
u_t + au_x &= 0, \qquad{x\in[0, L], \ t\in[0, T]}
\\
u(0, t) &= u_{\text{in}},
\\
u(x, 0) &= f(x).
\end{align}
When $a$ is a constant, the Lax-Friedrichs scheme is the FTCS approximation given by
\begin{equation}\label{PDE}
u_j^{n... |
I have an integral of a convolution between two functions. How can I calculate this in Python? It is a continuum convolution.
|
I wasn't sure if this is a Computational Science SE question or a Stack Overflow question but I think it's more of this one.
I wanted to make a graph where I can rotate a hyperbola (not parabola or ellipse) about any point, not just the origin on a Cartesian Plane. This is the equation:
$$\left(\frac{(y-k)\sin\theta-(x... |
I have the following dynamical system,
$\frac{d \phi}{dt} = -M^TDM\phi \tag{1}\label{1}$
$\frac{d \hat\phi}{dt} = -M^T\tilde{D}M\hat \phi \tag{2} \label{2}$
$\eqref{1}$ represents the exact dynamics of a system and $\eqref{2}$ is the approximate dynamics that should give the same time course profiles as $\eqref{1}$, a... |
I am studying about the 1D EM-PIC (Electro Magnetics using particle-in-cell) simulation. I want to have a simultaneous time-integration of the electric/magnetic fields plus the motion of free charges due to electrostatic/Lorentz forces. I studied PIC simulation algorithms and I want to practice by making my own code fo... |
Let $D$ be a sparse matrix. I want to compute $D\times D^T$. As $D$ is fairly large, so I am row-slicing $D$. That means for a range $(i,j)$, I am computing $C = D(i:j,:) \times D^T$ and performing some post-processing on $C$. I am choosing the index according to my available memory. I want to know whether there is any... |
I'm trying to plot the cross section with respect to the photon energy $h\nu$ but for $\gamma = 1.0, 1.2, 2.0 $ in the same axes
$\sigma = \left[\left(\frac{\xi_{eff}}{\xi_{0}}\right)^2 \frac{n_r}{\varepsilon}\right]\frac{4\pi}{3}\alpha_{fs}h\nu|\frac{1}{2}\frac{R}{2^\beta \Gamma(\beta + 1)}\int_{0}^\infty \left(\gamm... |
I have a function $f:\mathbb R^N\to \mathbb R$ and I would like to compute all the partial derivatives of $f$ w.r.t. the $N$ input. What is the computational complexity using the (ones-sided) finite difference method $\big(\text{derivative of f w.r.t. x}\sim\frac {f(x+\epsilon)-f(x)}{\epsilon}\big)$ using the $O( \ )$-... |
I am trying to perform the following integral
$$\int_{0}^{2\pi}\int_{0}^{+\infty} \frac{r'\left(e^{-r'^2/2\sigma^2}\right)\left(r-r'\cos(\theta-\theta')\right)}{r^2+r'^2-2rr'\cos(\theta-\theta')}dr'dθ'$$
Using Gauss-Hermite for $r$ and Simpson 1/3 rule for $\theta$ with no success. I can't find my mistake but the outpu... |
I have a function $f(x)$ defined on a domain $D$, but such that the image $f(D)$ may contain extra regions not included in its domain. I am interested in solving the fixed-point equation $x=f(x)$. If I do a fixed-point iteration:
$$x_{n+1} = f(x_n)$$
starting from a point $x_0\in D$, I risk that some point $x_n\notin D... |
I have a system of equations that I am trying to solve. In matrix form, it's written as
$$x(I - S) = b.$$
I am solving for $x$, where $I$ is the identity matrix and $S$ is a matrix where each column sums up to one. $b$ is strictly positive.
Now, unfortunately, the determinant of $I - S$ is very small. Inverting it lead... |
In a dusty plasma system there are more than one component with different masses, i.e, electrons, ions,neutrals and dust grains. Accordingly, there are more than one temporal and spatial scales involved. I am aware that such a system is difficult to simulate, because, due to very different scales involved it may requir... |
This is my attempt to find the approximate solution of the folowing transport equation $$\left\{\begin{array}{ll}
\partial_{t} u+\partial_{x} u= (x^2-x)t+x^3/3-x^2/2, & t \in(0,0.4), x \in(0,1) \\
u(0, x)=2, & x \in(0, 1) \\
\frac{\partial u}{\partial n}=0 & t \in(0,0.4), x=0\quad or \quad1
\end{array}\right.$$
by usi... |
This is a followup to my previous question here
I have the following dynamical system,
$\frac{d \phi}{dt} = -M^TDM\phi \tag{1}\label{1}$
$\frac{d \hat\phi}{dt} = -M^T\tilde{D}M\hat \phi \tag{2} \label{2}$
$\eqref{1}$ represents the exact dynamics of a system and $\eqref{2}$ is the approximate dynamics that should give... |
I have a program where I need to solve a linear programming problem in a fast loop. The language I'm using is Java and any kind of bindings to other languages are not acceptable. Libraries might be acceptable, given permissive license, but I generally prefer own code to libraries.
The problem is very simple. It has fiv... |
The coarse grid matrix is calculated via RAP where R,P are the restriction and interpolation matrix,respectively.By checking a typical MG algorithm
I want to ask how to calculate efficiently coarse grid matrix in each MG iteration?Isn't it a computational cost to calulate RAP every time until you reach the coarsest le... |
I'm solving a PDE in matlab using ode15s, and since the spatial dimension is 2, and number of variables grow large very quickly, I need to supply the structure of the jacobian (called JPattern in Matlab) by indicating the position of nonzero elements of the jacobian. The jacobian 'pattern' for each point in 2D (indicat... |
I have a basic question to ask:
Let's say I am reading a paper which gives a good model that consists of a set of ordinary differential equations, with first and second derivatives. Continuity is a requirement for differentiability, as we learned in an Analysis course.
Now, I simulate this model, writing code in Matl... |
I am trying to look at how different floating points are stored in memory.
Firstly I looked at the System.Double (accessible by keyword Double in vb.net) which I think I understand. It is stored as follows:
$\pm (I+a)\times 2^b$
where
$\pm$ requires one bit.
$a \in [0,\sum_{k=1}^{52}2^{-k}]$ and consumes $52$ bits.
$b... |
I've recently learned about using weighted residuals with the Galerkin method to numerically approximate even-order differential equations (for linear elements, I'm still a beginner). It seems for odd-order differential equations you cannot use integration by parts to reduce the order of the third-order differential op... |
Consider the system of linear equations:
$$
Ax=b
\tag{1}
\label{eq1}
$$
where
$A\in\mathbb F^{n\times n}$, diagonalizable dense matrix, over the field $\mathbb F$ of real or complex numbers,
$x\in \mathbb F^{n\times 1}$ is a vector of unknowns
$b\in \mathbb F^{n\times 1}$ is a known right-hand side vector
$n$ is in ... |
I want to do a huge simulation that requires ~ 1 TB of data to describe a bunch of interacting particles (each has different interactions). Is it possible to store this data in an array in C++, so that I can access it during the simulation?
I have access to a 60 node cluster. Each node has 2 CPUs with 48x16GB DDR4. So ... |
I have an X value that can go from 0.0000001 to infinite.
I want, if this value is less than 0.8, get 0.8
And if that value is equal to or more than 0.8, get 0
How would you do that using only min and max functions (and of course basic +-/x operations) ?
I ask this because I have to calculate this inside a custom pie... |
I am trying to simulate pressure waves crossing a boundary from one medium to another (e.g., water to air) in Matlab. The code that I have got so far, which is largely taken from Wikipedia on Partial Transmission only changes the speed as the wave crosses the boundary. The code works using a recursive form or the wave ... |
I've tinkered with Matlab's PDE toolbox for a while but was wondering whether anyone here has used Julia to build a PDE solver. If so, what are the advantages and limitations of Julia for PDEs? I'm mostly interested in simple PDEs with constant coefficients but am also thinking of variable coefficients for modeling pur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.