All Questions

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

surface: rows (Z) must be the same as length (Y) and columns (Z) must be the same as length (X) in octave

I am having a dataset and trying to plot a 3-d plot between the independent and dependent variables.but, I am getting this error whenever I am trying to plot here is my code: ...
1
vote
2answers
39 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 ...
0
votes
0answers
9 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
1answer
60 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 $\...
2
votes
0answers
40 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
31 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’’. ...
1
vote
1answer
130 views

How to avoid gsl root finder evaluate function outside its domain

When I use the newton's method or hybrid solver in the GSL package to deal with 1-D or multidimensional root solving problems, the code frequently crashes when the solver requests function value ...
3
votes
1answer
270 views

Efficient root finding algorithm for monotonic function

This is my first time asking a question here, so I may not be asking this in the right place. I am trying to find the roots of a monotonic function with as few function evaluations as possible. I ...
4
votes
2answers
777 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
13 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 ...
-1
votes
0answers
13 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 "...
1
vote
0answers
43 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 ...
2
votes
1answer
67 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 ...
0
votes
1answer
55 views

How can I compute the gradient of the noiseless image given by the compass operator?

I need to generate an image with 11x11 pixels having in the center of the image a square of 5x5 pixels, with the gray level of the background 0 and the gray level of the square is 50. I need to ...
0
votes
1answer
123 views

Finite Element Analysis based on contractions of a subset of edges in enterior of mesh

I am modelling a problem that is "driven", not by typical boundary conditions but, by contractions in its interior. In a finite element analysis, I can specify the new lengths (not ...
5
votes
3answers
125 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 ...
0
votes
0answers
90 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
vote
1answer
176 views

How to make objective elastic SPH model?

I have implemented a constitutive equation of elastic materials (Hooke's law) in my 3D weakly compressible SPH solver based on [1]. The coding seems to be correct. To verify the implementation I ...
0
votes
0answers
46 views

Optimal Weights in Optimization Problem

I am trying to optimize the following problem: \begin{align} \min_{W,x}\left\{\frac{1}{2}||WAx-b||^2_2\right\} \,\,\, s.t. \,\,\,x\geq0 \end{align} With $W\in\mathbb{R}^{n\times 2n}$ being a block ...
2
votes
0answers
39 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
39 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 ...
4
votes
1answer
100 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
38 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 ...
0
votes
0answers
30 views

Upper bound for function involving exponential function [closed]

Prove:$$(1+|\xi|)^{2\rho}\exp(-a\xi^2t)\leq Constant(\rho,a)(1+t^{-1/2})^{2\rho}$$, where $$-\infty<\xi<\infty,a>0,t>0,\rho>0.$$ Many thanks!
-1
votes
2answers
65 views

How to find the relationship between an independent variable in a time series and a single dependent variable

I have a dataset of crop yield of a seasonal crop, under environmental conditions (rainfall, humidity, temperature etc.). Daily environmental conditions are recorded over few years with the crop yield ...
2
votes
2answers
126 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 ...
-1
votes
0answers
39 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
66 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
1answer
98 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)$ ...
-1
votes
0answers
51 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 ...
2
votes
1answer
80 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)...
0
votes
0answers
37 views

2d Ising model simulation (Python) [closed]

There were some problems occurring while I was simulating 2d Ising model. In short, I cannot get the correct "energy-temperature" relationship. Please tell me what's the problem in my ...
0
votes
1answer
55 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 ...
1
vote
1answer
169 views

Translating the Euler code in scipy's solve_ivp

My code is based on the similarity transformation X=VZ.I simulate the model for transformed equations involving Z by replacing ...
28
votes
3answers
22k views

BFGS vs. Conjugate Gradient Method

What considerations should I be making when choosing between BFGS and conjugate gradient for optimization? The function I am trying to fit with these variables are exponential functions; however, the ...
1
vote
0answers
41 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 ...
0
votes
1answer
113 views

Interpreting multivariable root-finding results from Matlab's fsolve algorithm

Edit: So I was able to get the same value of r that's given, when coding up the sum of squares of function values directly in the script file, rather than on the Command Window. So, maybe there's a ...
-1
votes
0answers
20 views

Optimization A* Path finding for C# [closed]

I am creating a game in Unity and have implemented an A* algorithm to do my pathfinding. For 1-3 squares away it performs just fine. But more than that it starts slowing the program down and at 10+ it ...
0
votes
1answer
76 views

How is a wall boundary implemented (using ghost cells) in a simple 2d euler flow solver?

I understand that you must reflect the velocity of the cell across the wall and store that reflected velocity in the ghost cell (which will then be used for flux/residual calculations), but that is ...
2
votes
1answer
115 views

How to extract connected components from persistence diagram?

From the given point cloud (Fig. 1), I use Scipy-TDA to extract persistence diagram (Fig. 2). What I'm interested in is to extract 3 circles. For example, I'd like to know 3 center points and labels ...
4
votes
1answer
382 views

4th order tensor rotation - sources to refer

I am trying to model a linear elastic material in Abaqus using a UMAT. For my application, I need to rotate the 6x6 compliance matrix for a given set of eigenvectors (or a rotation matrix). I came ...
0
votes
1answer
170 views

Pseudospectrum of non square Matrix in Python

I have a rectangular matrix $A \in \mathbb{R}^{m \times n}$ ...
-1
votes
0answers
33 views

How to derive amplification factor for RK4(Runge Kutta method of order 4) - CD2 scheme for one degree hyperbolic function? [closed]

I tried deriving the expression but the different slopes in the RK4 method are confusing. Moreover, when I am referring to various sources I get the same expression for amplification for any spatial ...
1
vote
2answers
65 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 ...
-1
votes
0answers
13 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 ...
0
votes
1answer
58 views

Improving efficiency of FFT for large time window and single frequency pulses

Spectral methods for pulse propagation usually require at least one FFT and one iFFT for each step. In my case I have a two-dimensional radially symmetric electric field (one dimension in space, one ...
3
votes
1answer
85 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
0answers
36 views

Gmsh and an exactly symmetric model [closed]

I have a 2D region that is symmetric with respect to an axis and needs to be studied in isolation. It's an elasticity problem and I hope to get eigenvectors as much as possible symmetric or anti-...
0
votes
2answers
48 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 ...

15 30 50 per page
1
2 3 4 5
194