All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
652 views

Defining a soft constraint in cvxpy

I am using cvxpy to do a simple portfolio optimization. I implemented the following dummy code ...
0
votes
1answer
63 views

Wanting an explanation of the variables in Iterative PCA algorithm

I've been trying to implement the CPU GS-PCA algorithm in this paper . The code starts on page 28 I have a program written a script in python which gives the same output as the C++ program in the ...
0
votes
1answer
110 views

Using least squares for computing gradients

I am developing a code where I am using the least squares method to compute gradients. Generally, we use least squares to obtain some model based on a set of data (${q_1 \cdots q_N}$) at locations ($...
0
votes
1answer
190 views

CPU and GPU influence on task parallel execution performance

This question is mainly about hardware, but also about software. In my current work I have approximately 68 millions of combinations that I am iterating through, in parallel. For each of those ...
0
votes
1answer
57 views

reduced system: primal-dual interior point method for nonconvex constrained problem

When solving a reduced KKT system of a nonlinear (and nonconvex) constrained program after eliminating slack and dual variables, how do we actually take the next step in a primal-dual method? For ...
0
votes
1answer
44 views

Finite difference time domain and dynamic permittivity

Since the permittivity of any material is usually complex function of temperature, frequency, density, etc. I was wondering if it is possible to use a dynamic permittivity which changes as a function ...
0
votes
1answer
58 views

LAPACK zlapmt_ freezes code [closed]

I'm using LAPACK's zggev_ routine to solve some generalized eigenvalue problem. While it produces the correct results, I want the eigenvalues and according eigenvectors sorted by absolute value. For ...
0
votes
1answer
65 views

Adaptive gradient descent

I want to minimize some multivariable function $\Delta(\alpha, \beta)$. I know that this function has a zero point, $\Delta(5, 5) = 0$. Starting from some $(\alpha, \beta)$ close to $(5,5)$ (e.g. (4....
0
votes
1answer
202 views

How to do a Generalized Complex Schur (or QZ) Decomposition with Eigen C++? [closed]

I would like to do a Generalized Schur (or QZ) decomposition for a pair of complex matrices $A$ and $B$. I found the following class: ...
0
votes
3answers
117 views

Initial conditions for pendulum Jerk equation

I have a very simple problem, but can't seem to understand what I need to do. In simulating a pendulum from it's jerk equation, I'm having a hard time setting initial conditions to get it to work out....
0
votes
2answers
110 views

Second derivative in coordinate invariant form

To solve stationary, incompressible, inviscid and irrotational flow around a circular cylinder, I am using general coordinates. Since the flow is symmetrical, we only consider the upper half of the ...
0
votes
1answer
77 views

Help understanding this numerical surface integration technique?

I'm attempting to write a FORTRAN program that calculates the magnetic field, B, at any point outside of a bar magnet. I'm going to use a first order euler scheme, where each side of the bar magnet ...
0
votes
1answer
108 views

Anyone who knows fine neural network code or module for python?

I want to change my main platform from Matlab to Python due to my work, and I mainly used Matlab for the neural network, so I want to do the same thing in the Python either. I used to make my own ...
0
votes
1answer
105 views

Multi-point axisymmetric boundary condition for Euler equations

I'm solving 2D axisymmetrical Euler's equations in conservative form: $$ \frac{\partial U}{\partial t} + \frac{\partial F(U)}{\partial x} + \frac{\partial G(U)}{\partial r} = H(U) $$ where $$ U = \...
0
votes
1answer
673 views

Crank–Nicolson method for nonlinear differential equation

I want to solve the following differential equation from a paper with the boundary condition: The paper used the Crank–Nicolson method for solving it. I think I understand the method after googling ...
0
votes
1answer
114 views

Runge-Kutta timestep in atomic units

I'm using 4th order RK to solve the schroedinger equation in atomic units. Say I want to simulate 400fs in intervals of h=10fs, then in atomic units this is h=413a.u and 400fs=16500a.u. 4RK involves ...
0
votes
2answers
153 views

Nédélec Elements and Newton-Methods

If you want to develop numerical algorithms for variational inequalities, you often choose a Semismooth Newton Method. In many cases, this approach involves derivatives of $\max$ or $\min$ functions ...
0
votes
1answer
164 views

Finite difference method for the electric field of the electron gun

Can anybody help me to find books or MATLAB code examples for solving electric field of the electron gun(fig.1)with finite difference method? Python code examples are also perfect. The electron gun ...
0
votes
1answer
62 views

Converting acceleration over time to velocity or speed in code

I have acceleration data from a sensor. X Y & Z. I move the senor in the Y axis. Mostly in a straight line. So I ignore x & z. From the sensor documentation 5.2.1 Acceleration output: ax=((...
0
votes
1answer
68 views

standard directory for compiling scientific libraries

I'm trying to build HSL's MA57 library, and to do so, it requires METIS. I've downloaded the .tar files to my Downloads folder, but where do I actually "build" the ...
0
votes
1answer
44 views

Inverting a transition matrix with small grid size

Time is continuous time. I have a 3D state space, and transition rates across all of these. Using the transition rates, I can compute a generator matrix A ...
0
votes
1answer
64 views

Approximation diameter 2-dimensional space

If I have a set A constituded by $n$ 2-dimensional points, how can I find a $\sqrt{2}$-approximation diameter of A, that is the maximum Euclidean distance between any two points in A, in linear time? ...
0
votes
1answer
706 views

Numpy attributes not recognized in Numba [closed]

Numba offers JIT for Python. In its documentation it says "One objective of Numba is having a seamless integration with NumPy." So why including some of the simplest features from numpy isn't ...
0
votes
1answer
95 views

How to treat non-linear term in finite difference solution of $T''_x+T''_y+aT^2=0$?

Can we linearize $T^2$ When solving $T''_x+T''_y+aT^2=0$ by finite difference? I solved $T''_x+T''_y=0$ in Matlab using a finite difference explicit scheme. But when there is a source term, I come ...
0
votes
2answers
117 views

How to solve diffusion equation in Fourier space when mobility is not constant

I want to solve non-classic diffusion equation in Fourier space. The equation is $$∂c/∂t=-∇.J$$ Where $J$ is $$J= -M.∇μ$$ Where M is mobility. It depends on c and $\mu$ is $$ μ= g(c) - \nabla^2c $$ ...
0
votes
1answer
216 views

PDEPE nonlinear

I would like to use Matlab's pdepe to solve this system: $$ s_t =(sr)_x + s_{ xx } \\ r_t =(\frac{ A }{ B }r^2+s)_x + \frac{ A }{ -K } r_{ xx } $$ where $A$, $B$ ...
0
votes
1answer
105 views

Sampling simulation steps logarithmically

The common case of for instance a Monte Carlo simulation is, if we want to run our simulation for $N$ steps, we define a delta $\Delta,$ such that $N/\Delta = n$ tells us the frequency with which we ...
0
votes
1answer
68 views

Principle of virtual work - extra term needed for deformation dependent loading?

I'm working on a problem in nonlinear elasticity, for which the external forces (loadings) depend on the displacements. Following Klaus-Jürgen Bathe's book "Finite Element Procedures", the virtual ...
0
votes
1answer
132 views

pde-constrained optimization

I'm trying to solve a problem where I have a initial and final distribution of tumor, and my goal is to find the best map of parameters (diffusion and reaction terms) for a reaction-diffusion equation,...
0
votes
1answer
299 views

Crank-Nicolson method and mixed derivatives

I am curious if anyone had literature references or knowledge on how to apply the Crank-Nicolson (with approximate factorization) to the $$ \nabla \cdot (\nu (\nabla \mathbf{u} + \left(\nabla \mathbf{...
0
votes
1answer
191 views

Code to output VTK point data from decomposed domain for Paraview [closed]

I am developing a parallel 2D CFD code in C++ using PETSc and would like to use it as an opportunity to learn about VTK/Paraview. Right now, I have each processor output an ASCII file for the portion ...
0
votes
1answer
51 views

Chebychev Polynomial derivatives at zero points and extreme points

I was looking for some help with derivatives of Chebychev polynomials at zero points. The recursive expression, $$ T_{(j+1)}(x) = 2xT_j(x) - T_{(j-1)}(x) $$ has the derivative $$ T'_{j+1}(x) = 2T_j(...
0
votes
1answer
317 views

High precision Discrete Fourier Transform in c

I'm trying to do a high precision discrete fourier transform on a signal. To examine the precision, I use a gaussian function as the signal, because the fourier transform is also a gaussian function. ...
0
votes
1answer
1k views

Stiffness matrix computation for 4 node quadrilateral element

I am writing a finite element code for heat transfer (scalar field problem) and starting from simple 4 node quadrilateral element. I tried computing conductance (stiffness) matrix in the physical ...
0
votes
2answers
111 views

Computable alternative to “almost everywhere”

I am working with finite elements for Maxwell's Equations (i.e. with Nedelec's edge elements) and for computation I'm using the FEniCS-project. While implementing the Augmented Lagragian Method, I ...
0
votes
1answer
44 views

Algorithm to adjust range / scale so it is “nicley” dividable by n

Hard to come up with a good title. I'm looking for an algorithm to adjust a range. Say I have 5.34 as min and 23.96 as max value. This gives it a range/difference of 18.62. I now want to divide this ...
0
votes
1answer
88 views

Reference for Dunavant Quadrature Implementations

I am using Dunavant quadrature in my software, specifically this file by John Burkardt. Recently, I wanted to convert the code into a constexpr code in C++. But ...
0
votes
1answer
30 views

Propagation of error in fitting two sets of data to each other

I have two sets of experimental data: $\phi(t)$ and $I(t)$. In theory they are related to each other as: $\phi(t) = nI(t) $. By fitting these curves together I can find the value of $n$ (which is a ...
0
votes
2answers
225 views

How to represent CFD result when I use grid-centered FVM?

My variables are stored at the center of the cells. How can I transfer these values to grid points? If I calculate the algebraic average value there may be a shock.
0
votes
1answer
190 views

Bifurcation of linear PDE

I have a linear elliptic PDE (unfortunately not allowed to be shown here) with a constant parameter $\epsilon$ giving the stable solutions qualitatively shown by the functions below. As we smoothly ...
0
votes
1answer
53 views

Plotting using 'colorbar' in MATLAB [closed]

I am trying to plot a figure similar to the one attached here,I tried searching how to do a similar kinds of plot and i found about 'colormap','colorbar' in MATLAB. Actually I want to plot this ...
0
votes
1answer
43 views

Implementation of stochastic cellular automata

In my problem, I have a lattice with a stochastic cellular automaton. In order to simplify a bit, let's say it is 1D. In my system, each node can be type A, B or C. A way to represent the system and ...
0
votes
1answer
160 views

implicit method (crank-Nicolson) I not understand the procedure [closed]

I'm trying to understand the passage through this equation can be written for easily solved with the fortran alghorithm in particular i don't understood the meaning of L_x and L_xx ... what (-1,0,1) ...
0
votes
2answers
59 views

will this methodology end up giving me a nonsense regression equation.

I'm wondering if this is a valid methodology to find the best regression equation for a given data set. User provides a rang of estimated value for some set of variables. Th algorithm uses the ...
0
votes
1answer
140 views

Parameter identification for first order ODE

I have two arrays $f(z)$ and $z$ both indexed by k and I want to solve $\frac{df}{dz}=\mu(1-f)$ to find $\mu(z)$ What would be the best numerical method to solve this equation?
0
votes
2answers
321 views

Boundary conditions for streamlines in enclosed flow

I am trying to solve Lid driven square cavity flow problem of Stokes equation using finite element method. I have boundary conditions for velocity as zeros on every boundary but u=1 on top boundary. ...
0
votes
1answer
713 views

Finite Difference Method Limitations/Stability Criteria

Is it possible to solve an equation with only a single derivative such as: $$\frac{\partial U(x,t)}{\partial t} = A - BU(x,t)$$ with finite difference methods? I ask as I am trying to solve the ...
0
votes
1answer
38 views

What software packages are designed towards modelling the radiation from accelerated charges?

I'm interested in modeling the electromagnetic fields radiated from an accelerated charge, but do not want to reinvent stuff if possible. I suspect there are software packages already out there which ...
0
votes
1answer
162 views

Fast chain rule algorithm [closed]

Assume I have two functions $f$ and $g$, with derivatives of $g$ at point $x$ and derivatives of $f$ at point $g(x)$ available. What is the fastest way of computing derivatives of $f \circ g (x)$ ?
0
votes
2answers
138 views

implicit odes solution using fdm

I am solving a non linear second order implicit initial value problem using finite difference method, but my results do not converge. Please guide me with an example, how we can apply finite ...

15 30 50 per page
1
159 160
161
162 163
176