All Questions

1,652 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
101 views

Integration in MATLAB: Complicated integrand

Can I solve the integral given below using Matlab? $$\frac{C(J)}{C_0} = \frac{2e^J}{\pi}\int\limits_{0}^{\infty} \frac{e^{\frac{\gamma}{2}\left[1 - \sqrt{\rho}\cos(\theta/2)\right]}}{a_1^2 + a_2^2} [...
0
votes
0answers
129 views

system of coupled nonlinear ODEs with complex coefficients

I am interested in numerically solving the following system of coupled ODEs $$\left(i-\frac{1}{2\Omega}f_{m,n}\right) \frac{d a_{m,n}(t)}{dt} =E_{m,n}^{\text{kin}}(t) + \left(\omega_{0}+V_{m,n}-\frac{...
0
votes
0answers
62 views

Quick scheme for separable first-order ODE

I'm trying to integrate an incredibly simple ODE: $$ y'(x) = -f(y),\quad y(0) = y_0 \ , $$ from $x=0$ to $x=1$. This is a decay type of equation, $f$ is the (variable) decay rate and $y$ is the ...
0
votes
0answers
620 views

Efficient Implementation of the Log Sum Exp Log trick for Preventing Underflow erros

So I'm constructing a Gibbs sampler for a moderately sized graphical model, and I started encountering underflow errors (the computed relative frequencies were all very small). To get around this, I'...
0
votes
0answers
249 views

Calculation of phonon dispersion

I have a couple of conceptual questions regarding the calculation of phonon dispersions. I wish to calculate the phonon dispersion of Nickel with my lattice vectors given by [111], [1-10] and [11-2] (...
0
votes
0answers
77 views

Solving condensate density problem in MATLAB

I want to solve for $n_{0}$ for a fixed value of $n$, lets say $n=1$ $$ n= n_{0}+ \dfrac{1}{2}\int_{-1/2}^{1/2}dq\left(\dfrac{e_{q}+Un_{0}}{\hbar\omega}-1\right) $$ where $e_{q}=2[1-cos(2\pi q)] $ ...
0
votes
0answers
65 views

approximation of nonlinear time-dependent system with history

I have two time-dependent coupled equations. One of which is several orders of magnitude more computationally demanding than the other. I am trying to use machine learning to reproduce the behavior of ...
0
votes
0answers
397 views

how to pick a submatrix of a sparse matrix quickly(matlab)

I have a large sparse matrix A and i want to pick the submatrix of it to do block jacobi iterations. For the blocks, i have get a matrix Q that contains the index of nonzero entries in its Jth column ...
0
votes
0answers
165 views

Iterative algorithm prove precise conditions for convergence

Question: Consider the iterative improvement algorithm below. Starting with $Az_i = r_i$ and $(A + E)\hat{z}_i = r_i$ derive a formula showing how the absolute error in the $(i + 1)^{st}$ iterate $\...
0
votes
0answers
196 views

Histogram separation energy equation based on Bhattacharyya

I am working in level set method, specially Lankton method paper. I try to implement Histogram Separation (HS) Energy problem (Part III.C). It based on Bhattacharyya to control the evolution of ...
0
votes
0answers
1k views

Finite differences and Neumann boundary conditions

I am dealing with a highly nonlinear system of two PDEs. I already have a code to solve the system in case of Dirichlet boundary conditions. The explicit system is: $$ \begin{eqnarray*} \partial_{t}u ...
0
votes
0answers
65 views

Tecplot Span-Wise Loading Visualization

all. I have data from a CFD simulation for a wing, and I need to obtain a visualization of the span-wise load distribution. I'm attempting to do this using Tecplot. I've tried using 'slices' and '...
0
votes
0answers
203 views

advection diffusion equation

Would you know what is the condition for stability for the advection-diffusion equation where we treat the diffusion part using Crank-Nicholson and the advection part using FCTS (forward in time ...
0
votes
0answers
193 views

Givens method for sparse matrix

I have a (very) large sparse matrix in CSC form and I'm supposed to factorize it. I've read that between Givens and Householder transformations, Givens is better for a sparse matrix. The problem is ...
0
votes
0answers
129 views

Algorithms to compute largest gap between smallest nonzero eigenvalues of sparse symmetric matrix

I am looking mainly for c/c++ implementations but also for theoretical algorithms to compute gaps between smallest positive eigenvalues of symmetric, singular matrix or real numbers. To be precise, I ...
0
votes
0answers
665 views

how to visualize velocity from Lagrangian particle tracking method

I have few particle's position and velocity information as a function of time. Particle is following a trajectory path, while doing so, one particle may disappear, other particle may appear. Particle ...
0
votes
0answers
83 views

References on the topic of DEM and XDEM

DEM: discrete element method. XDEM: extended discrete element method. For my current project of furnace simulation with granular materials, I am interested in the methods mentioned above. I have not ...
0
votes
0answers
55 views

Energy anomolies in many body simulation

I am trying to simulate the gravitational interaction between many bodies. I am using a direct PP force calculation and a 4th order symplectic integrator with a variable step size. The energy of ...
0
votes
0answers
3k views

Stationary solution converge but time dependent doesn't

I've coupled a COMSOL model for fluid dynamics with a very simple pde that model the transport of humidity in air. When I solve it for the stationary case, the solution converge easily, but when I ...
0
votes
0answers
207 views

computation complexity of OLS in estimating a VAR model

Could someone tell me the computation cost of using Ordinary least squares in estimating a Vector autoregression model? I am thinking the cost is O(n) where n is the number of the training instance. ...
0
votes
0answers
377 views

How to move particles in a variational Monte Carlo simulation?

I'm attempting to implement some code that moves particles and then calculated the acceptance/rejection of the move, but I'm stuck in a rut. Here is my Python code: ...
0
votes
0answers
165 views

Permissive Math Library for Parameter Statistics in C++

I am looking for recommendations for a C++ math library, with a permissive licence, well suited to calculating a wide variety of statistics on segmentations of timebased parameter data. I would be ...
0
votes
1answer
41 views

Shooting Method- Boundary value problem starting from -1 to 1

The equation is $\rho \frac{d \bar{u}}{dy} = -\frac{d\bar{p}}{dx} + \mu\frac{d^2\bar{u}}{dy^2} $ with boundary condition $u(-1)=0$ and $u(1)=1$ I am to solve it using fifth order runge-kutta ...
0
votes
1answer
1k views

Faster code for double integration using Gauss-Legendre quadrature

I came with a the following code to evaluate a double integral using Gauss Legendre quadrature in MatLab ...
0
votes
1answer
33 views

Generating pseudorandom sequences based on measured sequences

I'm looking for an algorithm to generate discrete-time pseudorandom sequences based on other sequences I already have that would be used to train the algorithm. More specifically, I have some time-...
0
votes
1answer
234 views

Applying Runge-Kutta to nonlinear system of PDEs

I am applying a 4th order Runge-Kutta code, using the method of lines, to solve the following: \begin{equation} \frac {\partial y_1}{\partial t} = y_2 y_3 - C_1 y_1 \end{equation} \begin{equation} \...
0
votes
1answer
233 views

Robust Counterpart of an uncertain LP

Consider the following robust optimization problem: min c'x s.t.: $Ax\geq b \;\;\forall (A,b)\in \mathcal{U}$. Why can the robust counterpart of the problem be written in this form? $min_x{\{ ...
-1
votes
0answers
10 views

Using Patchmatch for image inpainting

I've been reading over the Patchmatch paper and sample repositories and I understand what the algorithm does. It finds pairs of pixels between two images (or the same image) that have similar ...
-1
votes
1answer
21 views

Recursive Algorithm to Calculate Determinant via Expansion of Minors in C#

I have been recently trying to attempt to write an algorithm in C# that would calculate the determinant of a matrix via recursion using the expansion of minors method. I understand that there are ...
-1
votes
0answers
9 views
-1
votes
1answer
40 views

Smoothed Particle Hydrodynamics: Weird clustering of particles. Is that normal?

I implemented a rather simple SPH simulation using a cubic-spline-kernel and a simple non-iterative pressure solver as described in this PDF in equation 9. I followed algorithm 1 of that paper (...
-1
votes
0answers
15 views

Counting number of calls to union operation while creating disjoint set from an undirected graph

I am working through an algorithms book, and I am having trouble understanding the solution to a problem in the book. This is found in the Introductions to Algorithms book in Chapter 21 on disjoint ...
-1
votes
0answers
73 views

Solving one dimensional diffusion equation

This is a followup to my previous post here. I'm solving a 1 D diffusion equation using Dirichlet boundary conditions on both the boundaries, left and right. $$\frac{\partial C}{\partial t} = D\...
-1
votes
1answer
86 views

Imposing periodic boundary condition for linear advection equation - Node problem

I've spent the whole day trying to figure out what is the correct way to impose (and implement) periodic boundary conditions $u(0,t)=u(1,t)$ for all $t>0$ for the simple advection equation $u_t + v ...
-1
votes
1answer
55 views

Simulating magnetic particles in a field free point generated by two opposing magnets

This is probably a long shot with such a short time, but I've been trying to get theoretical data for a project I'm working on. The project involves using a very simplified version of magnetic ...
-1
votes
1answer
70 views

Finite element convergence rate and possion's ratio

I am running simulations of a cantilever beam where it is fixed on one end and negative force applied to the other end. The first simulation is with 4-node linear quadrilateral elements and the other ...
-1
votes
1answer
23 views

Semi-Definite relaxation of non-linear constraint?

I am implementing an optimization problem using semi-definite approach. One of my constraints is of following form $ trace(A∗X)−(k∗trace(A∗X))+(k∗\sqrt {(trace(B∗X)} )==0$ where k is a constant, A ...
-1
votes
1answer
235 views

Gauss-Seidel method convergence

I am currently programming a code to find the equilibrium function that satisfies the poisson equation in 2D. In order to do this I use finite difference methods and the discrete equation I want to ...
-1
votes
1answer
605 views

Eulerian vs Lagrangian vs Mesh-based vs Meshfree/Meshless methods

Hailing from the scicomp community recently getting into computer-graphics, I have noticed that the scicomp communities talk about mesh-based methods like FDM, FVM, FEM, etc, vs meshfree or meshless ...
-1
votes
1answer
141 views

ODE15s: unable to meet integration tolerances

I have to solve $$\left\{\begin{matrix} \ddot{R}=-\frac{3}{2}\frac{\dot{R}^{2}}{R}+\frac{1}{R\rho}\left [P_{v}(T_{\infty})-P_{0}-a_{1}t^{2}-a_{2}t+\frac{(L\rho_{g})^{2}}{hT_{\infty}}\dot{R}-4\mu \frac{...
-1
votes
1answer
560 views

Dirichlet boundary condition

I am trying to solve ODEs in matlab using ode15s. Instead of specifying ODEs in the format M * dC/dt = f(C,t) where C is a function of x and t. I want ...
-1
votes
1answer
105 views

solving a non-linear equation with integrals involved

I would like to solve the following equation, wrt $n(e)$ $$f(n(e))=g(n(e)) + \int_{\alpha}^{e} w(n(x))dx $$ The integral there it confuses me. Any suggestion on how I can implement this on a the ...
-1
votes
1answer
810 views

Any note on Immersed boundary finite difference method?

For parts of a talk, I need a note on "Immersed boundary finite difference method", mainly about the reason of appearing this branch in the finite difference methods, considering mathematical ...
-2
votes
0answers
14 views

Implementing Housholder QR decomposition in Python

I am struggling to get my implementation of householder qr decompostion to generate the correct answers. I have been working on this for days and cannot workout where my code is going wrong. Any help ...
-2
votes
0answers
32 views

Are 2nd spatial derivatives useful for integrating ODEs?

In discussion of adaptive integrators for ODEs, I see a lot of discussion of how second derivatives in time can be approximated using finite differences, i.e., take several steps, and use numerical ...
-2
votes
0answers
63 views

2D Heat equation - MatLab implementation (FD in space, Expl. Euler in time)

I'm trying to solve the heat equation in 2D in $\Omega=[0,1] \times [0,1]$, with homogeneous Dirichlet boundary conditions, and initial condition $u(x,y,0)=\sin(2 \pi x y)$ i.e. \begin{cases} u_t=u_{...
-2
votes
0answers
15 views

How to use the norminv function in excel

I am given a list of ages from 29-73 and I am asked to calculate what values fall within the middle $95%$,top $10%$, and $P20$ Any help would be greatly appreciated
-2
votes
1answer
50 views

Calculate accuracy order/rate

I was doing error analysis of numerical scheme and I get $L_1$ error for each grid size with $N$ element. I was searching reference to compute accuracy order/rate from that error data but doesn't find ...
-2
votes
1answer
350 views

openFoam - How to create an intermediate scalar variable and output it?

For learning purposes, how do I create an scalar variable like temperature divided by 2 and outputs it on files generated?
-2
votes
1answer
241 views

How to solve this differential equation using RK4 in C++?

I have been given the following homework question to solve: I am having trouble writing a RK4 solver in C++ for this ODE. I am also not sure how to plot my solution. Here is my code so far: ...

15 30 50 per page