پروژه مار افسونگر (شبیه سازی حرکت مار)
On the ground moves snakes through to contract and relax the body length of muscles in a coordinated manner. The snakes have abdominal developed oblong mountain called belly of the mountain to take hold on the ground. Then the different parts of the animal body presses the left and right parts of the resulting direction straight ahead. There are species that can reach a speed of up to 6 km / h.
By attaching markers on a snake, then the coordinates of these points could be determined at different times when the snake moves. The file snakecoord.mat, available on the course website, is the variables xsnake ysnake and stored. These are matrices of size 501* 6, each row describes position in x-direction and the y-direction at a certain time of 6 markers evenly spaced along the length of the snake. The number of rows therefore corresponds to the total number of times that were recorded snake mode. To illustrate the snake’s movement, we can make an animation using Matlab commands plot, getframe and movie. The following code shows a sample of how to go about it.
موارد انجام شده:
۱٫ untitled.m:با اجرای این فایل مختصات x و y مار خوانده شده و انیمیشن حرکت ظاهر می شود.
۲٫تابع splinecoeffzm و splineplot.m برای محاسبه تقریب حرکت نقاط میانی مار نوشته شده اند. برای سنجش صحت عملکرد توابع همانطور که در پروژه خواسته شده یک تابا تسترا با این توابع تخمین میزنیم.
۳٫U1.m تابع تست را براساس تابع تخمین splinecoords.m محاسبه می کند. با اجرای U1.m گراف اول تخمین نقاطی از تابع تست بر اساس توابع کتابخانه ای متلب و گراف دوم تخمین نقاطی از تابع تست بر اساس splinecoords.m خواسته شده در مساله است. گراف سوم خطای تخمین را نشان میدهد که بر حسب تعداد نقاط استفاده شده در تخمین به صورت لگاریتمی کاهش می یابد.
۴٫U2.m با استفاده از تابع تخمین splineplot.m حرکت مار در نقاط میانی برآورد شده. با اجرای این فایل مشاهده میشود در حرکت مار نقاط میانی نیز در نظر گرفته میشود.
۵٫U3.m با اجرای این فایل حرکت مار در صفحه عمودی با انیمیشن بهبود یافته بر اساس تابع splineplot.m مشاهده می شود.
۶٫U4.m انتگرال گیری از تابع خواسته شده به دو روش trapezoid و cumtrapz انجام شده. با اجرای این فایل دو گراف مشاهده میشود که یکی مربوط به خطای trapezoid و دیگری خطای روش cumtrapz است. این خطاها در حد تقسیمبندی های بزرگتر از بین می روند.
لطفاً براي ارسال دیدگاه، ابتدا وارد حساب كاربري خود بشويد