Jump to content

Matlab Help, URGENT

Featured Replies

Hi, can someone help me with solving this thing?

I'm at the exam at the mo, stuck on this one...

000026812775_%23_2_%23_Kerja.jpg

 

thank you!

In the exam at the moment ?!? The forum rules say something like "we do not do your homework for you". While not strictly speaking, in the sense of that message that naturally means "we will not help you cheat in an exam".

  • Author

well, I've just stuck on the question.

I've done something like that:

 

clear all




dt= 0.01;                      
t_max=10;                      

i_max=ceil(t_max/dt)+1;       

y=zeros(1,i_max);           
x=zeros(1,i_max);           

y(1)= 0;                     
x(1)= 1;                    

k=0;

t=[0.0:dt:(i_max-1)*dt];    


for i=1:i_max-1              

  k1=-x(i)^2+20;
  l1=y(i);

  k2=-x(i)^2+dt*l1/2-k+20;
  l2=y(i)+dt*k1/2;

  k3=-x(i)^2+dt*l2/2-k+20;
  l3=y(i)+dt*k2/2;

  k4=-x(i)^2+dt*l3-k+20;
  l4=y(i)+dt*k3;

  y(i+1)=y(i)+(dt/6)*(k1+2*k2+2*k3+k4); 
  x(i+1)=x(i)+(dt/6)*(l1+2*l2+2*l3+l4); 

end
figure(2)
plot(t,x,'b','LineWidth',1),xlabel('t / s'),ylabel('x / m') 


but think that's wrong

 

btw, the exam is opensource based.

btw, the exam is opensource based.

 

I doubt that means asking others to answer for you.

 

In any case, now that the exam is over - we are not in the habit of answering homework (or EXAM!) questions for you. If you want homework assistance, there's a special sub-forum for that purpose, where we can review your attempts and help you understand the subject.

 

Good luck.

 

~moo

You have a double dot on top of X that means it's acceleration (a double derivative)

 

However... X is a function of t... ooooo!!! I see your dilemma... You need Laplace Transforms, Baby!!!

 

:doh:

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.