All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
6 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 ...
0
votes
1answer
54 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
22 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 ...
1
vote
1answer
83 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 ...
0
votes
1answer
49 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 ...
1
vote
1answer
33 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+\...
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 ...
4
votes
1answer
116 views

How to define a dimensionless Objective function for determining how peaked a curve is?

I have attached 2 plots for FFT spectra. One is considered good and one is bad. The good one is classified on the basis of how closely spaced the frequencies and the bad is based on how multiple ...
2
votes
1answer
57 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$?
0
votes
0answers
31 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 ...
2
votes
1answer
345 views

How to implement flexible gmres in matlab?

About the flexible GMRES (fgmres), we know that it is a variant of right preconditioned gmres. And the robust command gmres in matlab as follows: ...
0
votes
0answers
9 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: ...
1
vote
1answer
30 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{...
4
votes
1answer
124 views

Differences between Discrete Fourier Transform and Continuous Fourier Transform?

I am trying to visualize the time dependence of a free particle given an initial wave-function using Python and I just wanted to know if I could use the in built FFT implementation from NumPy to find ...
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 ...
1
vote
0answers
69 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 ...
3
votes
1answer
375 views

General case Kutta condition

I'm working on a 2D inviscid fluid simulation using a "panel method", with Potential being used to enforce the no-through boundary condition. I'm trying to incorporate the Kutta condition, which says ...
0
votes
1answer
45 views

Solving an ODE using odeint in Python and continuing the integration

The following relates to the linked question: Scattering of waves in a symmetrical potential (using python) I have attempted to solve the problem for $U(r)$ using ...
1
vote
0answers
70 views

Plot of ratio of two integrals:

Consider the following integrals $$ I_1(x) =\int_0^\infty\mathrm dy \frac{F(x + \mathrm iy) − F(x −\mathrm iy)}{\mathrm e^{2πy}-1}, $$ And $$I_2(x) =\int_1^x F(t)dt$$ Where, $ F(z) = \sin^2[π\Gamma(z)/...
2
votes
2answers
103 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
26 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 ...
1
vote
1answer
64 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 ...
2
votes
1answer
54 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 ...
4
votes
2answers
523 views

Data analysis of a magnetic hysteresis loop

I am a physics undergrad and I have MOKE data for a magnetic material (thin permalloy film on a silicon substrate). Here is one of the hysteresis loops I obtained, plotted using Python: The form of ...
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 ...
2
votes
0answers
42 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) ...
7
votes
2answers
241 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 "...
0
votes
0answers
83 views

Propagation of a Gaussian beam using FFT

I am trying to simulate the propagation of a gaussian beam through a lens using an FFT approach. I tried to implement the approach described by Couairon in this paper at page 43: https://link....
0
votes
1answer
76 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} =...
2
votes
2answers
59 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 ...
0
votes
2answers
158 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}...
17
votes
6answers
41k views

Python vs FORTRAN

Which one is better: FORTRAN or Python? And I guess that in both cases you need Gnuplot, am I right? I'm working on a Windows machine at the moment. I'd like to use it to get numerical solutions for ...
1
vote
0answers
27 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 ...
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?
1
vote
1answer
80 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
24 views

Are superluminal computers possible? [closed]

I have no idea how a computer works on the lowest voltage moving through tiny circuit chips level, but if you wanna travel space from one star to another, don't you need a faster than light ...
1
vote
2answers
91 views

Using MILP to place a set of primers along a genome

Define variables $p_i,u_i\in\{0,1\}^G$, for $i=1,\ldots,8$ and $G=30000$. Let $v$ be a constant vector also in $\{0,1\}^G$, with approximately 25% of its entries equal to $1$ (randomly located). Let ...
1
vote
1answer
76 views

Methodology Suggestion for Wave-propagation Problem using Finite Elements

I want to simulate the propagation of a sinusoidal plane wave in a rectangular domain using Finite Elements Method. First, the wave should propagate through a fluid medium, then it will encounter a ...
1
vote
2answers
184 views

Why OpenFOAM uses its own data structures and linear solvers?

I wonder why OpenFOAM code has its own data structures Lists, HashTables, ... etc. when there is the STL in C++? Another ...
2
votes
1answer
176 views

Solving nonlinear PDE with finite difference based on Newton-Krylov

I am now working on solving MHD equations with finite difference method, which include nonlinear equations: $$ \frac{\partial\rho}{\partial t}+\nabla\cdot\left[\left(\rho_0+\rho\right){v}\right]-\...
1
vote
1answer
745 views

Flux boundary condition in solute transport

I have a pretty naive question, though important to me. Usually when solving the following PDE in solute transport: $\frac{{\partial C}}{\partial t } = \nabla. (D\nabla C -vC )=0,$ one can be asked to ...
8
votes
2answers
7k views

Use of machine learning in computational fluid dynamics

Background: I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for ...
-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 ...
2
votes
1answer
176 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
1answer
53 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
0answers
14 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 ...
18
votes
4answers
3k views

Is half precision supported by modern architecture?

I am new to computer science and I was wondering whether half precision is supported by modern architecture in the same way as single or double precision is. I thought the 2008 revision of IEEE-754 ...
5
votes
1answer
134 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}...
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 ...

15 30 50 per page
1
2 3 4 5
178