All Questions

-1
votes
0answers
25 views

Approximation of ODE solution using Taylor series methods

This is my first post on here, so please excuse mistakes if any. I am trying to plot out the difference between two ODE solvers based on Taylor series: 1st order acccurate: $x(t_0 + h) = x(t_0) + ...
0
votes
0answers
13 views

Determining the pseudo-time period of a system of $n$-pendulums via Kane's method in Python

We can use Kane's method to integrate the equations of motion for a system of $n$ pendulums with arbitrary masses and lengths (see derivation). In particular, if $(x_i,y_i)$ denotes the Cartesian ...
0
votes
0answers
23 views

In-exact line search

In my class notes, the author says: "If $f:\mathbb{R}^n \to \mathbb{R}$ is bounded below and $p_k$ is a descent direction and the $\alpha-\beta$ also known as Armijo-Goldstein condition is met then ...
1
vote
0answers
33 views

$H^1$-convergence rate of finite element method for Poisson equation, depending on element order

I wanted to verify my FEM-program by applying the method of manufactured solutions, while solving the Poisson equation in two dimensions using the continuous Galerkin method $$-\nabla^2u=f$$ with $$u=...
0
votes
0answers
41 views

gsl-config: command not found HPC cluster [on hold]

I am trying to install the gsl libraries in a HPC cluster, so I don't have root access. I am following the instructions here. The problem is that when I type ...
-1
votes
0answers
16 views

How to model a hysteresis behavior using MILP on CPLEX?

The question is below: 1: y[t]=10,if x[t]>=2; 2: y[t]=-1,if x[t]<1; 3: y[t]=y[t-1],if 1<=x[t]<2. How to model the function in cplex using c++? Thank you very much! My model is added as "...
-1
votes
0answers
30 views

System of coupled differential equations

I have a system of non linear coupled differential equations. I would like to use the finite difference to solve t but some left BCs are missing (though I have enough BCs to make it well posed). Can I ...
2
votes
1answer
55 views

Generate high n quantum harmonic oscillator states numerically

How can I generate the higher $n$ quantum harmonic oscillator wavefunction (in position space) numerically? Here, higher means around $n=500$, or say $n=2000$, where $n$ is the $n$th oscillator ...
0
votes
0answers
19 views

Linear Programming with Integral Contraint

If I calculate that one of the contraints is integral, can I accurately say this is a correct result? Ultimately, is it acceptable?
-1
votes
0answers
41 views

MHD - How to impose a solid, perfect insulator as a boundary condition?

Consider the following MHD equations: $$\frac{\partial \rho}{\partial t}+\nabla\cdot(\rho\vec{u})=0,$$ $$\rho\frac{D \vec{u}}{Dt}=\vec{j}\times\vec{B}-\nabla p,$$ $$\frac{\partial\vec{B}}{\partial t}=\...
2
votes
2answers
134 views

C standard for computational science

Which C standard should be used for computational science code ? Should we keep compatibility with C89/90/ANSI or jump to C99 or C11 ? Context: Code will use third-party : BLAS, LAPACK, MKL, ...
1
vote
0answers
69 views

How to simulate water, falling under gravity, and impinging on a curved surface, which is kept/present in a domain, containing air?

TL;DR: How do I simulate a hole, at the bottom of a (full) water tank? I am attempting to simulate water, flowing out of a hole/slit, at the bottom of a tank (Water Domain) (under the influence of ...
1
vote
0answers
29 views

Computing a Flux Integral in Paraview

I am currently looking into post-processing of simulation data using Paraview. I would like to compute certain integrals of field quantities. As an example, consider the following surface integral of ...
1
vote
1answer
72 views

Computing the Inverse of a matrix, using the Cholesky decomposition

I have to compute $CA^{-1}B$ and $CA^{-1}x$, where $A,B,C$ are conformable matrices and $x$ is a vector. I've read that the a very computationally stable way to compute these inverses is by computing ...
2
votes
0answers
56 views

Best way to numerically compute elliptic integrals of the third kind with complex arguments?

I need to compute elliptic integrals of the third kind with complex arguments, preferably in C++. Is there code out there to do this? I have discovered the Arb library, but that does much more than I ...
-1
votes
0answers
10 views

Use data from VRML 2.0 UTF-8 file to make a 3D representation of object with mplot3d

I have a VRML file with three types of data, points; normal-vectors; coordIndex. I have successfully, using re, imported the data into Python. I thought I had a way of using this data to make a nice ...
0
votes
0answers
82 views

Calculate distance between observer and cube excluding the distance inside the cube

I am trying to calculate the distance between two points where one is an observer and has no size and where the other point is a cube with the dimensions {1, 1, 1}. The distance will be the distance ...
-1
votes
0answers
62 views

How well do finite volume methods ensure that no flux flows perpendicular to the flux vector?

Finite volume methods find approximate solutions to equations of the form: $$\frac{\partial \vec{u}}{\partial t}+\nabla\cdot(\vec{f}(\vec{u}))=0.$$ My question is has anyone done any analysis on how ...
3
votes
2answers
71 views

Analytical convergent sequence and numerical divergent sequence

Is it possible to construct a sequence that converges in theory but when computed numerically with a computer program is diverging. I feel that today our computer programs doesn't allow such ...
3
votes
0answers
54 views

Block matrix and DSYRK

I want to compute the matrix $$ A = \sum_{i=1}^N v_i v_i^T $$ where each $v_i$ is a given vector of length $2500$, so that $A$ is $2500 \times 2500$, and my $N$ is about 2 million. Rather than call ...
2
votes
0answers
92 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 ...
6
votes
0answers
50 views

Quadrature methods for peaky integrands

Consider $$ I = \int_{-L}^L f(x)dx, $$ where $f(x)$ is real-valued and analytic on $[-L,L]$, but it has a pole in the complex plane whose real part lies in $[-L,L]$. Call it $z_0$, and assume it is a ...
0
votes
0answers
18 views

Is this a form of stochastic gradient descent?

I want to minimize the following with respect to parameters $B$. $$\sum_{k = 1}^{K} f(A_{k}, B)$$ where $A_k$ are $K$ different data-sets and $B$ is a matrix of parameters. Can I do this by a ...
-2
votes
0answers
34 views

python Simpson integration [closed]

Currently, I am trying to apply a Crank-Nicolson method on a function that I want to evolve. However, I am only facing one drawback and it is the step when I normalize the initial function using the ...
0
votes
1answer
18 views

Gmsh: Recombine 2D in script file or command line

I have many STL files and I want to reduce their size, so I use Gmsh in this way: gmsh -2 -bin -format vtk -o file.vtk file.stl -0 It reduces the size from 7 MB ...
2
votes
2answers
105 views

How does a stiff equation solver work?

I am trying to understand how stiff differential equations are solved. For instance the equation, $$\frac{\partial y}{\partial t} = \alpha\frac{\partial ^2 y}{\partial z^2}$$ can be solved using ...
0
votes
1answer
52 views

coupled equations with finite difference method

I have these three differential equations in which I need to solve numerically: $$ \frac{dn_0}{dt}= -n_0(t)W_{01}(t) + n_1(t)K_{10} $$ $$ \frac{dn_1}{dt}= -n_1(t)W_{12}(t) - n_1(t)K_{10} + n_2(t)K_{...
-1
votes
0answers
81 views

Optimal way of comparing the lines of different files

I have 1600 ASCII files with 1000 lines in each file. Each line has only one entry and is a floating point number e.g. 1.67923. Let's denote the line1 of file1 with ...
3
votes
2answers
79 views

DFT of $g(\omega) \exp(i C \omega^2)$. How to do it ,if uniform sampling requires too much memory?

I have a following problem : I want to transform a function $g(\omega) \exp(i C \omega^2)$. $g(\omega)$ is real and limited. It changes slowly compered to $\exp(i C \omega^2)$. I have a black box that ...
-1
votes
0answers
61 views

Finite difference method for conservative form of equations

My question is about how do we discretize the equations in the conservative form using finite difference method. I'm trying to solve Euler equations in conservative form. $$ \frac{\partial u}{\...
3
votes
1answer
99 views

Derivation of backward differentiation formulas(BDF)

I have been reading upon numerical techniques that are used to solve stiff ordinary differential equations. From the description given here, I could follow the steps till equation (5). I am finding ...
-1
votes
0answers
46 views

Matlab: how to solve high dimensional symbolic linear ODE?

For a linear ODE $\frac{d\textbf{x}}{dt}=A\textbf{x}$ with symbolic parameters, i.e. $A$ is a matrix with symbolics such as $A=[k1,k2;k3,k4]$, how to efficiently get the symbolic solution from MATLAB? ...
-1
votes
0answers
31 views

How to solve sparse binary system of linear equations

I have a binary square matrix $A$ of size $n=n_1+n_2$. I have to solve system of linear equations $AX=b$. I known for each row out of first $n_1$ entries $l_1$ are 1 and next $n_2$ entries $l_2$ are ...
0
votes
1answer
47 views

Python Finite Difference Schemes for 1D Heat Equation: How to express for loop using numpy expression

Hello all, I've recently been introduced to Python and Numpy, and am still a beginner in applying it for numerical methods. I've been performing simple 1D diffusion computations. I suppose my ...
-1
votes
0answers
60 views

Understanding how to solve DAE

I am solving the following pde that is discretized in space using method of lines, in MATLAB using ode15s. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\...
0
votes
1answer
28 views

Software for cellular automota

I would like to do simulations using cellular automata to describe the behavior of influenza. What software do you recommend?
0
votes
1answer
19 views

Binary tree for 2 elements [closed]

I want to understand Binary Search for 2 element list made of 1,2. I draw a tree as below. Is it correct? If I want to search for an element 2, it will make 2 comparisons. If I want to search for ...
1
vote
1answer
36 views

Finite difference - Explicit / Implicit / Crank Nicolson - Does the implicit method require the least memory?

Examine a dynamic 2D heat equation $\dot{u} = \Delta u$ with zero boundary temperature. A standard finite difference approach is used on a rectangle using a $n\times n$ grid. For the resulting linear ...
2
votes
0answers
33 views

Does quantum espresso and VASP use same same self-consistent-field procedure?

The codes Quantum Espresso (QE) and Vienna Ab initio Simulation Package (VASP) both use plane wave basis sets and psuedopotentials. Most of the codes in both implementation of DFT uses Fortran code. ...
0
votes
1answer
23 views

Gradient ascent method with a constant step size?

I'm trying to use the gradient ascent method on a convex function like the multivariate-Normal density function with respect to its parameters (the original is a bit more complicated), something ...
2
votes
1answer
88 views

Analytical Solution of Transport Equation

I'm looking at the analytical solution of the convection-diffusion equation $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$ with initial ...
0
votes
1answer
42 views

Simulating Brownian motion in 3-D for first hitting time?

I want to simulate Brownian motion in 3-D for the following conditions: $$p(x=0,y=0,z=0,t=0)=1$$ $$p(x,y,z=c,t)=0$$ where $p$ is the probability of finding molecules in the 3-D environment. I want to ...
0
votes
1answer
40 views

Solving Vectorial Poisson Equation in FENICS

I am trying to solve the following, "test problem" involving a vectorial Poisson equation: $$-\nabla^2 \vec{A}=\vec{J} \quad \forall x\in\Omega=[-1,1]^3$$ $$ \vec{A}=\vec{0} \quad \forall x\in\...
-3
votes
1answer
60 views

Stuck in infinite loop [closed]

...
2
votes
2answers
142 views

Best software to do big number calculations quickly

I am trying to do some work on some math conjecture. I am testing the conjecture numbers using very large math numbers (100+ digits ). I am currently using python to test these numbers. In the ...
-1
votes
0answers
25 views

Non-Linear Optimization Using NLOPT library in C++

NLOPT (Non-linear optimisation library) clearly mentions that non-linear constraints may not be satisfied at an intermediate step of optimisation, but if one uses maxeval() function as stopping ...
-1
votes
0answers
42 views

How to discretize continuity equation with velocity calculated using Darcy's law?

$$ \partial_t(\epsilon_g\rho_g)+\partial_x\cdot(\epsilon_g\rho_g\mathbf{v}_g)=\Pi $$ I want to program normal continuity equation and Darcy's law to calculate velocity. $$ \mathbf{v}_g=-\frac{1}{\...
1
vote
1answer
37 views

Step size updating scheme adaptive embedded RK methods

If I have a RK method $y$ of order $p$ and a RK method $z$ of order $p-1$ I have read I can estimate the local error as $r_{n+1} = y_{n+1} - z_{n+1}$. First of all I don't see how this estimates the ...
0
votes
2answers
56 views

TVD for temporal dicretisation

I have come across schemes where TVD (with flux limiters) is used for spatial discretisation along with Runge-kutta for Temporal discretisation. Can TVD be used for Temporal discretisation? If so ...

15 30 50 per page