NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Dynamics => Topic started by: Fu-Kwun Hwang on February 25, 2007, 07:40:21 pm

Title: Velocity in the same direction of the friction force!
Post by: Fu-Kwun Hwang on February 25, 2007, 07:40:21 pm
If there is no friction, the world will be very different from what we are now.
We would not be able to walk but slide on the ground.
Usually, we might think that the friction force is in the oppositive direction of the velocity.
However, it is not always the case. There are many cases in which the friction force is in the same direction of the velocity of the moving object. Especailly, when the friction is the driving force which cause the object to change it's motion.

On block on top of another block connected to a spring on a friction surface!
A block with mass m2 on top of another block with mass m1 on a frictionless surface.
Assume friction coeficient between blocks is mu.
The lower block is attached to a spring with constant k.

Click the play button or you can drag the lower block horizontally, release the mouse and watch how friction force between blocks cause the top mass to move.
Due to the friction force between blocks, the velocity of top block is in the same direction of it's friction force.

Question for you:
Does friction force always in the oppositive direction of the relative between two objects?

Title: Re: Velocity in the same direction of the friction force!
Post by: lookang on July 02, 2007, 11:33:29 pm
thanks for the lesson in friction, i could not have solve it, can't get pass the syntax.

thanks for the lesson in getAy, amazing logic for gravity

best codes you have there.

trying to learn and incorporate into my own EJS simulation:)

Long Live Sharing !! :o

Title: Re: Velocity in the same direction of the friction force!
Post by: lookang on July 11, 2007, 03:22:46 pm
Hi Prof. Hwang and everybody else here,

i need i big favor.

I am trying to adapt this EJS source into a simple one that has

a Push, P

static friction

kinetic friction.

can take a look at the codes ? i think my logic is ok but the syntax is wrong?

just can't compile for the last hours, chance to help  ;D


Title: Re: Velocity in the same direction of the friction force!
Post by: Fu-Kwun Hwang on July 13, 2007, 11:25:28 pm
You should
1. change getRealA(double f,double P) to getRealA(f,P) in evolution tab under model page.
2. change "public void getRealA (double f ,double P) {" to "public double getRealA (double f ,double P) {"

And it will get rid of all the syntax error.

Title: Re: Velocity in the same direction of the friction force!
Post by: lookang on July 14, 2007, 12:14:58 am
amazing, i am in awe !!!

Thanks Prof. Hwang ;D

easy java simulation Rocks !!!

by the way,

Is it possible to make a virtual interactive physics, click and drop objects into the simulation space?

That will really transform physics education in mechanics, when it can be that easy to make an applet that way !!

THANKS!!! i go test my codes again, thank you very much ;D

Title: Re: Velocity in the same direction of the friction force!
Post by: Fu-Kwun Hwang on July 14, 2007, 08:47:24 am
All the GUI objects in the EJS can be drag and drop, what you need to do is to add actions to it when drag or drop occurred.

If you want to drop something into simulations space. Simulation space need to know what it the object. There are several ways to implement it.
1. Divide the simulation space into two regions, one for the elements to be add into another region. You can drag and drop from one place into another space. This is the simplest way. You only have one ejs simulation.
2. Use two EJS simulations, and drag object from one simulation to another simulation. You need to add javascript  to communicate between two simulations.
3. Add objects into the web page, click object and add to EJS with javascript call.

Which one to use? It depend on your design and what you want to do.
You should know how to call functions in EJS from html page generated by EJS.(look at the source of html page)

In EJS, all the variables defined inside the variable tab,and all the functions defined in the custom tabs in model pages can be accessed with javascript.
You can call those functions with javascript, you can read/write values into ejs variables.
So you can do whatever you want to do. It only limited by your imagination.
Because EJS is a code generator, it can do whatever java can do. Or whatever, a programming language can do.

If you still need help, please let me know exactly what you want to do (in more detail). I will try to help!
I am going to Malaysia tomorrow for a three days teachers workshop at Univ. of Malaysia. Then, I will conduct another 3 days workshop about integrating information technology ICT into physics teaching for high school or middle school teachers.

I just visited your web site. May be you want to have something similar to Interactive Physics. I like interactive physics,too. However, user did not know what is the physics model behind it. That is why I use EJS. It is possible to create something similar to interactive physics with EJS.
You can use EJS to create simulations and show it to students. But that is not the main focus point for EJS. We hope student can look at the model in the EJS and modify it by themself. So they can understand the physics model better. For advanced students, we also want them to be able to create new EJS simulations. So EJS is not a programming tool, it is a modeling tool. You are welcomed to look at my paper about EJS (http://imej.wfu.edu/articles/2003/2/01/index.asp).
I have been teaching 1st years undergraduate physics students a course about EJS. And everyone has to create at least two new EJS simulations during he semester. The will do more than 10 exercises during the course, too.
Different tool has different objective. So we choice what we think it is best for our teaching at that moment.
Showing something to the student is the first step. What really important is what student do with it later on.
You have done a good job already. Best wishes to your future work (to make it even better and more advanced!).