instruction stringlengths 43 28.1k |
|---|
I'm learning about ADMM by reading Boyd's paper Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers.
The paper says that ADMM is an improvement over the Method of Multipliers because the latter requires the minimization of the augmented Lagrangian:
$L_\rho(x,y) = f(x) +... |
Most of my knowledge about numerically solving differential equations is long forgotten. Unfortunately I stumbled upon a physics problem where I need to do exactly that.
I'm trying to describe the movement of a freediver during freefall. This is the part of the dive when the diver has negative buoyancy and falls toward... |
I want to optimize the function
$$\min_{X \in \mathbb{S}^{n}_{+}} \mbox{tr} \left( C^T X \right) + \mbox{tr} \left( X^{-1} \right),$$
of which I optimize the equivalent problem
$$\min \mbox{tr}\left(C^T X\right) + \mbox{tr}(Z)$$
$$\text{s.t.} \begin{matrix} \begin{pmatrix}
Z & I\\
I & X \\
\end... |
I apologise if this is somewhat of a rookie question. So, from my understanding, on a GPU board, far more of the space is allocated to ALUs compared to CPUs which have far more cache available. This should mean that a typical GPU is capable of higher FLOP counts. This I understood to be the advantage of a GPU (in a nut... |
I'm working on modeling a shock wave using the Euler equation with an advanced Equation of state and the fifth order WENO scheme. The equation are set up on the form:
\begin{equation}
\frac{\partial U}{\partial t} + \frac{\partial F(U)}{\partial x} = 0
\end{equation}
where
\begin{equation}
U = \begin{bmatrix}\rho\\ \r... |
I am simulating a waveguide using diffractio python library (https://diffractio.readthedocs.io/en/latest/readme.html). The idea is to create a single mode waveguide using wave propogation method.
First I create a waveguide that has specific refractive index.
Refractive index profile gives the distribution of refractive... |
I am working on writing a Chebyshev pseudospectral method (see for example "Chebsyhev and Fourier spectral methods" by John Boyd) to solve for the eigenvalues of differential equations of the form
$ \left(a_2(x) \frac{d^2}{dx^2} + a_1(x)\frac{d}{dx} + a_0(x)\right)u - \lambda u = 0$
There are "regular" boundary conditi... |
Edit I've modified the equations because they were wrong and I added the whole system, as asked by @Wolfgang
I am trying to nondimensionalize a system of partial differential equations similar to 2nd Fick's law, with multicomponents system. The reason is to make it more stable when I will implement it numerically.
$\be... |
I have a problem when using petsc.
I want to solve a series of linear equations.
A1x1=b1, A2x2=b2, A3*x3=b3 ...
The A1,A2,A3 have the same sparstiy pattern.
I want to use MUMPS to solve the system.
In order to enhance performance, I want to reuse the symbolic factorization.
Here my code for solve a single linear system... |
Crossposted on Mathematics SE
I have been assigned a group project for an introductory Linear Algebra subject on Finite Difference Methods and sparse matrices. Our professor advised we use Gilbert Strang's Linear Algebra and its Applications and G. D. Smith's Numerical Solution of Partial Differential Equations. Howev... |
I know very little about numerical PDE, so I apologize if this equation is ill-formed (and I appreciate any corrections).
I am currently learning about Brownian motion. A classic result is that we can use Brownian motion hitting times to solve the heat equation. More specifically, if we consider a nice domain in $\math... |
Scipy.odr has a setting for "fit types", including one for ordinary least-squares. This matches with the documentation of ODRPACK (see p. 31, Computational method).
However, the package accepts standard deviations/weights in this mode and the weights do affect the fit result:
In [1]: from scipy import odr
...: def f... |
I am trying to parameterize a CVXPY program as I need to repeatedly solve the problem, but I noticed that when my parameters are complex numbers, CVXPY models the problem in each iteration. For example, suppose I want to solve the following problem:
$$
\underset{\mathbf x}{\text{minimize}} | \mathbf A \mathbf x - \math... |
I am a complete novice to computational physics and am finding difficulty in implementing a code to iteratively solve for a $2\times2$ nonlinear Hamiltonian using Scipy's root solver. I can't seem to find open-source codes that I can take inspiration from and learn by myself. Here is the problem:
Consider a single unit... |
I need help to understand how to use the result given by an algorithm for constructing an orthonormal polynomial basis over $L^{2}(X)$, where $X\subset\mathbb{R}^2$, with respect to the inner product $(f,g) = \iint_X f(x,y)g(x,y)\,dxdy$. We denote $\mathcal{P}_{n} = \{\text{Polynomials }P(x,y): \text{ total degree of }... |
I have a large-scale system of linear equations: $Ax = b$, where $A$ is an $n\times n$ square symmetric positive definite matrix (not sparse), $b$ is an $n \times 1$ vector and $x$ is $n\times 1$ unknowns. The magnitude of $n$ is several million.
How much memory does it take to store this problem, say, I use C++ and s... |
I implement Crank-Nicolson 2D finite-difference method.
I get a matrix A which is banded with 1 band above and below the main diagonal, but also contains 2 additional bands , further apart from the main diagonal, so it is NOT penta-diagonal.
A picture showing the structure is below. My matrix is the RHS one. The LHS is... |
When it comes to optimizing objective functions belonging to Statistical and Machine Learning Models, there seems to be a general rule:
High dimensional objective functions with many parameters are "computationally expensive" to optimize
As such, there tends to be two general types of algorithms that are used to optimi... |
This is a combination of these two previous questions:
How to get ODE solution at specified time points?
Stop integration in odeint with stiff ode
I need to solve the following differential equation for $f_N$,
$$\frac{d}{d t} f_{N}(\mathbf{k}, t)=D(\mathbf{k}, t)\left[f_{N}(\mathbf{k}, t)-f_{N}^{\mathrm{eq}}(\mathbf{... |
Framework
I am trying to diagonalize the Bogoliubov-de Gennes Hamiltonian. The problem is that the Hamiltonian contains a Laplacian. This could be solved by using a discretized Laplacian.
How I tried it
If I use a simple Hamiltonian (just the Laplacian) and use eig(l1dd(...,...)) with l1dd the discretized Laplacian (2 ... |
I'm trying to recreate Figure 1 in this paper. This requires maximizing equation (19), which I have convinced myself is concave, but I am having trouble implementing it in CVXPY. Here is the code I think is relevant to this question:
import cvxpy as cp
import numpy as np
def tanh_atom(x):
return (cp.exp(2 * x) - 1... |
In a generic rootfinding problem $f(x) = 0$, we assume that the probability that the root $x$ is a floating point representable is zero. Hence, the best floating point approximation $\hat{x}$ to $x$ gives $f(\hat{x}) = f(x(1+\delta)) = x\delta f'(x) + \mathcal{O}(\delta^2) \approx x\delta f'(x)$ where $|\delta| \le \mu... |
I have a question on construction of a Wannier function for tight-binding model. Let's say we consider the tight-binding model of 1D chain with two atoms( site A and B in a unit cell). In k-space we can write the single-particle Hamiltonian in following way:
\begin{equation}
H = \sum_{k} \Psi_{k}^\dagger h(k) \Psi_k~~,... |
This is a repost from another community, it was recommended that I post it here instead.
I have been using the Chebyshev collocation method for solving PDEs. In particular to solve a 3D generalized Poisson's equation. One of the problems I am facing is that one of my dimensions is periodic and would require periodic BC... |
I have a PDE that contains both the 3rd derivative and 4th derivative. Example shown below
$$ \frac{\partial u}{\partial t} =\frac{\partial}{\partial x}(u^3\frac{\partial^3u}{\partial x^3}) $$
$$ \frac{\partial u}{\partial t} =(u^3\frac{\partial^4u}{\partial x^4} + 3u^2\frac{\partial u}{\partial x}\frac{\partial^3u}{\p... |
I am looking for some help finding a numerical solution to the shallow water equations:
$\partial_tu+\partial_x(u^2/2+g\eta)=0$
$\partial_t \eta+\partial_x(u\eta)=0$.
where $u$ is the depth averaged horizontal velocity, $\eta$ is the depth, and $g$ is a constant.
Using mathematica's NDSolve I quickly develop a compress... |
The full question is:
Let {u1, u2,···, un} and {x1, x2,···, xm} be bases for Rn and Rm respectively. Let T:Rn→Rm be the linear transformation whose associated matrix with respect to the above bases is A. Write a program in R such that given two sets of vectors{v1, v2,···, vn}and{w1, w2,···, wm}examines whether these tw... |
I was wondering if there is some known way to solve the following optimal control problem
\begin{align}
\text{min }&\mathcal{J}(\rho,\nu)\\
\text{such that }&∂_t\rho(t, x) = − div_x(((K ∗ ρ)(t, x) + (H ∗ ν)(t, x))ρ(t, x)) \text{ (conservation law)}
,\end{align}
where $\mathcal{J}$ is for example a quadratic functional ... |
so, I have a symmetric, analytic matrix $\mathbf{H}(x)$ ($x$ is real). Because $\mathbf{H}(x)$ is analytic and $x$ is real, it is possible to find analytic functions for the eigenvectors and the eigenvalues of $\mathbf{H}(x)$.
at $x=0$, each eigenvalue $\vec v_i(0)$ is associated with an eigenvalue $\lambda_i(0)$, wher... |
So if I've understood it correctly, the Algebraic Multigrid Method (AMG) basically takes a fine mesh, coarsens it, solves the coarse mesh and projects the solution back on the fine mesh.
Wouldn't it make sense to skip all the extra steps, just start directly with the coarse mesh, solve it normally and be done with it? ... |
In peer reviewed numerical papers, the order of accuracy of finite difference and finite volume for PDEs is computed in multiple norms, usually $l_1$, $l_2$ and $l_{\infty}$, and other times $l_{\infty}$ is used with one of the other two. I guess that the reason for $l_{\infty}$ to be used is that you wanna check that ... |
I have a couple of questions with regards to the usage of flux/slope limiters, which I was hoping to get some input. I apologise in advance if my questions are trivial, but flux limiters lie way beyond my research area (up until now) and I am still trying to make sense of all information that is out there.
I am trying ... |
to perform adaptive refinement in the finite element method according to the explicit residual method, the quantity
$$\eta_K^2=h_K^2\left\lVert r\right\rVert_{L_2(K)}^2+h_K\left\lVert R\right\rVert_{L_2(\partial K)}^2$$
must be calculated for all elements of the mesh. For the equation $-\nabla^2u=f$, the norm $\left\lV... |
Suppose I have a set of $N$ points of shape $N \times D$, where $D$ is the dimensionality. I want to compute the average Euclidean distance between all points, as well as additional moments such as the variance, median, and percentile boundaries.
Is there a way to calculate or estimate these quantities without finding ... |
Ive take a course in computational physics and was asked to implement some numerical methods to solve ODES. I was reading up on the algorithms described in the textbook: NUMERICAL RECIPES IN FORTRAN.
I dont really understand what the following parameter in rkqs is needed for as shown in the textbook. It seems to be say... |
Actual Problem: I want to assess the difference in two text rewrites: it can be fine today => today, it can be fine
Simplified Problem: [1, 2, 3, 4, 5] => [5, 1, 2, 3, 4]. (Note: it could actually become [6, 2, 3, 4] for example)
Goal:
Find some difference score that assesses the global new order, and the local new ord... |
I have three 1D arrays, which represent radius, height, and an intensity measured at that point. I have plotted these to create a 2D contour map. A simple example of the way in which the data is stored is below:
import numpy as np
import matplotlib.pyplot as plt
x = [1,1,1,2,2,2,3,3,3]
y = [1,2,3,1,2,3,1,2,3]
intensit... |
I do hydrodynamics simulations with Fortran and recently I met with this issue:
I have a single-precision array b of length n=512**3, and I wish to compute the root-mean-squre of its elements. All I do is
s=0
do i=1,n
s=s+b(i)**2
enddo
and then compute sqrt(s/n).
I found that it makes about $30\%$ difference in the ... |
I am trying to do linear regression on the following conceptualized problem. I have a set of data in pairs $(x, y)$. I know that $y$ is bounded by a linear function $f(x) = mx + c$. I want to estimate this upper bound. Following are visualization of the data generated for two values of a third parameter.
As you can s... |
I am using the mixed finite element method (MFEM) to solve the Poisson equation:
$$\Delta h = 0,$$where $h$ denotes hydraulic pressure. The MFEM could determine the normal flux rate, $q_n$, through the interfaces between two adjacent grids, and the $q_n$ reads
$$q_n=\frac{\partial h}{\partial n},$$
where $n$ is normal ... |
The numerical method that I'm implementing stores various fields in various elements of an unstructured triangular mesh. Data may be stored in cells, nodes and even edges of the mesh. For a parallel implementation I need to distribute all the mesh elements among processors.
There are well known approaches to the proble... |
Quite broad question,
Currently building own Poisson solver subroutine for CFD solver.
Works smooth, the goal is to generalise the input and make it flexible.
Description of also:
Memory allocation.
Filling source right hand side $-\Delta u(x,y) = f(x,y)$ function of Poisson equation.
Filling sparse matrix with inner ... |
I am looking for a semi-Lagrangian method for advection with a non divergence free velocity field.
The equation is
\begin{align}
\frac{\partial C(x,t)}{\partial t} &= - \nabla \cdot (\vec{v}(x,t) C(x,t)) \\
C(x, 0) &= C_0(x)
\end{align}
I've solved that using the formulation in this paper [1], which describes a quasi-m... |
I am aware of creating an identity matrix in Eigen if the number of rows and columns are known. How do we create them dynamically when the size is not known? An example would be useful. Thanks.
|
I want to solve Navier-Stokes eq with Dirichlet boundaries using a pseudospectral method.
All of the references I encountered used Chebychev transform to do this. But why can’t you use sine transform?
|
Given a polynomial of degree n and a list of putative roots $\{r_i\}_{i=1}^{n}$, we can verify that all the putative roots are indeed correct by $n$ applications of Horner's method. Hence verifying the solution requires $\mathcal{O}(n)$ storage and $\mathcal{O}(n^2)$ floating point operations.
Now, if we use the method... |
I'm trying to solve a generalized eigenvalue problem. I have two matrices $H$ and $S$ such that:
$$
HX=λSX
$$
I need to find the eigenvalues $\lambda$. The matrices $H$ and $S$ are real, asymmetric, contain positive and negative decimal numbers, and (can be) singular. I am using MATLAB and have tried two different appr... |
I'm solving a system of coupled ODEs using Euler integration for simplicity. To make this concrete, please see the (extremely simplified) minimal working example below in Python. Imagine we have a box that initially has 0 mass and 0 energy. At each timestep, we add some mass to the box from the outside. Some fraction o... |
I am currently learning the usage of Augmented Lagrangian Multiplier to achieve my equality constraint. I have learnt from the https://en.wikipedia.org/wiki/Augmented_Lagrangian_method that I have two multipliers, $\mu$ and $\lambda$.
According to wikipedia, it shows me how I can update my $\lambda$ with any value of $... |
I am interested in deriving an accurate, implicit discretization of a nonlinear advection-diffusion equation
$$
\partial_t f = \frac{1}{v^2} \partial_v J(f,v) \equiv F(f,v) \tag{$\star$}
$$
with flux
$$
J(f,v) = C(f,v) f + D(f,v) \partial_v f
$$
where $f(v,t)$ is the unknown function of a radial coordinate $v\in [0,\i... |
I have a class of integrals I need to solve numerically which have the form:
$$
I_k = \int_a^b \frac{p_k(x)}{x^k} dx, \quad k = 0, 1, \dots, K
$$
where $p_k(x)$ is a cubic polynomial on the interval $[a,b]$. I have tried Romberg integration which unfortunately does not produce satisfactory results. Does anyone know of ... |
I am studying introduction to Multigrid methods.
In all tutorials, authors write that eigenvectors of Laplacian (1D, finite difference) are given as
$w_k(x_i) = \sin(k \pi x_i),$
where $x_i$ is a discretization point.
Can anybody point me to literature which derives this formula? Or can anybody sketch the derivation?
|
I'm new in Particle Physics based Computing. I want to simulate an ADS experiment (Accelerator Driven System) in subcritical fast system. I was advised to simulate the experiment with FLUKA with MCNP being coupled with it.
On the otherhand, I saw CERN now uses Flair more than FLUKA. is FLUKA and Flair same and if someo... |
I'm studying the Finite element method for structural mechanics, and I'm reading this source.
3rd degree polynomials are used as shape functions for beam theory, since they are required to be continuously differentiable to the 4rd derivative.
It is said:
If such a polynomial is used to derive the shape function, the s... |
I'd like to make a web application that lets people play with solving ODE systems, changing parameters with sliders etc. but instead of doing the computations on the server side, solving the equations on their own computer via the web-browser.
There's some really nice examples here: http://blog.littleredcomputer.net/je... |
I have this function $y = \exp(-x)$. I have a list of $x$ values and corresponding $y$ values.
X = [-3., -2., -1., 0., 1., 2., 3., 4., 5., 6.]
Y = [20.085536923187668, 7.38905609893065, 2.718281828459045, 1.0, 0.36787944117144233, 0.1353352832366127, 0.049787068367863944, 0.01831563888873418, 0.0067379469990854... |
In python, there is a function in scipy (scipy.linalg.eigh_tridiagonal) which is extremely efficient for an exact diagonalization of a symmetric tridiagonal matrix (I think it uses MRRR algorithm, not sure). But only a single core is assigned to solve the exact diagonalization. Is there a way of using remaining cores t... |
A very visual picture for Monte Carlo integration is the approximation of $\pi$, by sampling in a square which contains a quarter of the unit circle.
We can extend this picture to 3 dimensions, by sampling a cube which contains 1/8 of a sphere.
But both cases are quite simple. I want to write a function that generalise... |
I would like to compute the integral
$$
\frac{\partial}{\partial{x}} \int_{-1}^1 \int_{-1}^1 F(x,y,\xi, \eta) \; d\xi \; d\eta
$$
or moving the derivative inside the integrals
$$
\int_{-1}^1 \int_{-1}^1 \frac{\partial}{\partial{x}} F(x,y,\xi, \eta) \; d\xi \; d\eta
$$
where $F(x,y,\xi, \eta)$ is a complicated rational ... |
For reasons to do with extending the range of applicability of this Mathematica package, I would like to have a good handle on the numerical evaluation of functions of the form
$$
f(x) = \frac{j_n(\sqrt{x^2-\zeta^2})}{e^{\zeta}},
$$
where $j_n$ is a spherical Bessel function of the first kind, $x$ is real-valued and re... |
Does someone knows another trick or solution how can I perform matrix multiplication by its transpose?
The current code for 1000 iterations takes too much time for me.
#include <iostream>
#include <armadillo>
class watch : std::chrono::steady_clock {
time_point start_ = now();
public: auto elapsed_sec() const {ret... |
I recently read the paper "EUCLIDEAN-NORM ERROR BOUNDS FOR SYMMLQ AND CG" by Estrin et al. and there they use an underestimate (i.e. something in $(0,\lambda_{min}]$) of the smallest eigenvalue of the matrix in order to derive a practical upper bound for the L2 error of the iterations.
In my case I am dealing with very... |
Basically just that. I am trying to write a C++ program that reads in an STL and should compute an unstructured tetrahedral volume mesh based on the surface triangulation given by the STL file.
I would like to implement the mesh generation step from scratch, so I am looking for algorithms or literature recommendations ... |
We are looking for studies or tools that implemented kinetic modeling with parameter estimation differential evolution or similar optimization techniques in Python.
We are trying to understand what already exists in this area.
Thanks in advance!
|
I've recently came across an implementation of the BFGS algorithm but it has an additional step where the Hessian is transformed after the each update. This transformation is done so that certain constraints to the search directions are made. In this case it is optimising a molecules geometry but removes search directi... |
The square of the largest singular value of a linear map $A$ can be computed by using the power iteration for $A^TA$ and one advantage of this is that the iteration is matrix free, i.e. you only need to apply the linear map and its adjoint but never need the matrix $A$ explicitly.
Do you know any matrix free method to ... |
How to choose the cutoff radius so that the atoms do not interact with its periodic image? Especially when simulating macromolecules (proteins).
|
I am in the process of programming the local & average Nusselt number in a left vertical wall but my Matlab script gives me inappropriate values and it doesn't change with changing of Rayleigh number!!
The problem is: how to calculate and impliment the local Nusselt number in a vertical left wall of a cavity. The expre... |
I have a problem with Laplace inversion and my function is not numerically stable for the Laplace inverse, but I do not understand the cause of this problem.
Here is my code and graph of this problem. Does anyone have any idea? I have also tried all 3 Dehoog Stehfest and Talbot, they all have a different type of instab... |
I saw in several places that interpolation operator ($P$) and restriction operator ($P^T$) are usually transposes of each other (up to multiplication by a constant).
As I understood it related to Galerkin condition ($A^{2h}=P^TAP$), where $A$ is the original matrix of the system $Au=f$ and $A^{2h}$ is a coarse version ... |
I'm trying to solve the following boundary value problem on $[0,\infty]$:
$$f^{\prime \prime}=-\frac{1}{r} f^{\prime}+\frac{1}{r^{2}} f+m^{2} f+2 \lambda f^{3}$$
$$f(0)=0 \ ; f(\infty)=\sqrt{-m^2/(2\lambda)} $$
for some constants $m^2<0, \lambda>0$. There is no closed form but we should have $f$ monotonically increasin... |
So the question was to use a nested loop to solve a 3D integral with the function conditions (written below in the code) to find $$\int dxdydz $$ and the x and y coordinate of the centre of mass of this domain.
I am using 10 integrand evaluations per direction, but I am getting a large error especially while calculatin... |
I have implemented a finite difference solver for the 1d wave equation with variable wave speed:
$$ u_{tt} = c(x)u_{xx}, \hspace{10mm}c(x) = \dfrac{6 -x^2}{2} \hspace{5mm} $$
on $-2 \leq x \leq 2, t > 0$ with initial conditions: $$u(x,0) = \cos(\dfrac{\pi x}{0.2}), \hspace{5mm} u_t(x,0) = 0
$$ for $-0.1 \leq x \leq 0.1... |
I have been stuck for a while now on a WENO scheme implementation and I have a few questions concerning the implementation, but also the theory behind it. For context: I'm currently working on numerical schemes for kinetic equations. Someone suggested to me to look at WENO schemes. However, I somehow am not able to imp... |
Could I apply a Q0-discretization to, say, the Poisson equation $\Delta \phi = f$ (where by Q0 I mean piecewise constant, and thus non-continuous, elements)?
Solving this with FEM, at least as I know it, involves the gradients of the discretized function $\nabla\phi$, which in a piecewise constant discretization I woul... |
In most physics engines there's this concept of "static" bodies, which act as rigid bodies with infinite mass. Then there are "kinematic" bodies that act as static bodies, but their motion is simulated by animation data or by user specifying position or velocity directly. And finally there are the "dynamic" bodies whic... |
I am trying to solve the following integral:
$$ I (r,\theta) = \frac{1}{2\pi}\int_0^{2\pi}\frac{f(\phi)(1-r^2)}{1+r^2-2r \cos(\theta-\phi)}d\phi$$
where $0\le r<1$ and,
$$f(0\le\phi<\pi/2) = +\frac{1}{\sqrt 2}$$
$$f(\pi/2\le\phi<\pi) = -\frac{1}{\sqrt 2}$$
$$f(\pi\le\phi<3\pi/2) = -\frac{1}{\sqrt 2}$$
$$f(3\pi/2\le\phi... |
I wonder which software can be used to generate the mesh like below. Anybody has an idea?
|
I'm trying to solve the following equations numerically in python
$$\begin{align}
12\pi\int_0^\infty drf(r)\phi(r)r^4&=E\\
f(r)-\frac{1}{2\mu}\bigg(\frac{d^2\phi(r)}{dr^2}+\frac{2}{r}\frac{d\phi(r)}{dr} \bigg)+m_\pi\phi(r)&=E\phi(r)
\end{align}
$$
where $f(r)=S\exp(-r^2/b^2)$, while $\mu$ and $m_π$ are constants.
I hav... |
I'm reading the following table (from https://www.tutorialspoint.com/cprogramming/c_data_types.htm )
Why the precision of the float is 6 decimal places, but I see that the float are in the interval [1.2E-38 , 3.4E38] ? So, I think that I can have 38 decimals of precision.
Which is my error?
|
I have noticed that some commercial solvers transform QCQPs into SOCPs and use SOCP algorithms to solve the resulting problem. I am wondering if there is a benefit to this approach over using a pure QCQP solver.
I have done some literature review, and I haven't found any references comparing these two approaches, besid... |
I'm running into issues with Python/Julia ODE solvers requiring prohibitively small timesteps to evolve a system of 4 coupled ODEs (the order of magnitude of the state variables and time unit span ~40-50 orders of magnitude). Interestingly if I use a simple explicit Euler approach then I can get past the stiffness at e... |
I am trying to set up a 3D CFD scheme for thermal and flow modelling in Python using the finite volume method. The first concern is to build the geometry and an accompanying mesh that is efficient for the purpose (resembling something like the 3rd picture below).
For Python, there are many libraries for geometry and m... |
I am trying to implement an advection equation for a coupled system of a two-phase flow in a porous media using a WENO scheme [1].
My equation is of the form:
\begin{align}
\frac{\partial (\phi(x,t) C(x,t))}{\partial t} = - \nabla . (\vec{q(\phi, t, x)} C(x,t))
\end{align}
with $\phi$ beeing the porosity, which in thi... |
This question is very related to the question Number of decimal of float and double in C. In the second table we may see that the exponent of the float are from -38 to +38. But the IEEE754 standard defines the floats as
| sign bit | exponent bits | mantissa |
| 1 bit | 8 bits | 23 bits |
Then, the exponent... |
I'm moving from Excel to Python and I'm trying to solve these equations:
$$\begin{align}
X_1&=\bigg[\big(3.47-\log(X_2)\big)^2+\big(\log(c)+1.22)^2\bigg]^{0.5}\\
X_2&=\frac{a}{101.32}\bigg(\frac{101.32}{b}\bigg)^{X_3}\\
X_3&=0.381X_1+0.05\bigg(\frac{b}{101.32}\bigg)-0.15
\end{align}
$$
I have tried this code
import num... |
I wish to solve the following using the finite volume method:
$$\frac{\partial u}{\partial t}=\frac{D}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u}{\partial r}\right)+Q(t,r)$$
with the following boundary conditions:
$$\frac{\partial u}{\partial r}\Bigg|_{r=0}=0,\quad -D\frac{\partial u}{\partial r}\Bigg|_{r=R}... |
When it comes to Evolutionary Algorithms (e.g. Genetic Algorithm), I have often heard people make the following broad statement: "Evolutionary Algorithms Do Not Converge."
I was curious about know how true this statement is, or does it come with any caveats. For instance, I was interested in knowing if perhaps there mi... |
I'm solving a local instability problem for a pipe Poiseuille flow.
The coordinate system is columnar, i.e., ($r,\theta,x$) (radial, tangential and axial).
The basic flow is $\bar{u_r}=0, \bar{u_\theta}=0$ and $\bar{u_x}=1-r^2, r\in[0,1]$.
After putting the perturbation function into the N-S equation, the generalized E... |
Background: We're operating a small betatron which makes use of a vacuum tube where electrons are accelerated circularly. First, they get injected (like inserted) and contracted (like squeezed). After a while, these electrons exit the tube and hit a target and convert (hopefully) into photons which will be used as x-ra... |
I've posted yesterday a question about solving a non linear equation : it was not clear so I am reformulating my question.
I am trying to solve a high-order non linear differential equation presented right below with $F \in [-\eta_{0}, \eta_{0}]$
$\left(5F - 4\eta\frac{dF}{d\eta}\right) = 9 \frac{d}{d\eta}\left(F^{3} \... |
I am working on reactive transport and I need to solve this advection equation:
\begin{align}
\frac{\partial (\phi C)}{\partial t} = - \nabla \cdot \big(\vec{q}(\phi) C\big)
\end{align}
with $\phi$ being the porosity, C the concentration of an element, and $\vec{q}$ the fluid flux. I am calculating the porosity and th... |
Consider the advection equation
\begin{equation}
\frac{\partial C}{\partial t} + u\frac{\partial C}{\partial x} + v\frac{\partial C}{\partial y} = 0
\end{equation}
I want to do a forward time, center space finite difference approximation with the Lax method and a periodic boundary
\begin{equation}
C_{i, j}^{n+1} = \fra... |
I look for a book/manual where I can find implementations of different integration schemes for ordinary differential equations (like 4-th order Runge-Kutta) in Python with Numba.
To be more specific, let me provide some details and background. In my research I deal with a system of coupled non-linear differential equat... |
It has been a while since I have done some stats, and I have tried to fit a curve using optimize.curve_fit of parameter estimation. I am also interested in the standard deviation of the fitted parameters which I get from the square of the diagonal terms of the covariance matrix.
In order to get the estandar deviation I... |
I am looking for a set of radial basis functions $\phi_n(x)$ on $\mathbb{R}^+=[0;\infty[$ which satisfy some othogonality condition
$$ \int x \phi_n(x) \phi_{n'}^*(x) dx =\delta_{nn'}$$
and "behave" like some (fractional) polynomial $x^{\alpha}$, by which I mean they can be analytically factored as $\phi_n(x)=f_n(x) x... |
I would like to be able to model an SDE having the form
$$dX_t = \mu(X_t)dt + \sigma(X_t)dW(t) + \int_{\{|c| <1 \}}g(X_t,c)\tilde{N}(dt,dc) + \int_{\{|c| \ge 1 \}}h(X_t,c)N(dt,dc).$$
where $W$ is a standard $1$-dimensional Brownian motion. $N$ is a Poisson process and $\tilde{N}$ is the compensated Poisson process. $N$... |
I am trying to solve a scheduling problem with linear programming. I have N disks that each have a capacity of constant C. At each time interval t_i, a set of write requests with different sizes arrive that we need to store their data on the disks. Each disk has a different write speed. we can delay writes, but after w... |
I am currently trying to solve a regression problem, which leads me to an optimization problem. Say that we have measured data ($\hat{S}(\omega)\in \mathbb{C}^{N\times N}$), and each entry of this matrix is a $d$-sized vector containing frequency-dependent measurements. We can perform the regression by minimizing
\begi... |
I have a predefined grid(like this) that is spawned from a regular icosahedradron. It consists of many hexagons and 12 pentagons (corresponding to icosahedradron vertexes). I can tweak the granularity of a grid, but I did not find a way to port this method on a sphere.
I want to solve the heat equation on such a grid:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.