All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

Solving chain of ODE in Julia

I am solving two different ODE whose solutions need to be matched. I am currently doing this by hand, which works great, but I would like to automatise this process. The second ODE takes one of its ...
-1
votes
0answers
21 views

scipy.optimize.minimize(method=“SLSQP”) does not give the minimal value along its own search path

I would like to enquire about a situation I encountered while using the scipy function scipy.optimize.minimize(method="SLSQP"). It seems to loose track of the global minimum in the path of ...
-1
votes
0answers
17 views

TIMESAT Error: Wrong number of sensordata imagefiles in Fortran command window

I am a first-time user of TIMESAT, and am attempting to follow along with this tutorial. http://rstudio-pubs-static.s3.amazonaws.com/452032_a5df2d3f782444fc830d43548a304ec5.html#PartA However, I am ...
1
vote
1answer
88 views

Scientific computing code development hands on introduction

I have a background in Computational Mechanics but my knowledge remains very user-oriented. What I mean by that is that I have a fairely good knowledge about how to use a commercial engineering ...
2
votes
1answer
71 views

How to find the optimum finite difference method for derivatives?

Related to: What are the negatives of using higher order finite diference schemes? Problem: I have some discrete data of a trajectory $x_t$ with errors $\delta x_t$ of a physical system sampled at ...
-1
votes
0answers
19 views

Is there any theoretical analysis why data augmentation usually works? Does it contradict with data processing inequality?

According to data processing inequality, no data processing technique, neither deterministic nor stochastic, can add new information to the original input. Many experiments, however, show improvements ...
1
vote
0answers
36 views
2
votes
1answer
67 views

Changing randomly a unit vector

For studying a spin model on a lattice, I have to generate a random unit vector starting from a pre-exstisting one. There are multiple ways to do it, but the book I use suggests generating a random ...
-1
votes
0answers
29 views

Damping vs. Weighting in large sparse linear inverse problems

In large sparse inverse problems, there are two terms that I don’t have a clear perception of them; Weighting and damping. I know damping relates to the regularization process and weighting is a ...
0
votes
0answers
43 views

Solving this ODE on MATLAB

I have the following ODE - $\frac{dn}{dt} = \frac{1-n}{A} - \frac{u(t)}{B}n , -30\leq t\leq30, n(-30)=1$ where $A,B$ are constants and $n = n(t)$. I can solve this ODE analytically and get an ...
-1
votes
0answers
25 views

Is there any way to develop MultiStart method in c++? [closed]

I have to convert some Matlab code into C++ code. These functions are used in this code. createOptimProblem(....) MultiStart(....) run() I have only basic ...
2
votes
1answer
70 views

Computing the residual in a Dual Weighted Residual (DWR) method

I am in the process if computing the Dual-Weighted Residual (DWR) for a linear PDE with a linear functional but I am struggling with the residual part of the calculation. For example suppose we want ...
1
vote
0answers
45 views

Viable algorithms for efficiently solving a block matrix system with non-uniform sparsity structure

I am trying to use Newton's method to get a stationary solution for a system of equations of the following form: $$ \begin{Bmatrix} \frac{\partial x}{\partial t} \\ 0 \end{Bmatrix} = \begin{Bmatrix} f(...
1
vote
0answers
45 views

Reproducing a paper's result for Topological Insulators

For the past weeks I have been trying to reproduce Agarwala's results but I've been unsuccessful. From this paper I am trying to reproduce the first and last columns of Fig.2, by implementing eq.2; ...
0
votes
0answers
47 views

Displacement field not correct?

Consider the elastic equation $$- \operatorname{div}(C \nabla \mathbf{u}) = \mathbf{f}$$ as presented in step-8. Here $\mathbf{u}$ is the displacement vector, let's consider the 2d case. As you can ...
-1
votes
0answers
24 views

second order finite function for 2D function in Python

My task is to Implement the derivative with the 2nd order finite difference for 2D functions. Evaluate the accuracy of the numerical derivatives of J(x,y) at the point (x = 5, y = −2) by determining ...
1
vote
2answers
82 views

Affecting parts of an array outside MPI process efficiently

This was originally asked on Stackoverflow but instead of migrating it was suggested I repost here and delete that one. I've tried to clarify based on comments there. I'm new to MPI, but I am trying ...
-1
votes
0answers
23 views

Scipy: Sampling a custom distribution

Using Scipy, I would like to draw a random sample according to a certain probability density. The probability density function I consider is defined on the real line and depends on k parameters that I ...
-1
votes
0answers
30 views

Can't understand the proof of the Time-Rescaling theorem

I was reading the following paper: The time-rescaling theorem and its application to neural spike train data analysis and I have some difficulties understanding the proof of the time-rescaling-theorem,...
1
vote
1answer
107 views

Confusion about bilinear form for elasticity equation in deal.ii tutorial

I'm learning how to solve vector-valued problems with deal.II library. In particular, I'm looking at the following introduction from the official website https://www.dealii.org/current/doxygen/deal.II/...
-1
votes
1answer
55 views

Fitting using curve_fit of scipy in python gives totally different answer for 1/t and t

I was trying to fit some data to a single degree exponential decay function but a*exp(-x*t) and a*exp(-x/t) gives completely ...
1
vote
2answers
106 views

Dyadic operations, fourth order tensors and Tensor algebra

I am trying to understand the dyadic operation for a while since I am interested in Elasticity problems. I believe an intuitive understanding (rather than assuming) will give me good problem solving ...
3
votes
0answers
65 views

Strange Picard iteration

I am interested in solving the equation $$ \begin{aligned} \nabla \cdot\left(\nabla \phi-\frac{\nabla \phi}{|\nabla \phi|}\right) &=0 & & \text { in } \Omega \\ \phi &=0 & & \...
-3
votes
0answers
50 views

Operator Splitting and RK4 method

I’m trying to implement the method of Balanced and Rebalanced Splitting in the following problem which is enclosed in Speth’s and Macknamara’s paper ‘’BALANCED SPLITTING AND REBALANCED SPLITTING’’. ...
2
votes
1answer
77 views

Vectorization Matlab/Octave of Markov Matrix Powers

I have just created a code snippet in Octave/Matlab that aims to create a plot which shows the accuracy of an initial probability vector $\vec{\pi}$ derived from the transition probability matrix $\...
0
votes
1answer
105 views

How can I find the maximum equal-split flow of a network

I am working on a program currently that works out the maximum flow through a network using the Ford-Fulkerson algorithm, and that works fine, however, I need the final flow to meet the constraint ...
0
votes
0answers
16 views

Do the class of Construction Heuristic that does or does not change previous decisions have a name?

I'm writing a paper where I am discussing different types of construction heuristics. One type does not change previous decisions when adding new elements to the solution. I'd call them "...
2
votes
0answers
58 views

Hanging nodes in deal.ii tutorials: how is the continuity constraint imposed?

While looking at step6 of deal.ii tutorials, I decided to try to understand how the constraints coming from hanging nodes are imposed. So I started by watching video lecture 16 by prof. Bangerth As ...
3
votes
1answer
77 views

How can I extract the banded or block diagonal part of a sparse matrix in MATLAB?

Given a large sparse (square) matrix in MATLAB, how can I extract the banded or the block-diagonal parts (of fixed size) of it efficiently? These are useful operations when prototyping and testing ...
3
votes
0answers
48 views

Solving PDEs: What is the best way to deal with non-banded/dense jacobians?

I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with ...
0
votes
1answer
46 views

Trying to do a 2D random walk for a particle

I am trying to perform a two-dimensional random walk for a particle, but I am not getting the desired result. The plot produced is a linear plot, which obviously should not have been. Similar code for ...
5
votes
3answers
146 views

Automatic finite differences

Given numbers $x, y \in \mathbb{R}$ where $$\frac{|y-x|}{|x|}$$ is small, and code that implements the function $f$ with a sequence of arithmetic operations, I would like to compute to high accuracy ...
4
votes
3answers
844 views

How important is learning hardware/architecture for scientific computing?

Apologies if this is a bit of a soft, unclear, or opinion-based question. I'm a relatively new PhD student in a (computational) quantum chemistry group. My group develops and maintains a few software ...
0
votes
0answers
40 views

Can this volume intgral be expressed as a convex function?

This question is related to the following: https://math.stackexchange.com/q/4151405/685910 - the context is summarized below for clarity. In the setting of convex optimization, I am looking for a ...
4
votes
1answer
111 views

Weak Formulation of Poisson's Equation for Electrostatics with Surface Charge

I am currently attempting to use FEnICS to solve an electrostatic problem with two materials of different permittivity $\varepsilon_1$ and $\varepsilon_2$ forming an interface: Consider a domain $\...
0
votes
0answers
95 views

How to interpolate stress at unknown points from the stress values available based on geometrical position for constant load?

I am working on a combined contact, bending, and torsion problem. I have data on geometrical points and their instantaneous stress components. However, based on the available data, I have to ...
-1
votes
0answers
46 views

scipy solve_ivp with adaptive solution

I am struggling to understand how scipy.solve_ivp() handles errors in a system of ODE. I have a complex systems of ODE with very large varying time-scales, for which my state "y" is composed ...
0
votes
0answers
70 views

Transient advection equation with stabilized FEM

I am interested in solving the transient advection equation $\left\{\begin{array}{ll}\partial_{t} u+\beta \cdot \nabla u=f & \text { in } \Omega, t>0 \\ u=0 & \text { on } \partial \Omega^{-...
-1
votes
0answers
58 views

Problems with 'ODEint - Excessive work done' and using pySINDy

I am create syntetic data from a system of differential equations describing the COVID-19 epidemic and then I try to use the method SINDy to recreate the differential equations from the data. Link to ...
-1
votes
1answer
102 views

How do I calculate the Jacobian of this function?

I have two vectors $r$ and $m$. Both vectors are $N\times1$. A function is calculated as - $F(1:N) = \phi r + (r^3 + rm^2)$ $F(N+1:2N) = \phi m + (m^3+mr^2)$ ...
0
votes
1answer
56 views

GNU Octave: using 'parallel' with an array (apply function to each array member)

I am new to GNU Octave 6.2.0 on Linux, and I am trying to use the package 'parallel' to make use of 24 threads on my machine. I have an array (array1) that has ...
2
votes
1answer
83 views

discretizing surface integral using nodal DG method

I am currently learning nodal DG methods, primarily through the book by Warburton, and am a bit confused on how to handle surface integrals using straight edged elements. On page 187 (and on page 214)...
1
vote
0answers
44 views

Constrained optimization for non-linear equations in octaveGNU

I have installed Optim1.6.1 package. I would like to solve a system of equations in non linear finite element analysis using constraints as u=1 at certain nodes. u=0 at certain nodes. Typically I find ...
-1
votes
0answers
15 views

Can Catboost Regressor be leveraged for ordinal regression?

Customer satisfaction is generally an ordinal variable on a scale of 1 - 5, where 5 is the best score. Ordinal regression is used to regress such variables. Can Catboost Regressor, handle such a ...
1
vote
2answers
67 views

Reference for mass matrix assembly

I will now explain what I understand to be the process of a finite element mass matrix assembly. I would like a reference which does something similar, or if I am mistaken about the process please let ...
2
votes
2answers
162 views

How to implement point source or volume source in finite element implementations

I'm trying to do a simple implementation to study the advection-diffusion-reaction dynamics in a straight pipe. I have points positioned along the length of the pipe (blue dots in the image above). I ...
3
votes
1answer
86 views

Calculating the Jacobian for a function containing a derivative

I have the equation $F(t) = \phi u + \frac{1}{2}\frac{d^2u}{dt^2} + u^3$ and broadly speaking, my task is to calculate the $\phi$ and $u(t)$ such that $F(t) = 0$. I am testing out a new algorithm to ...
0
votes
2answers
49 views

Passing in user inputs with mpirun

I am building a quantum circuit simulator using mpi4py. The simulator takes user inputs to build the initial system and quantum gates the system passes through. I can get the code to work if I do not ...
1
vote
0answers
53 views

For a hyperbolic PDE, is there any proof that the BDF2 method is stable for integrating them?

I would like to ask a question on the stability of BDF2 applied to hyperbolic PDEs. Say I have a hyperbolic equation as $\frac{\partial c}{\partial t} + {\bf U} \cdot {\bf \nabla}c=0$. This system is ...
3
votes
1answer
71 views

`eigsh` (Lanczos algorithm) slows down for degenerate eigenvalues

I have a complex Hermitian matrix of size about $70000\times 70000$. I want about 100 eigenvalues near 0. However, I know that every eigenvalues are two-fold degenerate. I found out that the running ...

15 30 50 per page
1
2 3 4 5
194