1.0

1.0 | 1 rating Rate this file 10 Downloads (last 30 days) File Size: 2.06 KB File ID: #17521
image thumbnail

damped simle pendulum

by abhinav

 

14 Nov 2007 (Updated 14 Nov 2007)

simple pendulum with damping

| Watch this File

File Information
Description

after downloading
to run program, enter damping(r,R,h,l,m)
m=mass of bob
h=height to which bob is thrown
l=damping factor(i.e gamma=(l/2m))
r=length of pendulm
r=radius of bob
enter ur values...for programm..enjoy...

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
14 Nov 2007 John D'Errico

I'm sorry, but people need to learn that your job as a programmer is not done when you write the last line of code. All those lines of code are worthless if you provide no help in the code. In 68 lines of code, there are exactly ZERO lines of comments. Not a single line for help. Not a single line of error checking. There is no H1 line to make lookfor function properly. No explanation is provided for help on the meaning of the parameters, or what the output means. Yes, there are a couple of lines in the website description, but when this is used in Matlab, there is nothing. And this is Matlab code. There are no defaults for the parameters, no suggestion what the units are, no example of nominal parameters that might produce interesting results. There are NO internal comments.

The code is terribly dense, the author has apparently never learned that carriage returns are free in Matlab.

Why are internal comments valuable here? This code does nothing of value for a scientist or engineer who needs to find useful code on the FEX. So really, the only reason why you might choose to download this is to learn from it. Without any internal comments, nobody can figure out what was done, or why it was done that way.

Part of me wants to rate this as 2 - "needs improvement". However, I would be exceedingly charitable in choosing a rating other than 1 here. Is there anything in this that suggests a better rating? Its a function, not a script that clears your Matlab workspace.

Is there anything else? I looked through the code, but its just poorly written code. I'm sorry, but it is. Stringing together long lines of code does not make you a good programmer.

15 Nov 2007 V P

Agree with John. If people invest their time into downloading/testing/reading/thinking, they should get something instead. If you do not want to be a thief of somebody's life, explain possibly precisely, what is that great job done by your file.

In addition: simple pendulae do not exist. A pendulum can be either mathematical or physical. If the bob has radius, this is a physical pendulum. The problem is in any case a two-line excercise for beginners starting with ode solvers. In given case it is much worse, because a simple analytical solution is possible. Why do you need any numerical method at all?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
chemistry abhinav 22 Oct 2008 09:35:08
physics abhinav 22 Oct 2008 09:35:08
pendulum abhinav 22 Oct 2008 09:35:08
harmonic motion abhinav 22 Oct 2008 09:35:08
damping abhinav 22 Oct 2008 09:35:08

Contact us at files@mathworks.com