All Questions

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

Given an unpivoted form of Aasen's algorithm, how does one add pivoting?

I've implemented the version of Aasen's algorithm described in the book Matrix Computations 4th Edition. The version there doesn't have pivoting. The book's description of how to add pivoting is a bit ...
0
votes
0answers
14 views

Plotting piecewise function with python and matplotlib [closed]

Can someone please help me with plotting this graph in python? This is my code so far. I tried plotting it with the equation for each line but it didn't give me the expected result. ...
-1
votes
0answers
19 views

Why did they make Julia array 1-base indexed? [closed]

Why did they make Julia arrays 1-base indexed? Any grounds for this? I think languages with 1-based arrays are doomed :)
0
votes
1answer
35 views

How do I extract the output of Aasen's algorithm into a usable form?

I tried implementing the algorithm in Aasen's 1971 paper on factorizing symmetric indefinite matrices. I've translated the code verbatim from Algol into Python, and I used the test example given in ...
0
votes
1answer
81 views

Is it possible to resample grid in such a way so that continuous objects remain continuous?

Suppose I rasterize a rectangle of width 2.5 gridpoints and get the values as shown: =============== | 0 | 1 | 1 | 0.5 | 0 | Now I resample that ...
3
votes
1answer
39 views

Python documentation on creation of an exponential random variable

I didn't really know if this stack was the right place to post but I was reading the documentation for creating an exponential random variable in numpy. But isn't there a typo. Like shouldn't it be : $...
11
votes
1answer
167 views

Benchmark problems for eigenvalue reordering algorithms sought

Every real matrix $A$ can be reduce to real Schur form $T = U^T A U$ using an orthogonal similiary transform $U$. Here the matrix $T$ is quasi-triangular form with 1 by 1 or 2 by 2 blocks on the main ...
9
votes
1answer
376 views

Increasing V-cycles for constant Coarsest Grid Size and increasing Fine Grid size

Problem statement I implemented geometric multigrid for $-\nabla^{2}=f$ where $f=\frac{3\pi^{2}}{4}sin \frac{\pi x}{2} sin \frac{\pi y}{2} sin \frac{\pi z}{2}$ on $\Omega \in [0,1]$ on a unit cube. ...
0
votes
0answers
16 views

What's the best way to implement a least-squares estimation of a motor system in MATLAB?

Basically, I'm trying to use Least-Squares to estimate the parameters of a DC motor. My system can be modeled by the following matrix equation: $$\begin{bmatrix}V_{input}(t)\\0\end{bmatrix}=\begin{...
1
vote
2answers
74 views

Why are fluid simulations so hard?

Fluid simulations solving the hydrodynamic (HD) or the magneto-hydrodynamic (MHD) equations are very useful in physics, the latter being particularly useful for modeling plasmas. Of course these ...
0
votes
1answer
30 views

inclined/general Dirichlet boundary conditions

For simpilcity, consider a single quad linear elasticity finite element in 2D. The Dirichlet boundary conditions on node 1 and node 2 are easy to implement and can be handled in the standard way. ...
0
votes
0answers
10 views

Problem - Topological orders in the following AOV network

please help me find the answer to this, I am a bit behind (only started sorting algorithms) and need help with this, thank you. Please give all the topological orders in the following AOV network:
3
votes
1answer
421 views

what is the best theory/model to use for prediction in multivariate data?

I use software for pollutant propagation on rivers that takes as input a set of parameters ($p_1,p_2,\ldots,p_n$) and creates an output file which is basically a matrix where on each row the ...
0
votes
1answer
39 views

Probability Density Function of DNS velocity field

I am currently working on a DNS turbulent solver and I would like to compare my IHT simulations to papers. Those papers show the Probability Density Function of the velocity field: I would like to ...
2
votes
3answers
74 views

How to determine if 2 rays intersect?

We are given the 2D coordinates of 2 points: the first point is where the ray starts and it goes through the second point. We are given another ray in the same way. How do we determine if they have a ...
3
votes
2answers
178 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 ...
0
votes
0answers
18 views

Probability Density Function of DNS velocity field [duplicate]

I am currently working on a DNS turbulent solver and I would like to compare my IHT simulations to papers. Those papers show the Probability Density Function of the velocity field: I would like to ...
3
votes
4answers
117 views

Getting torsion and curvature out of ODE solution skeleton

Suppose I have solved an ODE $v'(t) = f(t,x)$ via some adaptive stepper, such as RK4 or Dormand-Prince, generating a list of points $\{(t_i, v_i, v_i' = f(t_i, v_i))\}_{i=0}^{n-1}$. I wish to use this ...
3
votes
1answer
84 views

Symmetric matrix which satisfies conditions of the form $v_i^T X v_i = 0$

I want to solve an underdetermined system of linear equations $A x = b$ with $A \in \mathbb{R}^{n \times r^2}, x \in \mathbb{R}^{r^2}, b \in \mathbb{R}^n$. The matrix $A$ has the following additional ...
0
votes
0answers
15 views

Setting conditions for a given function in python [closed]

I am very new to Python and coding in general. $G(n,t)$ is a function of two variables $n$ and $t$. As part of a code I am writing I need to set up the following condition, if $t=0$ then when $n=0$ we ...
0
votes
0answers
35 views

Learning the art/science of structural idealization

I am a mechanical engineer working in the field of aerospace structures. During the course of my studies, I have studied a course on structural analysis in which I learned 3D Euler-Bernoulli beam ...
1
vote
1answer
61 views

Complexity of solving an image differential linear system

Define an "image differential linear system" as a linear system $A\mathbf{x}=\mathbf{b}$ wherein $\mathbf{x}$ contains the ($\mathbb{R}$) pixels of an image and each row of $A$ constrains ...
0
votes
1answer
127 views

Conserve energy by message passing?

There are $N$ particles with positions $x_i(t)$ and velocities $v_i(t)$ and mass 1. There is a potential function $U_{i,j}(x_i, x_j)$ between each pair of particles, which is $0$ unless the particles ...
0
votes
0answers
47 views

Why is perfect sampling not used in large-scale lattice model simulations?

The statistical physics literature is replete with papers describing simulations of lattice models, such as the Ising model. Typically, these are done through Monte Carlo methods, such as the ...
2
votes
1answer
51 views

Developing a meshfree contouring algorithm

I would like to find the contours of a scalar function $u(x,y)$ available as a discrete set of function values $u_i = u(x_i,y_i)$ over a scattered set of points $(x_i,y_i), i=1,...,N$. In my case, the ...
0
votes
1answer
52 views

why do i receive this error?

I want to plot the 100,200 and 400 iterations of this function of non homogeneous parabolic pde ...
2
votes
1answer
177 views

User friendly scipy optimize wrapper package?

I'm creating too much throw away code for interfacing with the scipy optimize package in a user friendly way. (See code below for example of interruptible optimization that keeps last optimization ...
1
vote
1answer
79 views

Optimization on the multinomial manifolds of stochastic non-square matrices

Thanks for note! So I have an optimization problem with simple form but the decision variable is a large-scale matrix. My problem is similar to a existing problem here about multinomial manifolds and ...
0
votes
0answers
49 views

Finding block structure of a tensor

Are there any well-known algorithms for partitioning a dense tensor into block-sparse form? In other words, I need to find a set of non-overlapping blocks that contain all non-zero entries of the ...
1
vote
1answer
82 views

How do I apply BDF2 in a STRANG splitting

I have a 3D diffusion equation that I want to solve using a time splitting (2D+1D). Assume that $A$ is the 2D discrete diffusion operator and $B$ is the 1D discrete diffusion operator. I want to use a ...
0
votes
1answer
61 views

Handling time derivative as source term in SDIRK methods

I am currently facing some challenge implementing a less traditional PDE which take a form similar to the Navier-Stokes equation, except that the continuity equation is modified such that: $$\epsilon \...
-1
votes
0answers
16 views

Paraview script for image_capturing and file_saving but I can't run it on my University Server, even though all Libraries are correctly installed

so me and my advisor wanted to ta save some scenes from MANY data. Basically I made a trace and it does the job for the data on my PC. After running it through ssh with No-X I got this error: ...
6
votes
1answer
140 views

Parallelize Scipy iterative methods for linear equation systems(bicgstab) in Python

I need to solve linear equations system Ax = b, where A is a sparse CSR matrix with size 500 000 x 500 000. I'am using scipy.bicgstab and it takes almost 10min to solve this system on my PC and I need ...
40
votes
3answers
4k views

What's the state of the art in parallel ODE methods?

I'm currently looking into parallel methods for ODE integration. There is a lot of new and old literature out there describing a wide range of approaches, but I haven't found any recent surveys or ...
0
votes
1answer
64 views

Specifying mesh spacing for DFT in numpy

I was testing the .fft package of numpy 1.16.1 in Python 3.7.2. In particular I was trying to verify that the transform resembles the analytical one for: $$f(x) = \mathrm{exp}\left[-\left(\frac{x-5}{2}...
0
votes
0answers
33 views

Solving system of a lot of equations with high number of unknown : actually find a matricial solution

I have a matrix solution to find from 2 matricial equations. Here the 2 equations to solve with "a" and "b" are the unknow matrices and where ...
1
vote
1answer
114 views

How to solve a linear problem A x = b in PETSC when matrix A has zero diagonal enteries?

I am solving a structural mechanics problem that involves setting constraints, and I use Lagrange multipliers to set it. Consequently, some diagonal entries of the tangent stiffness matrix vanish, and ...
2
votes
0answers
67 views

Time Reversibility of Velocity Verlet Algorithm

I'm very new to computational Physics and am finding conflicting statements on whether the velocity Verlet algorithm, defined as: $\begin{align} x_{n+1} &= x_n + v_n \Delta t + \frac{1}{2} a_n \...
1
vote
3answers
90 views

Tool to compare if two logical expressions are same!

We have challenge in my current assignment where we need to modify/minimize an existing logical expression to another new logical expression. But the result should be the same. For eg: the ask to ...
1
vote
1answer
338 views

Suitable finite difference method for a convection-diffusion system?

I am trying to solve a system of PDEs $H_{t} = \frac{0.3}{0.7} - \frac{0.005 B f(h(H))}{\theta} - \frac{0.3 f(h(H))}{0.7} + \frac{500}{0.7} (HH_x)_x + (HH_y)_y$ $N_t = \frac{N_{in} - 0.002 [N] B f(h(...
2
votes
0answers
68 views

How to derive the adjoint sensitivity equations for a least squares objective function gradient

The Problem I would like to determine the gradient of a least squares objective function which depends on a vector of 40 parameters $p$, and the solution of a system of 32 differential equations. In ...
2
votes
3answers
70 views

Parallelizing evolutionary algorithm on PBS

I have been granted access to a cluster running PBS and I'd like to run a Evolutionary Algorithm (EA) on it. To those unfamiliar with EAs, Wikipedia summarizes it as: Part One: Generate the initial ...
0
votes
0answers
24 views

Solving nearest symplectic matrix with line search, why do we divide by 2-norm?

I was trying to understand the line search method (following the steps proposed by this paper) that given a matrix $A$, returns me the nearest matrix $X$ that is symplectic, i.e. $X^TJX = J$ where $J =...
0
votes
1answer
32 views

Why this error occurs in my code for Lax Wendroff?

I want to implement the Lax Wendroff method for a non linear advection equation which is $$\frac{u_{i}^{n+1}-u_{i}^{n}}{t} + \frac{f(u_{i+1}^{n})-f(u_{i-1}^{n}) }{2h} -\frac{t}{2h} \left( F_{i+1/2}^{n}...
0
votes
0answers
24 views

coordinate expression for tangent lift

I find myself having difficulties to get a concrete coordinate representation of the contangent lift of the configuration space of a mechnanical system. Setupwise, we have a vector field $X \in TQ$ ...
0
votes
0answers
12 views

How to classify collected data into different matrices on Mathematica? [closed]

I have a text with collected data taken for an interval of time for several variables (32) (time, pressure, temperature, height...etc.) The text file just contains values separated by a space, each ...
1
vote
1answer
112 views

How to set up the differential equation system to speed up computation?

I've set up a system of differential equations, obtained after discretizing pde, in the following way ...
10
votes
1answer
323 views

Resources on mesh generation for finite element methods

I know that this is not really apart of the rules as this is a recommendation question and these don't really have an answer per say. But, like this forum posting: https://stackoverflow.com/questions/...
-1
votes
1answer
35 views

Converting for loop from matlab to python

I am converting some MATLAB code in to python and have the encountered the error "ValueError Traceback (most recent call last) in 1 for ig in range(nbas): ---->...
1
vote
1answer
45 views

Asymptotic complexity of fixed-rank SVD

According to the Wikipedia article on Singular Value Decomposition, the asymptotic complexity of computing the SVD of an arbitrary m×n matrix M with m>n by the popular Householder QR methods is O(...

15 30 50 per page
1
2 3 4 5
185