a couple of students saw a decrease in the amplitude of the motion in their plots.

the cause for that is what's called "numerical damping" in the integration formula. you can get rid of it by reducing the integration step size to a small enough value. I believe that for your problem if you reduce the step size by a factor of 10 you will get rid of that damping almost entirely.

i hope this helps.

dan

Statistics: Posted by Dan Negrut — Tue Dec 21, 2010 9:25 am

]]>

Hi Dan,

While running the code for the take home exam II, I found that my simEngine2D is very sensitive to the time step, gamma and beta values in Newmark-beta. If possible can you tell me which method and time step was used in the text book. Also, what is the best way to find healthy time step?

Thanks,

Abdul Aziz Khaja.

Work with \beta=0.3025, and \gamma=0.6. Don't change these.

About step size: there is no universal rule for choosing one. Think of a slider crank that starts moving faster and faster and faster. In the beginning, a large step size will suffice. But as the motion gets quicker, in order to capture what's going on you'll have to gradually decrease the step size.

So for your problem, keep decreasing the step size until for two successive step sizes the results look the same.

Finally, the results in the book were not generated with Newmark. They were generated with a method called "Coordinate Partitioning", which we didn't discussed in class since it's a little bit beyond the scope of ME451.

I hope this helps.

Dan

Statistics: Posted by Dan Negrut — Mon Dec 20, 2010 9:44 am

]]>

EXE: SimViz2D.exe [Windows]

Please look at the included adm, acf and .res files for formatting.

In the box that says "Enter Sim Name Here" enter the simulation name ex: pendulum, twoBody, slidercrank and so on. it will then read the corresponding .acf, .adm and .res files that start with that name.

Notes:

1] You need to add the geometry line in the adm file (look at the included adm).

2] Bodies should come first in the adm

3] Make sure that there are two lines of stuff (can be anything) before the data in the .res file

4] The .res file should have columns in the following order, if the order is wrong stuff will look weird:

Post problems/questions below....

Updates to Exe:

Fixed opposite y axis issue

Fixed EOF issue for adm file

Fixed mouse y axis issue

Statistics: Posted by HammadM — Tue Dec 14, 2010 1:53 pm

]]>

ME451Aneesh wrote:

Hello Prof Dan,

For the take home exam 2, I was wondering if I could assume the LRF for the body 1 to be at the center of mass. The text assumes it to be at point at A (where it is hinged ). Since the EOM for a single body was derived with the assumption that the LRF is at the center of mass, I wanted to double check if I could proceed using the EOM derived earlier ?. Thanks.

In ME451 you should always work with LRF located at the center of mass.

Dan

Statistics: Posted by Dan Negrut — Mon Dec 13, 2010 9:21 am

]]>

Statistics: Posted by ME451Aneesh — Sat Dec 11, 2010 8:50 pm

]]>

thanks professor,

Wa'el

Statistics: Posted by Wa'el — Sat Dec 11, 2010 8:17 pm

]]>

Wa'el wrote:

no actually that clears things up! ... one last question however:

would that solution change if I set my t=0:0.001:10 rather than t=0:0.001:1.5 ?

or is that solution just for t = 1.5sec and it just gets closer to the exact at t = 1.5 using a smaller time step (h=0.001) ?

Thanks for all the help professor!

Wa'el

No, that isn't anything special about 1.5. If you take T_end=273 (pick your favorite positive number here), you should still get the same straight line of slope 4. There will be one difference though: the longer the simulation, the more error you accumulated. So while you'll still get a straight line, it will be shifted up, towards larger error values. What i'm saying is that if you take T_end=273, you should see larger errors, but as you reduce the step-size h, you should see the same tendency of cutting the error. For RK, if you cut h by 2, the error should be cut by a factor of 16. Now this error is going to be larger for T_end=273 than for T_end=1.5, but the trend will be the same and captured by the straight line with slope 4.

If you also understand what i'm saying here, stop by, you deserve some M&Ms.

Dan

Statistics: Posted by Dan Negrut — Sat Dec 11, 2010 10:46 am

]]>

would that solution change if I set my t=0:0.001:10 rather than t=0:0.001:1.5 ?

or is that solution just for t = 1.5sec and it just gets closer to the exact at t = 1.5 using a smaller time step (h=0.001) ?

Thanks for all the help professor!

Wa'el

Statistics: Posted by Wa'el — Sat Dec 11, 2010 10:24 am

]]>

Wa'el wrote:

Prof:

By "the result will look good" you mean converged to the correct answer?

Thanks,

Wa'el

Wa'el - yes, that's what i mean. Except that i would not call it "converged to the correct answer" because "convergence" has (in my mind) the meaning that you try a sequence of things and you see that the results approach something (converge to something).

Here you only try, for instance, h=0.001, and the numerical solution is very close to the actual solution (granted, here you don't quite know what the "actual" solution means since you don't have the analytical solution).

I have this tendency of taking a simple thing and making it complicated. I hope i didn't confuse you more (than i usually do).

Dan

Statistics: Posted by Dan Negrut — Sat Dec 11, 2010 9:46 am

]]>

By "the result will look good" you mean converged to the correct answer?

Thanks,

Wa'el

Statistics: Posted by Wa'el — Fri Dec 10, 2010 6:42 pm

]]>

Wa'el wrote:

question:

so when I'm computing the psuedo exact result using the runge-kutta method, should I be using a bigger range for t (from 0 to 1.5) or is it just that I'm going to use a very small time-step?

I ask because when I'm plotting y vs t, it doesn't look like I'm converging even with a t = 0:0.0001:1.5 .... or should it?

thanks in advance,

Wa'el - you should use RK from 0 to 1.5. Even with 0.1 the results should actually look really good. If you consider h=0.01 you practically obtain an approximation of the solution that is within machine precision.

To conclude, i believe that you have a small bug in your code, for h=0.0001 the results should look really good...

Dan

Statistics: Posted by Dan Negrut — Fri Dec 10, 2010 4:10 pm

]]>

so when I'm computing the psuedo exact result using the runge-kutta method, should I be using a bigger range for t (from 0 to 1.5) or is it just that I'm going to use a very small time-step?

I ask because when I'm plotting y vs t, it doesn't look like I'm converging even with a t = 0:0.0001:1.5 .... or should it?

thanks in advance,

Statistics: Posted by Wa'el — Fri Dec 10, 2010 2:33 pm

]]>

ME451Vaidyanathan wrote:

Hello Prof. Dan

In prob 4 you say:

"If everything works well, you should see a straight line

with slope 1.0 for Forward Euler, and slope 4.0 for Runge-Kutta"

1. For Forward Euler - we use Runge-kUtta as the exact solution.. If so, What should we use for runge-kutta?

2. As far as I understand error should be norm(ycalc - yexact) (where ycalc and yexact are calculated and actual solution vectors). But in the hw you are asking us to compute the error only at a specific instant of time. Can you please clarify as why we are computing the error only at one point (at t = 1.5?)

(I understand that the length of the vectors (ycalc and yexact) are different - but I am not sure if this is the right method to calculate the degree of accuracy of a numerical method)

Thanks & Regards

Vaidy

1. as stated in the assignment, the reference solution is "faked" by taking for it the solution obtained with RK45 when run with the tiny step-size. This is because you don't have enough significant digits on your computer to generate a better solution anyways. this is a standard way of doing things when carrying this type of analysis.

2. this is the way people report the error. They look at the end of the simulation to see how large the error is. Again, for this you need the exact solution, which you [almost] never do for any serious IVP. So you generate a solution with a high accuracy method using a tiny step size and then consider that to be the "exact" or "reference" solution. Keep in mind that typically the error grows with the length of the interval over which you carry out integration (accumulation of error). So that's why you want to look at the end of your time interval.

Another way to do this is to look at the norm infinity for the error, that is, to consider the largest error over the entire interval. this is equally good, except that now you should save the entire reference solution. given that you integrated with a small step size, this means a lot of data. In our approach, for the reference solution you only save the last point, at T_end.

I hope this helps. we can talk more in class tomorrow.

Dan

Statistics: Posted by Dan Negrut — Mon Dec 06, 2010 12:42 pm

]]>

In prob 4 you say:

"If everything works well, you should see a straight line

with slope 1.0 for Forward Euler, and slope 4.0 for Runge-Kutta"

1. For Forward Euler - we use Runge-kUtta as the exact solution.. If so, What should we use for runge-kutta?

2. As far as I understand error should be norm(ycalc - yexact) (where ycalc and yexact are calculated and actual solution vectors). But in the hw you are asking us to compute the error only at a specific instant of time. Can you please clarify as why we are computing the error only at one point (at t = 1.5?)

(I understand that the length of the vectors (ycalc and yexact) are different - but I am not sure if this is the right method to calculate the degree of accuracy of a numerical method)

Thanks & Regards

Vaidy

Statistics: Posted by ME451Vaidyanathan — Mon Dec 06, 2010 10:36 am

]]>

ME451Hendrik wrote:

For the second take home exam due 12.7.10, I was wondering if it is to be expected that for all the methods in problems 1 and 2, including ode45, my plot continues to be a flat line of y=0. When I think about logically it seems sensible that the solution would constantly gravitate back to y=0 because the derivative is time independent. Even if I offset the initial guess in my Netwon-Raphson algorithm by a small value, the plot continues to flatline at 0. I just want to know if anyone else has had had better results.

Hendrik

Hendrik - the second take home exam is due on December 20 at 11:59 PM.

That being said, there is a MATLAB assignment that is indeed due on 12/07/2010:

http://sbel.wisc.edu/Courses/ME451/2010 ... ment06.pdf

And here is the reason why you get a flat line: the initial condition should have been 1.0 rather than 0. Take a look at the PDF, i made that correction. And sorry for this mistake on my part.

Dan

Statistics: Posted by Dan Negrut — Mon Dec 06, 2010 8:09 am

]]>