Hot answers tagged

7

Your lattice consists of 5 x 5 x 5 = 125 spins, so your number of Montecarlo steps to reach equilibrium should be >> 125, because you randomly picking a site and flipping it, so random numbers should uniformly generated so that it will cover whole lattice. For much finer measurement of thermodynamic quantities, you should take more number of points between ...


7

I think you could use the "marching cubes" algorithm. If memory serves, it requires a grid of samples as input, so at the very least you should be able to sample your function and run the algorithm as-is. You also might be able to modify the algorithm to callback to f directly. There's a popular implementation at http://paulbourke.net/geometry/polygonise/ ...


5

In addition to the voxel-based approach that rchilton suggests, you could also look at Delaunay-type algorithms. For example, the Computational Geometry Algorithms Library (CGAL) has some built-in functionality for surface mesh generation with examples here. You could also try distmesh, the essential idea of which has been ported to a number of other ...


5

I have to tell you. I implemented this algorithm (even double checked with other experienced people), however no luck. I guess, this worked for the authors, but with our data there was really no improvement. Additionally, once upon a time, the authors provided a code. I also tried it on my own dataset. Again, didn't work. Therefore, I am now sure that this ...


4

This answer is my personal opinion. I believe that high performance numerical solvers are not a good place to use MVC pattern. Additional layers and specific data flow will not help to get a better performance. MVC and MVVM (Model-View-ViewModel) are commonly used for GUI developing. If you want to develop pre/post processor where performance is not such ...


4

Given the small dimensions in microfluidics, flow is well described by the Stokes equations. There are a number of commercial packages that I'm sure can simulate this kind of flow. Most available open source finite element packages can also do this, though likely with less ease. For example, in deal.II (that's a package of which I'm one of the principal ...


3

This approach is the result of a Taylor approximation, which assumes that we are not very far from the solution (solution is the case when $R\approx I$ - no more updates can be made). Under large rotations this linearization will fail. Moreover, point to plane distance is prone to sliding errors when normals and points have particular configurations, such ...


3

Tools like gmsh often require more information than STL provides -- the connectivity between triangles of the input surface mesh. You might be interested in trying TetWild, which can apparently reconstruct all of this connectivity information and correct for some level of degeneracy in the input data. The paper about it is very interesting too; they tested ...


3

I will summarize a couple of possibilities: As a baseline, I would begin with a Hough transform kind of approach: Iterative Hough Transform for Line Detection in 3D Point Clouds Christoph Dalitz, Tilman Schramke, Manuel Jeltsch There is also an online demo as well as source code. Here is another paper of the same Hough-approach: Hough Parameter ...


3

The correct description (since you want to write something "physics-based") is via the Navier-Stokes equations, but it is out of the question to solve them with any kind of accuracy in real-time at 30fps. I would imagine that a reasonable approximation is to assume that the body simply falls through air without perturbing it, but that the air induces forces ...


2

You may be better served with a slightly different method of surface plotting, especially if you're having memory issues. What you're doing right now is actually two separate things: Interpolating your data onto a grid. Plotting the surface corresponding to the interpolated data on the grid. Since you have some raw data values which presumably do not ...


2

That is known as 3D reconstruction. I don't know if there is anything better in the bookstores these days but Multiple-view geometry by Hartley and Zisserman is a good textbook on the subject.


2

The mesh function plots functions z=f(x,y). So to call the mesh() function, you must have 2D data. You can give vectors for x and y, but z must be an array with length(x) rows and length(y) columns, or x and y and z must be all be 2D arrays of the same size. Your data has been pulled out into a single, long vector which you need to two-dimensionalize. I ...


2

Whilst the MVC/MMVM patterns can be useful where appropriate, I would avoid trying to shoehorn the numerics into a pattern led by your chosen GUI (or other UI) framework. Unless you multi-thread in some fashion, the GUI itself will be unresponsive as the simulation progresses until its completion. You mention that you wish to view the simulation's ...


2

Using angles is a very bad idea of storing rotations. They are ambiguous and not always consistently defined. Store your pose matrix as an augmented matrix of rotation and translation: $P=[R | t]$. In that convention, a point $\mathbf{x} \in \mathbb{R}^3$ is transformed via the operation: $$ \mathbf{x}' = P\mathbf{x} $$ $P$ is a $4x3$ matrix, while $\...


2

I use C++ template to parameterize dimension in a fluid simulation project. It is not directly related to your application, but I think some general ideas would be the same. Vectorize operations for vector/array/point/vertices. I believe you already have this implemented. Provide iterators to access topology in a model. In this way you can abstract(hide) ...


2

Yes, that finite difference is correct. You can obtain it using a finite difference in each direction for the Laplace operator in each coordinate. \begin{align} \nabla^2 u =& \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} + \frac{\partial^2 u}{\partial z^2}\\ \approx& \frac{1}{h^2}[u(x + h, y, z) - 2u(x, y, z) + u(x -h, y, z)]\\...


2

There are a number of software packages out there that you can use -- most are curated by the Computational Infrastructure in Geodynamics initiative (see http://www.geodynamics.org). The fundamental question you will need to answer is what time scale and material description you want to investigate. For example, if you care about short term (at the ...


2

OK, after thinking about it for a while, I came up with an answer. Step 1: Find the caps of the cylinder, in other words two closed disjoint paths along the graph's borders. Step 2: Find a path along the face graph from one cap to the other. Step 3: Create a new sub-graph by removing all edges which lie along the path found in step 2. Keep track of the ...


2

You are quite right, Augmented Reality benefits a lot from a combination of video/image analysis together with the data from motion sensors. Quote from Apple ARKit: Understanding World Tracking: To create a correspondence between real and virtual spaces, ARKit uses a technique called visual-inertial odometry. This process combines information from the iOS ...


1

Find a longitudinal axis of the cylinder (a least-squares linear fit to all your points will yield this). Construct a plane passing through this axis. Any orientation should be fine, but let's say it is perpendicular to a normal passing from the axis to $C$. Reorientate so the axis is vertical and the plane is divided into "left" and "right" halves by the ...


1

When the points belong to more than one curve, it will first be necessary to cluster them into curves. A possible approach is described together with a reference implementation in Dalitz, Wilberg, Aymans: TriplClust: An Algorithm for Curve Detection in 3D Point Clouds. IPOL 2019.234 (2019) When your points have an implicit parameter representing an ...


1

This is probably not the most efficient way to do this in MATLAB, but the following works for me in Octave: A=rand(200,200); for i=1:15 B(:,:,i)=A; end And, I think it should work fine in MATLAB as well. If your dimensions get a lot bigger or you have to create the 3D matrix frequently, there are probably much more efficient was to accomplish this.


1

Your data is already in the right shape, then you don't need to create a meshgrid. See the code below import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np I = np.array([ [10.55, 0., 0.], [0., 0., 0.01], [0.2, -0.1, 3.33], [0., 2.14, 0.], [0., 3.80, 0.], [9.02, 0., 0.]]) t = np.array([ [0., ...


1

On a side note perhaps, I think it's funny how the Ghia paper is still used as the benchmark 35 years later on. It had indeed produced great results for its time, but this being a computational problem means their accuracy was limited by the available computer power of the time and today they seem under-resolved. Actually I don't think Ghia et al. even tried ...


1

I consider this to be the "classic" 3D-Lid-Driven Cavity (LDC) incompressible flow benchmark paper: Guj, G. & Stella, F. A vorticity-velocity method for the numerical of 3D incompressible flows. J. Comput. Phys. 298, 286–298 (1993). Additionally, I developed a 200 line 3-D LDC incompressible flow solver in fortran: https://github.com/charliekawczynski/...


1

I think your problem can be written as an optimization problem. $\{x_i\}$ is the set of points for plane 1, $\{x_j\}$ for plane 2 respectively. Their orthonormal vectors are $n_1$ and $n_2$ with constraints: $|n_1|=1$, $|n_2|=1$ and $n_1n_2=0$. $\{\lambda_i\}$ the set of lagrange multiplier. The functional under constraints reads $$ \sum_i (x_i n_1-c_1)^2 +...


1

Here I devise a novel strategy, based on only 3D points, that I think, would work. I will parametrize a 3D plane by a point $\mathbf{p}$ and its normal $\mathbf{n}$. Imaging you take a pair of oriented points $\mathbf{p}_1$ and $\mathbf{p}_2$, on the point cloud $\mathbf{P}$ with corresponding normals $\mathbf{n}_1$ and $\mathbf{n}_2$. Let $\mathbf{d}$ ...


1

You should take a look at the Wikipedia page on rotation matrices, specifically the section on forming a rotation matrix from an axis and an angle. In your case, you have a vector $\vec{v}$ that you would like to align with another vector, $\vec{OP}$. The axis of rotation should be the unit vector $\hat{u}$ normal to these two vectors given by $$\vec{n}=\vec{...


Only top voted, non community-wiki answers of a minimum length are eligible