Homework 6, due October 13, 2011.

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Homework 6, due October 13, 2011.
Reading: Chapter 5 of the course text, sections 5.15.3.
Exercises: 4.29, 4.30 (it is allowable to use Matlab for these, but FORTRAN is ok too for these first two problems), 5.3, 5.4 and 5.5. For the problems from Chapter 5, plot your series solutions for an increasing number of terms included in the partial sum. For each case, does the series solution provide a better solution as more terms are included?
Exercises: 4.29, 4.30 (it is allowable to use Matlab for these, but FORTRAN is ok too for these first two problems), 5.3, 5.4 and 5.5. For the problems from Chapter 5, plot your series solutions for an increasing number of terms included in the partial sum. For each case, does the series solution provide a better solution as more terms are included?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 6, due October 13, 2011.
For question 5.3 part 3, it asks us to compare the power series solution and the general solution. The initial conditions are not given, what conditions should we use to plot the graphs?

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
Using x(0)=1, x'(0)=1 is fine.jconcelm wrote:For question 5.3 part 3, it asks us to compare the power series solution and the general solution. The initial conditions are not given, what conditions should we use to plot the graphs?
Bill Goodwine, 376 Fitzpatrick

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
Someone asked me:
Your friction force is wrong. Shouldn't it be equal to +/(mu m g) and have a plus or minus depending on which direction it is moving?I was working on homework 6 and I am having trouble with setting up the equation for problem 4.30 part (1). From the force body diagram and also the information provided throughout the rest of the problem, I set up the following equation: mx''+kx=mu*m*g*(cos(omega*t)+sin(omega*t))+f(t) which I initially thought was correct. However, when I plotted this in MATLAB for part (2), it appeared as a cosine graph with a linearly increasing amplitude. Obviously the amplitude should be linearly decreasing, as you mention in the book. However, I cannot see where I went wrong and can you give me any hints or suggestions as to where I should go from here? Thanks for your time and help.
Bill Goodwine, 376 Fitzpatrick
Re: Homework 6, due October 13, 2011.
The ode45 MATLAB code you used in class was for variablecoefficient equations. Can we also use it to solve constantcoefficient equations? Or would you prefer us to do it by hand? Thanks.

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
If your question is "does ode45 work for constant coefficient problems" then the answer is yes. But if the equation is easy for you to solve by hand, that's the way you should do it and then just plot the solution using matlab.astumpf wrote:The ode45 MATLAB code you used in class was for variablecoefficient equations. Can we also use it to solve constantcoefficient equations? Or would you prefer us to do it by hand? Thanks.
Bill Goodwine, 376 Fitzpatrick
Re: Homework 6, due October 13, 2011.
does ode45 allow for if commands or absolute values in the function? I tried to and it wouldn't work. If not how can you change the direction of the friction force without changing its magnitude because it will always be equal to uN? Thanks

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
It should allow for both actually, so if it wasn't working, I don't think it was the absolute value command. You can similarly do it with logical statements like if().bmcaulif wrote:does ode45 allow for if commands or absolute values in the function? I tried to and it wouldn't work. If not how can you change the direction of the friction force without changing its magnitude because it will always be equal to uN? Thanks
Bill Goodwine, 376 Fitzpatrick

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
What you are doing is fine. However if you want to construct the whole solution, then you would have to start over again each time the sign switches, using the ending value as the new initial condition and patch together a bunch of solutions.I just had a quick question regarding problem 4.30 on homework 6. I might have done it wrong, but I didn't use a computer for part 2, like the problem said i had to. I said that mx" = f(t)kx +/ mu*m*g where the +/ depended on the direction of travel (opposite of direction of x' ). but with the given values, and f being 0, i have that x"+9x= +/.981 . For this the homogeneous solution is easy to find, and then the particular is constant, but switches between positive and negative. What assumption/oversimplification am i making that is letting me get an answer without using a program?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 6, due October 13, 2011.
If it is done in ode45, does the program accept 'IF' loops for the directionality of the friction?goodwine wrote:What you are doing is fine. However if you want to construct the whole solution, then you would have to start over again each time the sign switches, using the ending value as the new initial condition and patch together a bunch of solutions.I just had a quick question regarding problem 4.30 on homework 6. I might have done it wrong, but I didn't use a computer for part 2, like the problem said i had to. I said that mx" = f(t)kx +/ mu*m*g where the +/ depended on the direction of travel (opposite of direction of x' ). but with the given values, and f being 0, i have that x"+9x= +/.981 . For this the homogeneous solution is easy to find, and then the particular is constant, but switches between positive and negative. What assumption/oversimplification am i making that is letting me get an answer without using a program?

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
Look above.CLillie wrote:If it is done in ode45, does the program accept 'IF' loops for the directionality of the friction?goodwine wrote:What you are doing is fine. However if you want to construct the whole solution, then you would have to start over again each time the sign switches, using the ending value as the new initial condition and patch together a bunch of solutions.I just had a quick question regarding problem 4.30 on homework 6. I might have done it wrong, but I didn't use a computer for part 2, like the problem said i had to. I said that mx" = f(t)kx +/ mu*m*g where the +/ depended on the direction of travel (opposite of direction of x' ). but with the given values, and f being 0, i have that x"+9x= +/.981 . For this the homogeneous solution is easy to find, and then the particular is constant, but switches between positive and negative. What assumption/oversimplification am i making that is letting me get an answer without using a program?
Bill Goodwine, 376 Fitzpatrick
Re: Homework 6, due October 13, 2011.
goodwine wrote:Using x(0)=1, x'(0)=1 is fine.jconcelm wrote:For question 5.3 part 3, it asks us to compare the power series solution and the general solution. The initial conditions are not given, what conditions should we use to plot the graphs?
is it necessary to plot these solutions to show they are the same or can this be done numerically?

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
Just somehow show the power series solution is converging to the real solution. However you do that is ok with me.dmasse1 wrote:goodwine wrote:Using x(0)=1, x'(0)=1 is fine.jconcelm wrote:For question 5.3 part 3, it asks us to compare the power series solution and the general solution. The initial conditions are not given, what conditions should we use to plot the graphs?
is it necessary to plot these solutions to show they are the same or can this be done numerically?
Bill Goodwine, 376 Fitzpatrick

 Site Admin
 Posts: 1596
 Joined: Tue Aug 24, 2004 4:54 pm
 Location: 376 Fitzpatrick
 Contact:
Re: Homework 6, due October 13, 2011.
Someone asked me:
In the series questions, the only way to check your answer is versus a solution determined numerically, say by using ode45().
What I said in class was you can compute x'/x', which is fine for writing down the differential equation. Matlab should complain, though, because it will be problematic when the velocity is zero. Really, in ode45 you should program some logic, like if(x'>0) then force = something, else force = something.What was the easier way to plot the graph for 4.30 in I didn't catch everything you said in class. (something with taking the absolute value of x or xdot? using this equation x"+9x= +/.981)
Also I didn't understand what I was suppose to do when it asked to compare the series approximation with a numerical solution in 5.4 and 5.5. Is the graph of the original with the series approximation graph good enough to show this? assuming the graphs show the power series solution is converging to the real solution.
In the series questions, the only way to check your answer is versus a solution determined numerically, say by using ode45().
Bill Goodwine, 376 Fitzpatrick