All Questions

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

Fortran round-off error with floating point operations

I have simple code, which flags nodes with in region enclosed by cylinder. On implementing the code, the result is mild tilt of the cylinder observed case with $\theta=90^{\circ}$. The algorithm for ...
0
votes
1answer
74 views

Show the symmetric Gauss-Seidel converges for any $x_0$

Let $A\in\mathbb{R}^{n\times n}$ is symmetric positive definite and consider solving linear system $Ax = b$. Show that the symmetric Gauss-Seidel iteration converges for any $x_0$. Solution - Since $...
0
votes
1answer
1k views

Conjugate symmetry in MATLAB?

I have a large vector with complex numbers. How do I check whether it a conjugate symmetry vector? If not, is there any way to transform it?
0
votes
1answer
109 views

NONLINEAR ENERGY MINIMIZATION EXAMPLE

I am learning about FEM methods and nonlinear optimization. I would like to try my nonlinear trust region solver on some simple nonlinear problem. What would be good example to implement for ...
0
votes
1answer
763 views

How do I solve Laplace's equation in 2D using spectral methods?

I want to solve the 2D Laplace's equation: $$ \frac{\partial^2 T}{\partial x^2 } + \frac{\partial^2 T}{\partial y^2 } = 0 $$ with boundary conditions: T(x=0)=T(x=1)=T(y=1)=0 and T(y=0)=1 on a ...
0
votes
1answer
542 views

Three body problem in C++

I am in a begginers programming course and we got a little project. I chose to simulate the three body problem using the Euler method. Even though the system is chaotic there are some special cases ...
0
votes
1answer
79 views

Most efficient way to compute eigenvectors / values of this matrix?

I have a symmetric $ 3 \times 3 $ matrix $A$ and I need to compute the eigenvectors and eigenvalues of this. I know that I can use something like Lapack, but I also know that this can be computed ...
0
votes
2answers
95 views

Integrating a dynamical system until an algebraic condition is satisfied

I have a model given by a system of differential equations $$ \frac{dy}{dt}=f(y)$$ with $y=(y_1,y_2,y_3)$ and $f:\mathbb{R}^3 \to \mathbb{R}^3$. The system works as follows : integrate the ode's ...
0
votes
1answer
77 views

IVP Using Numerical Methods

Suppose that $y(t)$ is the exact solution of the ivp $$y'(t)=f(t,y(t)), y(0)=y_0$$ and $u(t)$ is any approximation to $y(t)$ with $u(0)=y(0)$. Define the error $e(t)=y(t)-u(t)$. How can I show that $...
0
votes
3answers
127 views

Quantum Chemical Calculations is there a book for which method to use with what problem?

Does anyone know of a book that will outline which quantum chemical methods are appropriate for what problems? I am trying to make informed choices before I start using computational resources. It is ...
0
votes
1answer
603 views

Positive definite matrix in CVX

I'm trying to use CVX to solve SDP problem. I have a constraint with positive definite matrix, but if i read the document of CVX, I can only find variable with positive semidefinite matrix. Can anyone ...
0
votes
1answer
97 views

Construct tridiagonal matrix from eigenvalues

I have a sort of reverse problem, and I'm not sure if there is a simple solution. I have a tridiagonal Hermitian matrix: $$ A = \begin{bmatrix} 0 & a_1 & 0 & 0 & 0 \\ a_1 & 0 &...
0
votes
3answers
82 views

Symmetric hash function

Can you provide a hash functions $F(x) | F(x) = F(\overline{x}), x \in {\{0;1\}}^n$ $\overline{x} $ is $x$ where all bits are swapped: $0 \rightarrow 1, 1 \rightarrow 0$ Basically it will help me ...
0
votes
1answer
45 views

Express the $\gamma_{2}^{\epsilon}$ SemiDefinite program in a form that is acceptable by SDPT3

I'm trying to express the following semidefinite program: for given $A \in R^{m \times n}$ and a scalar $\epsilon \in (0,1)$, \begin{align} &\gamma_{2}^{\epsilon}(A):= \min\,t\\ &\text{...
0
votes
1answer
41 views

Force a line through the origin

What does it mean: to force a line through the origin? I interpret this to be making (forcing) the intercept as (0,0) in the regression procedure of an x-y scatterplot, but am not sure.
0
votes
1answer
3k views

Normalize data so that the sum of squares = 1

In presenting geochemical data, I would like to try a statistical method that presents the data in an ISOCON diagram. This method requires scaling all the data to be the same distance from the origin (...
0
votes
1answer
192 views

How can I generate 3D unstructured mesh on MATLAB

I have been looking to do a 3D mesh for a shallow tunnel FE analysis. The output of mesh node orientation along the element should be counter clock wise direction. How and which material helps me best ...
0
votes
1answer
89 views

Indexing Nested Loops in C [closed]

I am having trouble indexing correctly the below statement in C inside a function and then returning it as a pointer. The returning part should not be confusing - hopefully - however the indexing is a ...
0
votes
2answers
466 views

efficient MPI collective non-blocking communication

I am facing a problem with MPI (Fortran). I have a really big matrix at each node and they differ at different nodes. At some point of my calculations, each node needs the matrix from all other nodes, ...
0
votes
1answer
624 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
429 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
703 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
179 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
926 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
510 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
180 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
530 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
730 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
159 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
108 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
92 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
772 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
267 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
306 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
171 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
212 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
627 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
396 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 ...

15 30 50 per page
1
161 162
163
164 165
183