[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Does anyone know how I can animate a motional process (in this

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 3

File: Matlablogo.png (258KB, 800x303px) Image search: [Google]
Matlablogo.png
258KB, 800x303px
Does anyone know how I can animate a motional process (in this case gondola lift, modelled as double pendulum) with Matlab using the solution matrix of the ode solver and overlaying image files.

So far I have an animation using two line segments. This was relatively easy to do but now I'd like to replace those line segments with graphics of the system.
I made a vector graphic image of the system with inkscape but I think it should be easiest to convert the two bodies involved in the movement (mounting bar and cabin) into separate pngs and using my solution vector to position those images. The thing is, I have no idea how to do that.

Any ideas? (further pictures incoming)
>>
File: gondola.png (38KB, 380x614px) Image search: [Google]
gondola.png
38KB, 380x614px
here's a sketch of the system. That's what I draw in inkscape.
>>
>>8166862
didnt read your whole post, but when I want to animate something, I use imagesc( ) together with pause ( ).
>>
>>8166871
that looks promising. Thanks mate!
>>
>Using pleblab
>Not using Python and all its wonderous libraries
>>
>>8166950
no thanks I wanna finish my simulation today.
>>
>>8166862
OP.

You have your solution matrix. That allows you to solve for the equation of motion for the objects in your problem, right?

If you already have that information in hand, what I would suggest to do is solve this like how it's done in computer graphics:

1) Make a function that generates the geometry of a unit sized gondola, ie [X,Y,Z]=Gondola(); It takes no arguments, just returns back the bucket.

2) Calculate the position and orientation of your object (described by a vector and matrix respectively)

3) Transform the geometry by rotating first, then translate. (Since it's a unit sized bucket, you'll need to scale as the very first step before rotating!!)

4) Have a function that takes the gondola geometry and draws it with patches.

Does this help?


[X,Y,Z]=Gondola();
[T,R]=Solution2Pose(ODE SOLUTION GOES HERE);
A=R*[X';Y';Z']+T;
X=A(1,:); Y=A(2,:); Z=A(3,:);
DrawPatches(X,Y,Z);

Stick this in a loop and add drawnow() and you have yourself an animation.
>>
>>8166950
>python and all its wonderous libraries
its libraries are shit, the only good ones are numpy, pandas and maybe scipy. It can't do a fucking LDA without exploding your memory.
>>
File: TLP.png (141KB, 320x320px) Image search: [Google]
TLP.png
141KB, 320x320px
Anyone know where I can get MatLab for free without a torrent? I want to work on some code I am developing for my lab at my student housing but since I get internet from my university I can't, and wouldn't dare torrent it.
>>
>>8167791
this one its for mac and linux

http://www.descarga2.me/matlab-r2014b-x64-para-maclinux/
>>
>>8167806
Thanks I'll give it a try
>>
>>8167791
Octave is opensource Matlab. It's plotting sucks, but the language is a superset of Matlab.

Honestly though, if you don't have access to Matlab, that means you aren't at a University or College right now. If you don't HAVE to use Matlab, I STRONGLY discourage using it. It may have lots of toolboxes that make solving and visualizing a wide breadth of easy problems quickly, but the downsides are innumerable. The language is horrible. The consistency in the libraries is horrible. It fosters horrible programming skills. And as soon as you try to do anything non-trivial things quickly spiral out of control. For a language and environment that claims to value developer time, the upfront savings on time are repaid x10 when you need to do more complicated things. Vectorization is the bane of clear reasoning and readability.
>>
>>8167941
>The language is horrible. The consistency in the libraries is horrible. It fosters horrible programming skills. And as soon as you try to do anything non-trivial things quickly spiral out of control.
So much this. CS major here, I tried to learn Matlab and I would have rather mutilated myself with a rusty paperclip.
>>
>>8167863

enjoy your botnet, I hope you infect your whole campus :^)
Thread posts: 14
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.