FAQ  •  Login

Matlab 09 Results

Moderator: RaduS

<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Mon Nov 18, 2013 6:04 pm

Matlab 09 Results

Thibault_Matlab_09_BE_Prob1_Figs.pdf
(134.56 KiB) Downloaded 200 times
Here are the results for Problem 1, parts 2 and 3. Will post for Problem 3 separately later.

Matthew
<<

F13fnmercado

Newbie
Newbie

Posts: 16

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 1:30 am

Re: Matlab 09 Results

FE,BE,RK4 vs ode45 (I think BE is wrong)
prob1.png
prob1.png (4.57 KiB) Viewed 6142 times

prob2.png
prob2.png (4.2 KiB) Viewed 6142 times

Frankie
Frankie
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Tue Nov 19, 2013 9:09 am

Re: Matlab 09 Results

Matthew, display the difference between the solution obtained using ode45 (with a tight tolerance) and FE, then the difference between the ode45 and BE solutions.
Frankie, your BE plot looks fine. However, it seems to me that you got the slope for the RK4 order analysis reverted (the error should increase with the step-size, not the other way around).

Here are the results I obtained (including BDF2 -- note that this is a 2nd order method as indicated by the slope of the corresponding line in the order analysis plot).
-Radu
Attachments
Problem2.png
Order analysis for FE, BE, RK4, BDF2
Problem2.png (4.61 KiB) Viewed 6134 times
Problem1.png
Solution with FE, BE, RK4, BDF2 (compared against ode45)
Problem1.png (9.44 KiB) Viewed 6134 times
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Tue Nov 19, 2013 1:00 pm

Re: Matlab 09 Results

WoongJo Choi
Attachments
Screen Shot 2013-11-19 at 11.53.12 AM.png
FE
Screen Shot 2013-11-19 at 11.53.12 AM.png (17.39 KiB) Viewed 6125 times
Screen Shot 2013-11-19 at 11.52.49 AM.png
BE
Screen Shot 2013-11-19 at 11.52.49 AM.png (17.76 KiB) Viewed 6125 times
Screen Shot 2013-11-19 at 11.53.00 AM.png
RK4
Screen Shot 2013-11-19 at 11.53.00 AM.png (18.32 KiB) Viewed 6125 times
WoongJo Choi
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Tue Nov 19, 2013 1:01 pm

Re: Matlab 09 Results

Woongjo Choi
Attachments
Screen Shot 2013-11-19 at 11.52.39 AM.png
BDF2
Screen Shot 2013-11-19 at 11.52.39 AM.png (17.46 KiB) Viewed 6125 times
Screen Shot 2013-11-19 at 11.53.35 AM.png
Convergence plot
Screen Shot 2013-11-19 at 11.53.35 AM.png (18.17 KiB) Viewed 6125 times
WoongJo Choi
<<

F13thibault.12

Newbie
Newbie

Posts: 27

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 3:49 pm

Re: Matlab 09 Results

ThibaultFigs_Matlab09.jpg
Problem 1, parts 2 and 3. Attempt 2.0...
ThibaultFigs_Matlab09.jpg (57.78 KiB) Viewed 6117 times


Here are the figures...look much better now.

Matthew T
<<

F13dsheppard

Newbie
Newbie

Posts: 7

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 5:43 pm

Re: Matlab 09 Results

ODE_VS_FE.png
ODE_VS_FE.png (3.31 KiB) Viewed 6099 times

Forward Euler

ODE_VS_BE.png
ODE_VS_BE.png (3.52 KiB) Viewed 6099 times

Backward Euler

ODE_VS_RK.png
ODE_VS_RK.png (3.84 KiB) Viewed 6099 times

Runge-Katta

-Dayton S
<<

F13fnmercado

Newbie
Newbie

Posts: 16

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 7:12 pm

Re: Matlab 09 Results

Forgot absolute value
prob2.png
prob2.png (10.87 KiB) Viewed 6092 times


Added BDF2: Mine is like Woongjo Choi's - roughly negative of Radu's
prob1.png
prob1.png (8.8 KiB) Viewed 6087 times
Frankie
<<

F13gabioud

Newbie
Newbie

Posts: 20

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 8:39 pm

Re: Matlab 09 Results

Here we go
Attachments
untitled2.tif
untitled2.tif (21.6 KiB) Viewed 6079 times
untitled.tif
untitled.tif (21.58 KiB) Viewed 6079 times
<<

F13mirzendehdel

Newbie
Newbie

Posts: 6

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Tue Nov 19, 2013 8:50 pm

Re: Matlab 09 Results

BE.tif
ODE45 vs. BE
BE.tif (19.13 KiB) Viewed 6075 times
FE.tif
ODE45 vs. FE
FE.tif (19.11 KiB) Viewed 6075 times


- Amir
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Wed Nov 20, 2013 1:14 am

Re: Matlab 09 Results

WoongJo Choi
Attachments
Screen Shot 2013-11-20 at 12.12.15 AM.png
Time evolution of x of Body2
Screen Shot 2013-11-20 at 12.12.15 AM.png (19.32 KiB) Viewed 6053 times
WoongJo Choi
<<

F13alec.c.fisher

Newbie
Newbie

Posts: 6

Joined: Thu Aug 29, 2013 3:46 pm

Unread post Wed Nov 20, 2013 10:10 am

Re: Matlab 09 Results

Backward_ODE45_Difference.png
Backward_ODE45_Difference.png (7.36 KiB) Viewed 6041 times


Forward_ODE45_Difference.png
Forward_ODE45_Difference.png (7.36 KiB) Viewed 6041 times
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Wed Nov 20, 2013 10:20 am

Re: Matlab 09 Results

F13fnmercado wrote:Added BDF2: Mine is like Woongjo Choi's - roughly negative of Radu's

Frankie, this is not necessarily surprising. When using an implicit integration formula, the IVP solution obviously depends on how the underlying nonlinear problem is solved (including the tolerance, the initial guess, how the Jacobian is obtained, etc.).

In my implementation of the implicit methods (BE and BDF2) I used Matlab's fsolve function with:

  • a tolerance of 1e-10 (you need a relatively tight tolerance in the nonlinear solver so that errors at that stage do not negatively impact the integration accuracy)
  • the IVP solution at the previous step as an initial guess (like you must have also done)
  • letting fsolve evaluate derivatives numerically, through finite differences, which is its default setting (I assume you used the exact Jacobian?)

Note that we do not see obvious differences in our results for BE because the accuracy of that method is lower than that of BDF2, O(h) vs. O(h2), and therefore the differences in how we each solve the underlying nonlinear problem are less relevant.

Good observation,
-Radu
<<

RaduS

Jr. Member
Jr. Member

Posts: 97

Joined: Wed Aug 14, 2013 3:08 pm

Unread post Wed Nov 20, 2013 10:26 am

Re: Matlab 09 Results

WoongJo, your plot of the time evolution of the x coordinate for the 2nd body is correct. How about those reaction forces/torques?

For reference, I post the results I obtained.

-Radu
Attachments
Problem3_reaction.png
Reaction forces and torque in revolute joint on body 2.
Problem3_reaction.png (10.29 KiB) Viewed 6041 times
Problem3_body2.png
Generalized positions, velocities, and accelerations for body 2
Problem3_body2.png (15.81 KiB) Viewed 6041 times
<<

f13wchoi26

Newbie
Newbie

Posts: 15

Joined: Wed Sep 04, 2013 3:47 pm

Unread post Wed Nov 20, 2013 12:28 pm

Re: Matlab 09 Results

WoongJo Choi
Attachments
Screen Shot 2013-11-20 at 12.12.15 AM.png
Time evolution of x of body 2
Screen Shot 2013-11-20 at 12.12.15 AM.png (19.32 KiB) Viewed 6026 times
Screen Shot 2013-11-20 at 11.24.09 AM.png
Reaction Forces on body 2
Screen Shot 2013-11-20 at 11.24.09 AM.png (18.88 KiB) Viewed 6026 times
Screen Shot 2013-11-20 at 11.24.15 AM.png
Reaction Torque on body 2
Screen Shot 2013-11-20 at 11.24.15 AM.png (17.13 KiB) Viewed 6026 times
WoongJo Choi
Next

Return to ME451 Fall 2013: Kinematics and Dynamics of Machine Systems

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.