All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Computation of a functional for large values

Consider the following function : $$f(x) = \sin^2(\frac{π\Gamma(x)}{2x})$$ Now consider the following functional : $$I(x)=\int_0^\infty \frac{f(x + iy) − f(x − iy)}{e^{2πy}-1} dy$$ I need values for ...
-3
votes
0answers
14 views

Python programming [closed]

Cannon Ball Simulation Add a new class named "Cannon". This class it to represent the cannon that launches the balls. It should draw a rectangle the launch point. Its width should be equal ...
0
votes
0answers
27 views

Adaptive quadrature methods for Fourier Optics

In Fourier Optics one often needs to compute approximations to bivariate integrals like $$ \int_{-\frac{l}{2}}^{\frac{l}{2}}\int_{-\frac{l}{2}}^{\frac{l}{2}} {\rm e}^{i\phi(\xi,\eta)}\mathrm{exp}\left[...
0
votes
0answers
22 views

How to write these function with disciplined convex programming rule to use CVX? x*(2^(y/x)-1)

I have the following functions in an optimization problem. $x\times 2^{(y/x)-1}$ $ x \log (a+b\times 2^{(y/cx)-1} )$ Here, x,y>0, and also a,b,c>0, and b>a. For these conditions, I checked ...
2
votes
1answer
55 views

Calculate stable time step DG method for advection-diffusion

For stable time steps for the RKDG method for transport equations we require that $$ \Delta t \le \frac{\Delta x CFL}{(2k + 1)|\lambda|}, $$ where $\lambda$ is the eigenvalue of our conservation law ...
0
votes
1answer
65 views

Solving large sparse system

I am working on a problem with very large sparse matrices. I'd like to compute $A^{-1} B$, that is a crucial part of converting DAE to ODE (and there is no workaround). Here size of $A$ is 2E+5 x 2E+5 ...
0
votes
0answers
8 views

Scipy minimization failing with inequality constraints or bounds

I am trying to use scipy.optimize to solve a minimizaiton problem but getting failures on using an inequality constraint or a bound. Looking for any suggestions regarding proper usage of constraints ...
0
votes
1answer
86 views

How GMRES method finds smallest singular value and the corresponding singular vectors of a matrix?

https://stackoverflow.com Krylov solvers for iterative computation of the smallest singular value and the corrensponding singular vectors of a matrix Edit: This is a follow-up question to How to ...
0
votes
0answers
11 views

Sufficient conditions to ensure divergence of a sequence in Maxima

I am using Maxima to check whether a given sequence is diverging to $+\infty$. I know that this problem is undecidable and we note that Maxima is throwing an error: ...
2
votes
1answer
66 views

Efficient projection of a vector onto matrix kernel

Given an $m \times n$ matrix $A$ and a vector $x\in\mathbb R^n$, with $m<n$, what's an efficient way of computing the projection of $x$ onto the kernel of $A$?
1
vote
0answers
34 views

Surface mesh from labeled 3D points

I'm trying to figure out how to create a surface mesh from a set of labeled 3D points. The 3D object could be something like part of a cave system or asteroid where there would be parts of the surface ...
1
vote
1answer
34 views

Linear system with an l1-norm constraint

I have a saddle-point system of the form \begin{equation} \begin{bmatrix} A & B \\ B^T & O \end{bmatrix}\begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} f \\ \vec{0} \end{bmatrix}, \end{...
0
votes
0answers
26 views

How to create a simulated federated learning network to study sybil attacks?

I'm trying to study the relationship, if any, between the accuracy of a federated learning network and the number of attacking sybils. In order to do this, I need to create a simulated FL network and ...
0
votes
0answers
27 views

How to implement a frequency domain filter in python [closed]

Im trying to implement a frequency-domain filter in python using an specific response function. The idea is to perform the Fourier transform of an image multiply it by the filter response function and ...
2
votes
2answers
113 views

Weak form of the Navier-Cauchy equation

I am trying to obtain the weak form of the Navier-Cauchy equation, which is $$- \rho \omega ^2 \textbf{U} - \mu \nabla ^2 \textbf{U} - (\mu + \lambda) \nabla (\nabla \cdot \textbf{U}) = \textbf{F}$$ ...
0
votes
0answers
21 views

Python Environment Carrying Over to Jobs [migrated]

I am trying to run a software package developed that has some dependencies such as numpy on a cluster. My issue seems to be with the python environment. I have set up the environment correctly for ...
3
votes
0answers
46 views

FEM with elastic inhomogeneous properties leads to mesh-induced anisotropy

I'm solving an elastic homogenization problem and I'm having problems with mesh artifacts. I would like to first give a brief summary of what I do: I have a system with inhomogeneous (but isotropic) ...
1
vote
1answer
65 views

Issue solving nonlinear equation containing a quotient

I have a coupled set of PDEs that need to be solved as part of a larger problem. I am currently approaching this by computing spatial derivatives with finite differences and using PETSc's nonlinear ...
1
vote
1answer
98 views

Efficient way to solve a set of linear equations $Ax=b$ when $A$ is sparse and some elements of $b$ are equal to zero

I have a set of linear equations, $Ax=b$. And about half of the elements in the right-hand side (vector $b$) are equal to zero. My system matrix $A$ is a sparse complex matrix. And $A$ is in the size ...
2
votes
1answer
56 views

Effect on methods like Crank-Nicolson of adding a potential term, changing heat equation to Schrodinger equation

I'm studying up on methods for numerically solving the Schrodinger equation. The Schrodinger equation with a zero potential is formally identical to the heat equation in the sense that we just make ...
1
vote
0answers
28 views

Euler Explict Method for solving the PDE for option prices under the Schwartz mean reverting model. Numerical Finance

I have to solve the following PDE for a Call option : $\partial_tV + \{ \alpha - (\mu - \lambda/ \alpha -log(S))\}S\partial_SV + 1/2 \sigma^{2}S^{2}\partial_{S}^{2}V - rV = 0$ Where V(S,t) is the ...
2
votes
1answer
47 views

Accelerating convergence of a generalized continued fraction

I wish to compute $$ \frac{1}{1 + \frac{1^3}{1 + \frac{2^3}{1 + \frac{3^3}{1+\cdots} } } } $$ to high accuracy. To start, I tried computing $$ \frac{1}{1 + \frac{1^2}{1 + \frac{2^2}{1 + \frac{3^2}{1+\...
2
votes
2answers
60 views

Methods for solving discrete PDEs using algorithmic differentiation results

I'm looking for a method to solve a 20000 variable, 20000 residual non-linear PDE with a Galerkin method. I have Fortran subroutines for: The residuals: $\vec{r}(\vec{x})$; Their Jacobian multiplied ...
1
vote
0answers
72 views

Is Romberg integration method implemented as weighted function values numerically correct?

I have to integrate expression f(x) * g(x) for many different functions f but just one g. I ...
7
votes
2answers
243 views

Is there an iterative solver for dense matrices with possible zero diagonal entries?

Is there an iterative solver that can handle potentially zero entries on the central diagonal? I am implementing a polynomial fitting algorithm (up to $10^{th}$-order) and my matrix is a "...
1
vote
1answer
82 views

$P0$ elements for $H1$

Are there $P0$ (zero degree/constant element) nonconforming methods for approximating solutions in $H1$? More specifically, I have the equation: $$u-f - T\Delta u = 0$$ Which can be interpreted as ...
-1
votes
0answers
28 views

How to derive the corrector step for the eq $\frac{\partial u}{\partial t}+\frac{\partial f}{\partial x}=0$

Let define a predictor step for the equation $\frac{\partial u}{\partial t}+\frac{\partial f}{\partial x}=0$, by: $$U_{i+\beta}^{n+\alpha} \equiv \bar{U}_{i}=U_{i}^{n}+\beta\left(U_{i+1}^{n}-U_{i}^{n}\...
0
votes
0answers
45 views

Solver for large dense BVP system in python

I have a large system of boundary value problems of the form $$ \frac{d^2 y }{dt^2} = C(t) y + b(t), $$ where the variable $y$ is a vector that has anywhere from 50 to around 500 components, $C$ is a ...
0
votes
1answer
78 views

Method of Lines Runge-Kutta nonlinear stability and behavior

I have a system of 4 nonlinear 1st-order PDEs. I want to solve them numerically by method of lines, first discretizing space. This leads to the system of $N\times 4$ coupled ODEs. $$ \mathbf{u}_{i} =...
0
votes
0answers
15 views

A way to generate unit lattices from a honeycomb structure

I am looking to make certain computations on the vertices of periodic cubic honeycombs and quasiregular honeycombs like tetrahedral-octahedral honeycomb. Cubic are simple enough and amount to generate ...
0
votes
1answer
55 views

Matlab - Fast Computation of Truncated SVD / PCA

I'm working with a Matlab codebase wherein I'm attempting to solve A*c = b by approximating the (square) matrix A with its ...
0
votes
1answer
42 views

Are there any constraints on eigenvalues that are used in inverse iteration?

What is the result of the method for multiple eigenvalues? Is there any case for which this method will not work altogether?
0
votes
2answers
160 views

Integration by parts with cross derivatives to obtain the weak form [duplicate]

I’m trying to write the weak form of the Navier-Cauchy equation in the component form, where $u_1$ and $u_2$ are the displacement components: $$-(2 \mu +\lambda) \frac{\partial ^2 u_1}{\partial x_1 ^2}...
1
vote
0answers
26 views

How property-invariance is imposed to neural nets?

I was wondering how specific symmetries or constraints such as property-invariance transformation are imposed on any (deep) neural net when they are trained. I'll appreciate it if anyone can aware me ...
1
vote
0answers
33 views

Cell-centered DG extension to the two-point flux approximation scheme

A current problem that I am working on requires me to compute the solution from the heat diffusion evolution on a discontinuous function. More precisely - I have a Delaunay triangulation and within ...
5
votes
1answer
135 views

Accurate computation of Gauss-Kuzmin entropy

The Gauss-Kuzmin distribution gives the probability of an integer appearing as a partial denominator in the continued fraction of a real number $x$ as $$ P(a_k = k) = -\log_2\left(1 - \frac{1}{(k+1)^2}...
0
votes
0answers
45 views

Non-linear differential equation

I have this equation $$y\left(\dot y^2+1\right)=m + \Lambda y^3,$$ where $\Lambda=1.1\cdot 10^{-52} $ (Cosmological constant). I want to get the graph of the solution of this equation (2-parametric ...
2
votes
1answer
178 views

Solution of the linear system using Sherman-Morrison formula for 1000000x1000000 (7450.6GB) matrix using MATLAB

Let $n = 10^6.$ Let $A \in \mathbb{R}^{n\times n} $ be the lower triangular matrix having 1's on and below the main diagonal. We want to solve the following linear system: $$ (A + uv^T)x = b$$ by the ...
0
votes
0answers
21 views

Error analysis of Modified Lentz's method

In Numerical Recipes, the authors state: There is at present no rigorous analysis of error propagation in Lentz’s algorithm. This statement is now ~15 years old, so I wonder has this gap in the ...
2
votes
2answers
89 views

Finite difference method having a discontinuity

I am trying to understand the FDM which is a widely used method solving differential equations by using approximation below. $$\dfrac{\partial u}{\partial x}=\dfrac{u(i+1)-u(i-1)}{2\Delta x}$$ How can ...
3
votes
0answers
42 views

Some formulations of domain coupling lead to saddle point problems. Is this merely an artifact?

Background I wanted to learn how to couple FEM and BEM (for the Poisson equation), because I wanted to better understand how open boundary conditions look like. Therefore I worked through the relevant ...
0
votes
1answer
48 views

How to use cumtrapz correctly?

I have tried to do a trapeze integration with f(x)=x^2, where I know how the antiderivative looks like, so F(x) = (1/3)x^3 Here's my code, just like I tried: ...
0
votes
1answer
26 views

Integrating Matrix Elements TypeError: f() takes 1 positional argument but 3 were given

I'm working on a linear variational problem for a general PIB and I keep encountering the same problem, and I know its a rather simple solution. Any suggestions? ...
0
votes
1answer
54 views

Differences between openfoam and freefem/fenics

I know a little about fenics and freefem. There exists a big difference between those and OpenFoam? They are used in a similar way (editing a file and writing code)? or perhaps it is made for other ...
-1
votes
1answer
22 views

How to connect two cylinders to form a knee in Comsol Multiphysics?

I have this I want it to be single bended wire. How to accomplish?
0
votes
0answers
63 views

Why is my numerical solution to a set of ODEs infinite?

I am trying to solve the following linear PDEs $$\frac{\partial u_x}{\partial x}=-[i\omega b_{||}+\nabla_\perp u_\perp],$$ $$\frac{\partial b_{||}}{\partial x}=-\frac{i}{\omega}\mathcal{L}u_x,$$ $$\...
2
votes
0answers
73 views

Compute Nullspace of Sparse Matrix

I am computing the nullspace of a sparse rectangular $m$ x $n$ matrix $A$, where $m$ << $n$. I do this by computing the QR decomposition of $A^T$ and extract the $n-m$ right-most columns of the ...
0
votes
1answer
88 views

I need help with a variational formulation

For this problem \begin{cases} &\frac{d^2 u}{dx^2}=Log(1+x+y),in \quad\Omega=(0,1)^2\\ &u=0,\qquad on \quad\Gamma_{1}: x=0\\ &u=0,\qquad on \quad\Gamma_{3}: x=1\\ &\frac{du}{d\eta}=0,\...
0
votes
0answers
48 views

Applying the result of Cuthill-McKee in SciPy (followup)

This is a followup to Applying the result of Cuthill-McKee in SciPy , where I'm not sure the answer given is correct. It's also 4 years old, so I'm trying a new question. The question is still ...
0
votes
0answers
35 views

Plotting a Magnetic Field in Spherical Coordinates in Python

I am modeling a Helmholtz Coil as two dipoles from far away and I want to plot the magnetic field. $$\mathbf{B}(\mathbf{r}) = \frac{\mu_0 |\mathbf{m}|}{4\pi r^3}\left(2\cos\theta\,\hat{\mathbf{r}} + \...

15 30 50 per page
1
2 3 4 5
178