All Questions

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

The condition for stability using the leapfrog method

I have the ODE below $$\frac{d}{dt}\pmatrix{x\\ y} = \pmatrix{0 &1\\-a &0}\pmatrix{x\\ y} \enspace .$$ The $m=1$ leapfrog method is defined as: $$y_{n+1} = y_{n-1} + 2f_nh \enspace .$$ For ...
0
votes
1answer
410 views

Order of accuracy of DGFEM or FEM

I know that it is possible to determine the theoretical order of accuracy (B) of numerical solutions in FVM (for instance for a steady problem in which only the central differencing scheme (CDS) is ...
0
votes
3answers
636 views

How to plot a price level matrix in Matlab?

I have a matrix P of m rows and n columns. P(i,j) contains the price of occupying position i at time j. I want to plot this in Matlab but in a way to get some kind of density plot with different price ...
0
votes
1answer
1k views

Finite-difference approximation of the 2nd derivative operator matrix for a staggered grid

I'm working on a computational physics assignment and I was looking for some help as I've got stuck! The question is: Write a function to create the finite-difference approximation of the 2nd ...
0
votes
2answers
5k views

Plot vector field in matlab

I have the function of an electric dipole expressed in cartesian coordinates and I want to create the vector field using Matlab . The function is $$E_z= \frac{p}{4\pi\epsilon_0} \cdot \left(\...
0
votes
2answers
176 views

Is it possible to show global conservative properties FEM as it is done in FVM?

I know that in FVM, it is possible to show that a discretisation scheme is conservative by adding the discrete terms over a few control volumes and showing that all terms cancel apart from those ...
0
votes
2answers
4k views

Simple java gravity simulation

I'm trying to write a class that uses Newton's law of Gravitation to work out the field of a planet. I've tested my code by inputting values for Earth, for purely vertical motion, so I should get g = -...
0
votes
1answer
915 views

Quadtree type Grid

I would like to code for a quadtree type meshing but don't know how to do. If anyone can help or can share any starting code?
0
votes
1answer
496 views

Variational Monte Carlo: Variational energy is lower than ground state energy

I'm writing a VMC simulation for hydrogen and helium atoms, but in both my codes my variational energy for certain wavefunctions is not only statistically different from my expectation value, but it ...
0
votes
2answers
172 views

Solving a quadratic pseudo-boolean optimization problem where the integral constraints are relaxed

Quadratic Pseudo-Boolean Optimization (QPBO) problem: Problem 1. Minimize $\sum_i a_ix_i + \sum_{i<j} a_{ij}x_i x_j$ subject to $x_i\in\{0,1\}\forall i$. Consider the following problem, where the ...
0
votes
1answer
518 views

Comm argument on MPI_Reduce in FORTRAN giving unusual results

I'm putting together a very simple integration program in FORTRAN using MPI. I have done this with C and all was well. However, in my "MAP_REDUCE" call, the comm argument seems problematic. I have ...
0
votes
1answer
36 views

Support Vector Machines to use after Classification?

I'm a little bit about the SVM. I'm actually understanding for which purpose Support Vector Machines are used. The aim is to find the biggest (best) hyperplane between two different data clusters. The ...
0
votes
1answer
706 views

Solving coupled differential equations and Algebraic equation in MATLAB

I want to solve a system of 7 coupled differential equations and 1 algebraic equation in MATLAB with the method of lines. I could do it for each independent equation with some assumptions, but I can'...
0
votes
1answer
153 views

Convex optimization for symmetric (but not positive definite) problems?

Can one employ convex optimization for symmetric but not positive definite problems? I tried using MATLAB's quadprog() function to solve this problem: $\mathrm{min}\frac{1}{2}\mathbf{x}^T\mathbf{H}\...
0
votes
1answer
1k views

Why is Godunov's scheme (for the advection equation) diffusive?

I'm trying to solve the advection equation $$m_t+(\alpha m)_x=0$$ with $m(0,\cdot)=m_0$ numerically using the first order Godunov scheme. Hence I write $$m_j^{i+1}=m_j^i-\frac{dt}{dx}(m_{j+1/2}^i\...
0
votes
1answer
86 views

what is the upper bound of $\max \mathbf{w}^T\mathbf{x}_i$

I need to find an equation for the upper bound of $\max \mathbf{w}^T\mathbf{x}_i, \; i=1, \dots N$. where $\mathbf{w}$ and $\mathbf{x}_i$ are two vectors. I need to find a function $f$ which holds ...
0
votes
1answer
77 views

Feedforward net lagged prediction

I am trying to predict y(t+1) of a function by using a feedforward neural network with Matlab. The inputs are the previous 3 previous values (y(t-2), y(t-1), y(t)) and the training output is the ...
0
votes
1answer
106 views

How many sample points are needed when re-constructing linear combination of 2D polynomials defined over unit circle?

I have a set of first 25 Zernike polynomials. Below are shown few in Cartesin co-ordinate system. z2 = 2*x z3 = 2*y z4 = sqrt(3)*(2*x^2+2*y^2-1) : : ...
0
votes
1answer
88 views

Visualise data under Tecplot

I have a set of data that I need to visualise under Tecplot, the file format is for example: ...
0
votes
1answer
759 views

Converting smooth $L1$ norm approximation into SOCP

I am approximating the expression $\left\|Ax-b\right\|_1$ by the expression $$\text{minimize}\;\;\sum_i\sqrt{(a_i^Tx-b_i)^2+\varepsilon}$$ where $a_i$ is the $i^{th}$ row of $A$. This function is ...
0
votes
1answer
263 views

How to write Goemans-Williamson MAX-CUT relaxation as SDP

Let W be a graph Laplacian (symmetric diagonally dominant, and thus PSD), and X the matrix variable. Let $<A,B>=Tr(A^TB)$. $$\text{Maximize}\;\; \displaystyle\sum_{i,j} w_{ij}(x^{(i)}\cdot x^{(...
0
votes
1answer
66 views

How can PDE matrices be identified?

I need to include experimental results for lots of PDE (partial differential equation) matrices in my research work. How can I identify PDE matrices? For example, matrices in the UFL Sparse Matrix ...
0
votes
1answer
288 views

Is there general algorithms to solve such 3D cutting problems?

Suppose a cuboid $\mathbb{A}$ has $L$,$M$ and $N$ as its length, width and height respectively, where $L\ge{M}\ge{N}>0$; Now we want to cut $\mathbb{A}$ into smaller cuboids with length $x$, width $...
0
votes
1answer
159 views

fast gradient method for convex piecewise linear function

What is the state of art gradient based algorithms in convex optimization solving non-smooth piece-wise linear functions? Thank you. EDIT: It is different from one of my previous post in the sense ...
0
votes
1answer
80 views

Mathematical error when attempting to represent step function using fourier series

I am attempting to work through a very simple problem. Determine the Fourier series expansion for the following heat PDE problem with ICS and BCS: $$ u_{t} = \alpha^2u_{xx}$$ $$ u(0, t) = u(L, t) =...
0
votes
1answer
2k views

Gonzalez algorithm

I'm getting confused about implementing the Gonzalez algorithm for k-center clustering. The algorithm is : let $S$ be a data set Choose $z_1 \in S$ arbitrarily. Number $z$ is center. (In general ...
0
votes
1answer
210 views

Strict Feasibility in Interior Point Methods

As we know, in the interior point methods, all the iterates have to be strictly feasible. I implemented an affine scaling interior point for nonlinear objective functions. For small examples (2D), it ...
0
votes
1answer
622 views

Interpolating 3D Array non-monotonic data in MatLab

I am working on creating a program for simulations where three variables are parametrized, and we modify one parameter while keeping the other two constant. An example array looks like this when ...
0
votes
1answer
1k views

Temperature dependent 1-d conduction in Python?

I'm trying to write a Python code that is a numerical solver for 1-d heat conduction (using FVM) with a temperature dependent thermal conductivity. The solver has three functions I need to iterate ...
0
votes
3answers
1k views

Solving a double integral in Matlab

I need to solve this integral: $M = \rho h \int_0^a \int_0^b N^2 \ dx dy$ where $N$ is defined as: $N = sin\left(\dfrac{\pi}{4}\eta +\dfrac{3\pi}{4}\right)sin\left(\dfrac{\pi}{4}\eta +\dfrac{3\pi}{...
0
votes
2answers
391 views

Faster methods for projecting a mesh onto a hierachally unrelated mesh?

I have a set of independent meshes whose results I would like to project onto another non-hierachally related mesh. Until now, I've been accomplishing this by finding the nearest-distance node in the ...
0
votes
1answer
689 views

How to solve Energy Balance equation by numerical method

Good Day I am new to heat transfer technique please give me some suggestion on solving energy balance equation $$a \frac{\partial T_p}{\partial t}=\frac{\partial}{\partial x}\left(b\frac{\partial ...
0
votes
1answer
77 views

How to present a polynomial interpolation if the first order information of function f(x) is given?

Suppose $f'(x_1),\ f'(x_2),\ f'(x_3)$ are given, how to give a polynomial interpolation $p(x)$ such that $p'(x_1)= f'(x_1),\ p'(x_2)=f'(x_2),\ p'(x_3)=f'(x_3)$? And how to give an error analysis?
0
votes
2answers
157 views

Computing eigenpairs of singular matrix with ZGEEV?

I've never run into a singular matrix before, so bear with me. I have a complex non-symmetric matrix (about 1000 x 1000) that I know has a couple zero eigenvalues. It isn't guaranteed to be ...
0
votes
1answer
980 views

What is Mesh Independence Report?

I am performing analysis on chassis (Static Structural) and for optimization purpose i am asked to generate MESH-INDEPENDENCE REPORT,of which i have no idea. I have tried going through research papers ...
0
votes
1answer
70 views

Unexpected behavior, values tend to converge instead of fluctuate. (MD)

I am writing a molecular dynamics program to create an lattice and populate it with atoms/molecules. These then are given random velocities and the system is initialized. Then throughout time the ...
0
votes
1answer
84 views

Largest Cylinder inside Polyhedron

Imagine you have a piece of wood and from that piece you want to get the largest cylinder possible. How do you determine the position and orientation of the cylinders axis, to maximize its radius? ...
0
votes
1answer
112 views

CVX : Obtaining the minimizing parameter at the optimum

In CVX, how do we return the value of the parameter over which the problem is minimized at the optimal value? By this, I mean, how do we obtain $$x^* = \arg\min_x f(x)$$ when solving the problem ...
0
votes
1answer
105 views

Actually calculating the rate of convergence of iteratvie methods when exact solution is unknown

When solving a system of nonlinear equations using iterative methods, the rate of convergence usually is defined by the following formula: (1) where x* is the exact solution. However usually we ...
0
votes
2answers
1k views

Simulating a traveling sine wave

I'm trying to make an animation of a travelling sine wave (amplitude vs. position) would anyon here happen to know how to do so?
0
votes
1answer
154 views

MAX-SAT and MAX-cut

I have been using MAX-SAT solver to obtain the exact ground state of ising spin glass model: For 1D periodic model, for systems with 50 binary variables and interaction range of 15th nearest ...
0
votes
1answer
252 views

Why doesn't the integral of a smoothing kernel equal 1?

I was checking the unity condition on a smoothing kernel for SPH, however I don't understand why the integral is not giving 1. The kernel function is $\displaystyle W(||\vec r||,h) = \frac{315}{64\pi ...
0
votes
2answers
384 views

How to represent molecules and compare equality

I originally asked this question at StackOverflow, and was suggested to bring it here. I've seen this question about the representation of molecules in memory, and it makes sense to me (tl;dr ...
0
votes
2answers
237 views

Statistical analysis of optimization algorithms

If we optimize some parameter using 4 optimization algorithms, 2 of which are population based (say A and B) and 2 trajectory methods (single point search)(say C and D); what statistical test can be ...
0
votes
1answer
38 views

Implicitly defined univariate function

So my fellow numerical computational peeps it may be that I am suffering from sleep deprivation but I'm struggling to numerically compute a function $u \rightarrow h(u)$ defined implicitly as follows: ...
0
votes
2answers
111 views

How to determine the number of c points in algebraic multi grid

I am trying to write an algebraic multi-grid solver (in c++). At a given level I determine which nodes are c-points and which nodes are f-points (where the total number of c and f points equals the ...
0
votes
1answer
198 views

jump conditions for Poisson/Darcy equation in primal form versus mixed form

Consider the Darcy equation, $$\mathbf{v} + \dfrac{k}{\mu_0}\nabla p = \mathbf{f} \\ \mathrm{div}\; \mathbf{v} = 0$$ If the coefficient $k$ is piecewise constant across an interface $\Gamma$ in the ...
0
votes
1answer
467 views

Python: Computation time Issue with mpi4py

I am using in Python mpi4py to process in parallel 20 minimization functions. Each of the 20 worker processes the same algorithm but with different random initial ...
0
votes
1answer
132 views

Writing a 3D array from Petsc

I am trying to do something fairly simple somehow I have made it hard. Is there an example of how to send a 3D array to a binary file?
0
votes
1answer
65 views

FEM with soil slope

I what to calculate displacements, stress and strain in a soil slope with a FEM script. The slope moves like a laminar flow. Can you suggest me some bibliography on this problem? I've already look on ...

15 30 50 per page
1
157 158
159
160 161
178