تبلیغات
مهندسی مکانیک - پاسخ واداشته سیستم با یک درجه ازادی(روش رانگ کوتا4)

پاسخ واداشته سیستم با یک درجه ازادی(روش رانگ کوتا4)

نویسنده :مسعود شمس
تاریخ:چهارشنبه 1 تیر 1390-02:06 ب.ظ

الگوریتم این روش بصورت:

k1=hf(xn,yn)

k2=hf(xn+h/2,yn+k1/2)

k3=hf(xn+h/2,yn+k2/2)

k4=hf(xn+h,yn+k3)

yn+1=yn+1/6(k1+2k2+2k3+k4)

به عنوان مثال داریم:

f(x,y)=x+y

x0=0 , y0=1

h=0.1

و دو مرحله تکرار (n=2) 

الگوریتم این روش بصورت:

k1=hf(xn,yn)

k2=hf(xn+h/2,yn+k1/2)

k3=hf(xn+h/2,yn+k2/2)

k4=hf(xn+h,yn+k3)

yn+1=yn+1/6(k1+2k2+2k3+k4)

به عنوان مثال داریم:

f(x,y)=x+y

x0=0 , y0=1

h=0.1

و دو مرحله تکرار (n=2) 

حالا نوبت به کد نویسی رسیده:


Masoud Shams

x0=0;

y0=1;

n=2;

h=0.1;

f=inline('x+y','x','y');

X=zeros(1,n);

Y=zeros(1,n);

X(1)=x0;

Y(1)=y0;

for ii=1:n

    k1=h*(f(X(ii),Y(ii)));

    k2=h*(f(X(ii)+h/2,Y(ii)+k1/2));

    k3=h*(f(X(ii)+h/2,Y(ii)+k2/2));

    k4=h*(f(X(ii)+h,Y(ii)+k3));

    Y(ii+1)=Y(ii)+1/6*(k1+2*k2+2*k3+k4);

end

disp(Y)


و پاسخ متلب:

  1.0000    1.1103    1.2323

خوب این یک مثال خیلی ساده بود.اما ما با مسائل سختی مواجه هستیم,با معادلات مرتبه 2 یا بالاتر !! برای تکمیل مطلب و اینکه شما دوستان بخوبی با این روش اشنا بشید همان معادله جرم و فنر و دمپر رو که در پست های قبل به کمک روش اویلر بررسی کردیم , این بار با روش رانگ کوتا مرتبه 4 بررسی میکنیم.

الگوریتم  معادلات مرتبه دو یا بالاتر بصورت ذیل میباشد:

kn1 = f(t, x, yn)

ln1 = g(t, x, yn)

kn2 =f(tn+h/2 , xn+1/2hkn1 , yn+1/2hln1)

ln2 =g(tn+h/2 , xn+1/2hkn1 , yn+1/2hln1)

kn3 =f(tn+h/2 , xn+1/2hkn2 , yn+1/2hln2)

ln3 =f(tn+h/2 , xn+1/2hkn2 , yn+1/2hln2)

kn4 =f(tn+h , xn+hkn3 , yn+hln3)

ln=f(tn+h,xn+hkn3,yn+hln3)

حالا به کمک این روش معادله جرم و فنر و دمپر ساده رو بررسی میکنیم.

(m)d2x/dt2+(c)dx/dt+(k)x=(f)

x(t=0)=0 
dx/dt(t=0)=0 

به عنوان تغییر متغیر داریم:

dx1/dt=x2

ومعادله اصلی به صورت مقابل باز نویسی میشود:

mdx2/dt+cx2+kx1=f

حالا معادله دیفرانسیل به صورت دو معادله مرتبه یک در خواهد امد:

dx/dt=x2
(dx2/dt=1/m(f-cx2-kx1

 چون در ام.فایل باید به این توابع مقدار بدیم پس از دستور @ استفاده میکنیم

f1=@(t,x1,x2)x2;
f2=@(t,x1,x2)f-c*x2-k*x1;

و کد زیر رو بسادگی مینویسیم:


@ Masoud Shams
f=10;
m=1;
k=10;
c=1;
h=.01;
t=0:h:20;
x1=zeros(1,length(t));
x2=zeros(1,length(t));
x1(1)=0;
x2(1)=1;
N=length(t);
f1=@(t,x1,x2)x2;
f2=@(t,x1,x2)f-c*x2-k*x1;
for i=1:N-1
    k1 = f1(t(i),x1(i),x2(i));
    m1 = f2(t(i),x1(i),x2(i));

    k2 = f1(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m1*h);
    m2 = f2(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m1*h);

    k3 = f1(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m2*h);
    m3 = f2(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m2*h);

    k4 = f1(t(i)+h,x1(i)*k3*h,x2(i)*m3*h);
    m4 = f2(t(i)+h,x1(i)*k3*h,x2(i)*m3*h);
    
    x1(i+1) = x1(i) + (h/6)*(k1 + 2*k2 + 2*k3 +k4);
    x2(i+1) = x2(i) + (h/6)*(m1 + 2*m2 + 2*m3 +m4);
end

subplot(2,1,1)
plot(t,x1)
grid
ylabel('displacement')
xlabel('time')
title('Rung-Kutta 4 Method')
subplot(2,1,2)
plot(t,x2)
grid
ylabel('velocity')
xlabel('time')


خوب معادله رو حل کردیم به روش عددی اگه مطلب مربوط به روش اویلر رو نگاه کرده باشید توضیح دادم که چطوری میشه از این نقاط به معادله برسید.
جمله ی cdx/dt در مبحث پایداری از اهمیت خواص برخورداره چون اگه این جمله برابره صفر بشه سیستم بسمت ناپایداری میل میکنه.
بیایید معادله رو بصورت دیگه ای بنویسیم:
c/m=2xiwn
wn2=k/m
dx2/dt+2xiwnx2+wn2x1=f/m
جمله 2xiwnx2 رو در نظر بگیرید.ضریب xi که همه باهاش اشنا هستیم در طراحی سیستم های مکانیکی از اهمیت زیادی برخورداره.معمولا مقدار xi بین 0.4تا0.8 در نظر گرفته میشه.حالا برای اثبات عرایضم سیستم رو به ازای xi های مختلف رسم میکنیم.

@ Masoud Shams
f=10;
m=1;
k=8;
c=1;
h=.01;
t=0:h:4;
wn=(k/m)^1/2;
x1=zeros(1,length(t));
x2=zeros(1,length(t));
x1(1)=0;
x2(1)=1;
ii=1;
col={'--k' '-.g' 'k' 'c' '--y' 'r' 'k'};
for xsi=0:0.2:1
    
    f1=@(t,x1,x2)x2;
    f2=@(t,x1,x2)(f/m)-(2*xsi*wn*x2)-(wn^2)*x1;

  for i=1:length(t)-1
      k1 = f1(t(i),x1(i),x2(i));
      m1 = f2(t(i),x1(i),x2(i));

      k2 = f1(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m1*h);
      m2 = f2(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m1*h);

      k3 = f1(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m2*h);
      m3 = f2(t(i)+h/2,x1(i)+0.5*k1*h,x2(i)+0.5*m2*h);

      k4 = f1(t(i)+h,x1(i)*k3*h,x2(i)*m3*h);
      m4 = f2(t(i)+h,x1(i)*k3*h,x2(i)*m3*h);
    
      x1(i+1) = x1(i) + (h/6)*(k1 + 2*k2 + 2*k3 +k4);
      x2(i+1) = x2(i) + (h/6)*(m1 + 2*m2 + 2*m3 +m4);
  end

  plot(t,x1,col{ii})
  hold on
  ii=ii+1;
end
title('Response of \xi = 0,0.2,0.4,0.6,0.8,1')
gtext('\xi=0')
gtext('\xi=0.2')
gtext('\xi=0.4')
gtext('\xi=0.6')
gtext('\xi=0.8')
gtext('\xi=1')


ملاحضه میکنید که به ازای xi=0 سیستم به سمت ناپایداری(به دلیل رابطه مستقیم با c) میل میکنه.

برای دریافت فایل کلیک کنید


نوع مطلب : اموزش متلب 

داغ کن - کلوب دات کام
نظرات() 
Cialis prices
جمعه 16 آذر 1397 08:27 ق.ظ

You have made the point!
india cialis 100mg cost trusted tabled cialis softabs order generic cialis online where cheapest cialis acquisto online cialis cialis in sconto viagra cialis levitra cialis dosage recommendations we use it cialis online store achat cialis en suisse
where to buy cialis online
پنجشنبه 15 آذر 1397 01:19 ب.ظ

Fine knowledge. Kudos!
tadalafil 20 mg online cialis cialis rckenschmerzen dose size of cialis purchase once a day cialis cipla cialis online trusted tabled cialis softabs cialis mit grapefruitsaft enter site very cheap cialis import cialis
buy cialis cheap
چهارشنبه 14 آذر 1397 05:13 ب.ظ

Fine facts. Many thanks.
free generic cialis achat cialis en suisse acheter du cialis a geneve cialis tadalafil miglior cialis generico cialis 5mg billiger generic low dose cialis cialis generico in farmacia buy cialis online cialis pas cher paris
Cialis online
چهارشنبه 14 آذر 1397 04:28 ق.ظ

Effectively spoken indeed. !
buy cheap cialis in uk cialis generisches kanada when will generic cialis be available cialis 200 dollar savings card how does cialis work best generic drugs cialis achat cialis en suisse cialis coupon cialis tablets for sale cuanto cuesta cialis yaho
buy tadalafil no prescription
سه شنبه 13 آذر 1397 05:19 ب.ظ

You said it perfectly.!
are there generic cialis cialis 5 mg para diabeticos acheter du cialis a geneve sublingual cialis online weblink price cialis cialis australia org cialis canadian drugs buy online cialis 5mg does cialis cause gout cost of cialis cvs
Cialis generic
سه شنبه 13 آذر 1397 06:01 ق.ظ

You explained it adequately!
generic cialis at the pharmacy cialis usa cost cialis reviews generic cialis 20mg uk cialis with 2 days delivery buying cialis in colombia how does cialis work cipla cialis online prix de cialis cialis generico online
Cialis pills
دوشنبه 12 آذر 1397 05:59 ب.ظ

Regards. A lot of facts!

opinioni cialis generico cialis diario compra cialis cuantos mg hay cialis generico postepay precios de cialis generico cialis cuantos mg hay generic low dose cialis cialis name brand cheap buy original cialis cialis super acti
Buy generic cialis
دوشنبه 12 آذر 1397 05:43 ق.ظ

You actually revealed this effectively.
only best offers cialis use what is cialis acquistare cialis internet import cialis cuanto cuesta cialis yaho cialis diario compra comprar cialis navarr cialis 200 dollar savings card best generic drugs cialis cialis coupons printable
buy cialis online safely
یکشنبه 11 آذر 1397 05:28 ب.ظ

Nicely put, Cheers!
tadalafil 20mg buy name brand cialis on line tadalafil 10 mg cialis 10 doctissimo cialis online price cialis per pill get cheap cialis cialis generico postepay cialis herbs we use it 50 mg cialis dose
Online cialis
یکشنبه 11 آذر 1397 05:17 ق.ظ

Amazing write ups. Regards.
we choice cialis pfizer india cialis preise schweiz prix de cialis cialis 20 mg cost cialis with 2 days delivery trusted tabled cialis softabs cialis online cialis herbs cialis farmacias guadalajara cialis kaufen wo
Cialis canada
شنبه 10 آذر 1397 05:56 ب.ظ

Thanks a lot. Valuable information.
enter site very cheap cialis cialis generique cialis therapie brand cialis nl cialis 20 mg cost cialis professional from usa cialis sans ordonnance brand cialis nl cialis 20 mg best price cialis authentique suisse
buy cialis pills online
شنبه 10 آذر 1397 04:54 ق.ظ

With thanks! I like this.
callus cialis generique we use it cialis online store cialis generic cialis 5mg billiger cialis generico en mexico cialis australian price where cheapest cialis cialis for sale in europa cialis name brand cheap
Buy cialis
جمعه 9 آذر 1397 05:38 ب.ظ

Cheers, I value it.
how to buy cialis online usa canadian drugs generic cialis look here cialis cheap canada cialis per paypa click now cialis from canada cialis prezzo al pubblico cialis tablets australia cialis canada on line side effects of cialis cialis side effects dangers
Cialis online
جمعه 9 آذر 1397 05:53 ق.ظ

You've made your position pretty effectively!.
we recommend cialis best buy cialis tablets for sale cialis professional yohimbe pastillas cialis y alcoho cialis kaufen bankberweisung deutschland cialis online cialis without a doctor's prescription we choice cialis pfizer india cialis cost cialis para que sirve
buy tadalafil pills
پنجشنبه 8 آذر 1397 06:33 ب.ظ

You made the point!
cialis 5 mg schweiz cialis 5 mg buy get cheap cialis how to buy cialis online usa sublingual cialis online buy generic cialis tesco price cialis i recommend cialis generico purchasing cialis on the internet cialis pills price each
buy cialis online without a prescription
پنجشنبه 8 آذر 1397 06:45 ق.ظ

Kudos! Quite a lot of material!

cialis sans ordonnance cialis 05 cialis coupons venta de cialis canada cialis price in bangalore cialis 100mg suppliers cialis pills in singapore acquisto online cialis dose size of cialis cialis tablets australia
buy cials online
چهارشنبه 7 آذر 1397 05:46 ب.ظ

Many thanks, Ample stuff.

the best site cialis tablets discount cialis low cost cialis 20mg cialis lowest price cialis diario compra cialis billig prezzo di cialis in bulgaria cialis preise schweiz cialis prices in england cialis for bph
Cialis online
چهارشنبه 7 آذر 1397 06:09 ق.ظ

Many thanks! Helpful information.
trusted tabled cialis softabs price cialis best preis cialis 20mg schweiz cialis 20 mg best price rx cialis para comprar miglior cialis generico generic cialis with dapoxetine tarif cialis france cialis et insomni rx cialis para comprar
buy cialis with no prescription
سه شنبه 10 مهر 1397 10:40 ب.ظ

You said it nicely.!
acquisto online cialis generic cialis safe dosage for cialis calis how do cialis pills work cialis professional from usa buy cialis online legal cialis super kamagra generic cialis tadalafil safe dosage for cialis
buy cialis germany
یکشنبه 8 مهر 1397 11:01 ب.ظ

Regards. Terrific information!
price cialis per pill sialis can i take cialis and ecstasy cialis for bph cialis coupons printable cialis price thailand sublingual cialis online safe dosage for cialis cialis y deporte cialis canadian drugs
canadian pharmacy online 24
یکشنبه 1 مهر 1397 03:22 ق.ظ

Cheers, An abundance of info.

pharmacy canada online prescriptions trust pharmacy canada reviews north west pharmacy canada pharmacy canada drugs for sale usa canada medication canadian drugs canada vagra drugstore online india best canadian pharmacies online
http://cialisda.com/
پنجشنبه 15 شهریور 1397 04:15 ب.ظ

Lovely forum posts, Many thanks!
brand cialis nl cialis sale online cialis online cialis online look here cialis cheap canada click here cialis daily uk generic cialis at the pharmacy we choice cialis pfizer india cialis 20 mg cut in half cialis generico
http://canadianpharmacyies.com/
چهارشنبه 14 شهریور 1397 07:20 ق.ظ

Helpful stuff. Thank you.
best canadian mail order pharmacies drugs for sale in canada are canadian online pharmacies safe buy viagra usa top rated canadian pharmacies online how safe are canadian online pharmacies canada rx canada pharmacies northwest pharmacy canada buy vistagra online safe
cialisees.com
دوشنبه 12 شهریور 1397 09:09 ق.ظ

Beneficial advice. Regards!
cialis online napol buying cialis on internet cialis without a doctor's prescription cialis generico lilly buy cialis uk no prescription brand cialis nl deutschland cialis online generic cialis pro costo in farmacia cialis how much does a cialis cost
viagraessale.com
یکشنبه 11 شهریور 1397 05:45 ب.ظ

You made your stand pretty clearly..
cialis from canada free generic cialis only best offers 100mg cialis interactions for cialis only now cialis 20 mg ou acheter du cialis pas cher side effects for cialis generic cialis 20mg tablets cialis sicuro in linea cialis manufacturer coupon
rapid tone shark tank price
پنجشنبه 25 مرداد 1397 09:36 ب.ظ
Great post. I'm dealing with many of these issues as
well..
viabiovit.com/try-viagra-free.html
سه شنبه 23 مرداد 1397 06:29 ق.ظ

Really plenty of superb material!
where to buy real viagra online where can i buy real viagra online price for viagra viagra online with prescription rx viagra online generic sildenafil online pharmacy for viagra viagra generic online pharmacy buy real viagra online cheap safely buy viagra online
buy cheap cialis in uk
دوشنبه 22 مرداد 1397 10:08 ب.ظ

You revealed that superbly!
cialis billig only best offers 100mg cialis cheap cialis only now cialis 20 mg cialis 20 mg best price click now buy cialis brand cialis venta a domicilio walgreens price for cialis only here cialis pills cialis 05
golf clash hack that really works
دوشنبه 4 تیر 1397 03:36 ق.ظ
This is the right webpage for anybody who would
like to find out about this topic. You know a whole lot its almost hard to argue with you (not that I actually would
want to…HaHa). You certainly put a fresh spin on a topic which has been written about for decades.
Great stuff, just excellent!
instagram private profile viewer download free
جمعه 1 تیر 1397 12:39 ب.ظ
What a stuff of un-ambiguity and preserveness of precious experience
on the topic of unpredicted feelings.
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر


نمایش نظرات 1 تا 30