I have a problem to do a vibration analysis on scilab.
to explain, I have to make a vibration analysis of an engine in 2d and then in 3D (see pictures)
3d graph I want to obtain
the 2d graph obtained
My basic file consists of a CVS with two columns, with time and acceleration. I used the fft function for the 2D graph, but for the 3D I don't know how to do it.
The code for the 2D graph:
sample_rate=1/(Time(2)-Time(1));
N=max(size(Time));
freqfftDatas =[sample_rate*(0:(N/2))/N]';
FFT=fft(Datas(1:N));
n=max(size(freqfftDatas));
fftDatas =abs(FFT(1:n))*2/N;
plot(freqfftDatas, fftDatas);
I've read about waterfall, but I don't know how to relate it to my case.
If there are people familiar with scilab who could help me, I thank you!
For this kind of representation you have to use surf, here is an example with the sliding window FFT of a chirp like signal:
[t,u]=meshgrid(0:0.01:10,0:0.01:1);
y=sin((%pi*(t+u)).^2);
Y=fft(y,1,1);
clf
gcf().color_map=parulacolormap(128);
surf(abs(Y),"facecolor","interp")
gce().color_mode=-1
Related
I have a video of a giant whirlpool, similar to the below image
Can anyone give an algorithm / code to detect SPIRAL OPTICAL FLOW?
Is it possible to fit a spiral curve over it depending on the spiral optical flow? If yes how?
Thank you.
You can compute optical flow using vision.OpticalFlow object in the Computer Vision System Toolbox. As for determining whether it is spiral, that seems to be the crux of your project.
Optical flow takes a pair of consecutive frames, and attempts to give you a vector at every pixel describing its motion from frame 1 to frame 2.
If you do not care about the motion of every single pixel you can track a sparse set of points over time using vision.PointTracker.
Edit:
If you have a recent version of the Computer Vision System Toolbox, try the new optical flow functions: opticalFlowHS, opticalFlowLK, opticalFlowLKDoG, and opticalFlowFarneback.
I tried to do 3D reconstruction of multiple views by using multiview essential matrices to construct 3D view of each image view of object. However, I am shocked that the 3D points I found are all on about XY plane. I guess that it maybe regarding to the large value of essential matrix or weird number of projection matrix estimated. What are the suggestions for me to compute precise 3D points coordinate?
If you have the Computer Vision System Toolbox, this example may be helpful.
I have a list of 200 points I garnered from a graph digitization software I would like to transform into a smooth curve and then into Solidworks.
My points form an ellipse (airfoil shape to be more precise), so the commands I've tried in Matlab didn't have a circular curve.
My issues are:
* Obtaining a smooth curve that doesn't necessarily pass through all points, smooth being motus operandi.
* Being able to have a elliptical curve
* Somehow being able to export this curve into Solidwords
If anyone knows the right software, command line or anything that could get me started, I would be extremely thankful.
imacube
I've used Solid Works before. It's a very powerful tool. There should be some way to draw a curved spline through these points, such as a cubic spline.
If you are using a standard(ish) airfoil, then you can use a variety of tools to plot the points without having to use a graph digitization software.
Javafoil, for instance, is one of those. Even if you know the characteristics of your airfoil, you can use this to give you a smooth set of points.
Again, if your airfoil is a naca 4-series, then these are governed by a set of equations.
But I take it that the airfoil you want a more complicated one. Let me know if I can help anymore.
I want to write a program which shows a visual animation of the orbit of satellite in 3D space, with the Earth's rotation.
I can write a code which shows a visualisation of the orbit (simply comet3()). It is possible to rotate the 3D model of the Earth either.
But I can't merge these two programs.
I've seen some Youtube videos like "Satellite Orbit Analysis and Simulation (in MATLAB)". How has he done it?
Is there any special stackexchange site for Matlab questions?
You can see a demo how to draw the Earth in 3D or 2D here:
Earth's Topography
To rotate an object like surface you can use function ROTATE. For example:
rotate(hsurf, [0 0 1], 20) #% rotates surface with handle hsurf around z axis by 20 deg
In addition have a look at Orbit Determination Toolbox (ODTBX).
And yeh, the best MATLAB SE site is here at SO. Just add or search for matlab tag.
UPDATE: Another beautiful Earth plot at FileExchange: http://www.mathworks.com/matlabcentral/fileexchange/25048
Consider doing the graphical front-end in Java. MATLAB interfaces flawlessly with Java, and it's much easier to do GUI stuff in Java. If you don't know Java and you have time, start learning, it's worth the effort as a general purpose programming language that's everywhere, and it's an invaluable companion to MATLAB.
Is there any subroutine, in MATLAB, that takes in a list of points, and return me a good mesh that I can use to show to my colleagues, such as this?
Actually, all I need is just a simple 2D mesh generator that takes in a series of X, Y coordinates (that defines the boundary of the area), and give me back a list of elements that can mesh that area well. I can do the rest by using MATLAB command to interpolate the Z value.
Edit : I am not interested to use MATLAB to produce the above looking plot. I am interested in using a MATLAB library to obtain a list of elements so that when I plot those element myself (not in MATLAB itself; but in my own C# program), I can obtain this meshed surface.
PS: I know there is this DistMesh, but I am looking for something simpler - something built-in direct in MATLAB perhaps. And no, meshgrid is not mesh generation.
It sounds like you want to create a finite element mesh, starting with a set of points defining a boundary of a region and then generating a triangular mesh that creates more points within that region. I don't think there's a "simple" solution for this problem.
The closest "built-in" solution would probably be the Partial Differential Equation Toolbox, specifically some of the Geometry Algorithms like INITMESH and REFINEMESH.
The link you gave to DistMesh appears to be another good solution. There are also a few submissions on the MathWorks File Exchange that you could take a look at:
MESH2D by Darren Engwirda
Finite Element Toolbox 2.1 by Rasmus Anthin
That picture looks exactly like the one from the griddata documentation. The example in there looks like what you want.
SFTOOL will easily make the picture that you show.
A thin-plate spline, e.g., TPAPS, should also do the job.
I think the user-created 'gridfit' is the best I've come across for a single surface, much better/prettier than griddata.
Mesh generation as in Delaunay Triangulation + Steiner Points? There is a builtin Delaunay function in MATLAB.
If your surface is the z=f(x,y) form you can use:
http://www.advancedmcode.org/how-to-plot-a-coloured-surface-from-3d-scatter.html
If your surface is concave look for surface reconstruction on the same website.