Anybody else having trouble getting the MATLAB assignment done? I've got both of the m-files created, i just can't get the program to run without errors. If you think you can help please let me know.
2/1/2006 4:42:11 PM
i had Tu for 315 last year, if you post the assignment i can probably help you out with the MATLAB code
2/1/2006 6:22:48 PM
% This is my function program.% System.mfunction f=f(t,x)f= zeros(2,1);f(1) = x(2);f(2) = -6.5*x(1);%This is my executable file to simulate the vibration system%that is defined in file "System.m"%File name = larrywhysallmatlab315.m%This is a free response simulationtime = 0:0.01:15;time = time';x0 = [1,2];[t,x]=ode45('system1',time,x0);plot (t,x(:,1));plot (t,x(:,2));plot (t,x);xlabel ('Time in seconds');ylabel ('Displacement');title ('Displacement vs. Time of 2x"+13x=0');
2/1/2006 7:09:25 PM
nm....really simple error. filenames didnt match.
2/1/2006 7:21:41 PM
i thought it was 2x"+3x=0is it supposed to be 13x?^^ what problem is that? now im really confused[Edited on February 1, 2006 at 8:32 PM. Reason : .]
2/1/2006 8:29:45 PM
the problem is 2x'' + 13x = 01.) x(0) = 3 ; x'(0) = 02.) x(0) = 0 ; x'(0) = 43.) x(0) = 2 ; x'(0) = 7
2/1/2006 9:21:25 PM
^^^^ initial conditions are wrong}[Edited on February 1, 2006 at 9:50 PM. Reason : [3;0]]
2/1/2006 9:24:02 PM
Here is my code...%system2.mfunction f = f(t,x)f = zeros(3,0);f(1)=x(2);f(2)=-6.5*x(1);%This is an executable file to simulate the vibration system defined by%system2.m%filename = vibration1%Free Response Simulationtime = 0:0.01:15;time=time';x0 = [3;0];[t,x] = ode45('system2',time,x0);plot(t,x(:,1));xlabel('time,sec')ylabel('Displacement');title('Vibration System');I get the following errors. Any ideas???? Error using ==> funfun\private\odeargumentsSYSTEM2 must return a column vector.Error in ==> ode45 at 173[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...Error in ==> vibration1 at 8[t,x] = ode45('system2',time,x0);
2/2/2006 12:21:52 AM
make sure the 2 sections are different files, you have to reference the first part in the second part
2/2/2006 12:23:07 AM
Could you clarify? Both of these are different files. Do I need to add something in or what?
2/2/2006 12:26:37 AM
%system2.mfunction f = f(t,x)f = zeros(3,0);f(1)=x(2);f(2)=-6.5*x(1);the bolded part should read
f=zeros(2,1);
2/2/2006 12:35:55 AM
if anyone is still up, i keep getting this error??? Input argument 'x' is undefined.On line 4 ==> f(1)=x(2);[Edited on February 2, 2006 at 3:29 AM. Reason : ]
2/2/2006 3:27:53 AM
what answers did you guys get for this hwthey're not in the back so hopefully we can figure it out I've only done the 1st one, I got c=2.71 [Edited on February 13, 2006 at 8:51 PM. Reason : .]
2/13/2006 8:49:08 PM
i worked on the second problem and got .0337, .112, .19 buti have no idea if i even came close to doing it right.
2/13/2006 8:59:42 PM
what did you get for the first one?
2/13/2006 9:01:19 PM
didnt get anything yet :-x. working on the 3rd one atm.i wrote the first one down but ive yet to really try and work on it
2/13/2006 9:04:35 PM
i got 2.73 for the first problem
2/13/2006 9:31:16 PM
any of you have answers for 2 or 3? i guess i should go back to trying to look at 1 and see if i get around 2.7something
2/13/2006 9:38:34 PM
what'd you guys get for 2.95?[Edited on February 13, 2006 at 10:37 PM. Reason : .]
2/13/2006 10:37:03 PM
the only ones ive really gotten answers to so far are 2.88 and 2.90 and im not sure if they are right
2/13/2006 10:42:55 PM
anyone get thsoe same numbers for the second problem?i dont really feel like i understand this stuff. unless there is a straightforward fomula in the section i dont feel like i can answer the hw problem[Edited on February 13, 2006 at 10:53 PM. Reason : ]
2/13/2006 10:48:30 PM
i didnt get what you got, no
2/13/2006 11:13:37 PM
blah. thanks for letting me know tho.what did you guys do for #1?
2/13/2006 11:22:07 PM
for 2.88 a I got 26%for b I got 7%
2/13/2006 11:48:18 PM
^yep. same here
2/14/2006 12:15:15 AM
just finished 2.90, I got cc=1000Wd=8.66delta = 3.63how about you guys? I hate not having the answers in the back ]
2/14/2006 12:34:22 AM
i really hate that too. and im kinda struggling in here. im not getting the answers you guys are getting for 1 or 2. i did get 1000 for C in 2.90. my numbers for b and c were different but i calculated Wn i realize instead of Wd. which would affect my answer in C as well. and thats probably the only thing i did wrong there.i se the formula for Wd = sqrtroot ( 1 - L^2)*Wn where L is the damping ratio squiggly thing heh.but, as in the previous problem obviously (since i got different numbers) i am not calculationg L right
2/14/2006 12:44:07 AM
so I was looking on Tu's syllabus and it said we have to solve the problems and write out an explanation beside of it, does anybody know if he takes off points for that!
2/14/2006 12:45:51 AM
i hope not, but then again i have hardly anything to get points for in the first place[Edited on February 14, 2006 at 12:58 AM. Reason : ]
2/14/2006 12:56:29 AM
for 2.90, "L" is c/ccthey give you cc in part b, and you calculated c right for part a
2/14/2006 1:08:41 AM
alright thanks a lot
2/14/2006 1:22:40 AM
when is this hw due? tomorrow or thurs?
2/20/2006 5:03:03 PM
ok, anyone having any luck with the matlab for 3.3
2/22/2006 6:30:35 PM
anyone? buller?
2/22/2006 11:48:31 PM