NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 19, 2017, 01:43:45 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"Vision, mission and action." ...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: how to make EJS calculate area under curve ?  (Read 7905 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: September 22, 2008, 12:20:45 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

in the learning of

s = u.t +1/2.a.t^2

ds/dt = u + a.t

d^2s/dt^2 = a

how to make EJS calculate area under curve ?

do you have an example for me to learn from?

can it be like a universal set of codes that can be modified into any EJS that you have adopted a standard way of variable assignment so that simple copy and paste of codes allow it to work?

like a java function

http://science.kennesaw.edu/~plaval/applets/HelpInt.html
int()

Java Math Engine: Integration

Symbolic integration can be performed on objects known to the system such as built-in functions, previously defined functions, variable and operations. The symbolic integration engine is not as powerful as the differentiation engine, simply because integration is not as easy. We will list below the kind of functions which can be integrated.
The operator which performs symbolic integration is int. There are three ways to use it:

  1. int(expr)
  2. int(expr, var)
  3. int(expr, var, val1, val2)




thanks!

it appears i have asked this before:)
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=491.0
    
request for addon in graphical analysis
« on: July 05, 2007, 01:14:52 PM »
« Last Edit: September 22, 2008, 01:00:57 pm by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: September 22, 2008, 02:27:51 pm » posted from:Taipei,T'ai-pei,Taiwan

This is not the same as previous question at http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=491.0

It is easy with EJS if you just want to calculate the area for know function f(t).
Because what you want to do is calculate the integration of the function f(t).

Remember in evolution page when you type
dx/dt= v;
and
dv/dt=a; // or what ever function you have provided

What EJS did was integrate those two functions : v(t) and a(t) for you.
If you save the value x(t) before you let the time evolute as  xs and x(t) just after the end time of your integration as xn.
Then, xn-xs is the area that you want.

Actually, that is the meaning of the integration.
A lot of people learn how to calculate the integration or differentiation but did not really understand the meaning of it. 

If we only REMEMBER what we have learn, we can only solve standard problem in the textbook.
To solve REAL PROBLEM we need to apply what we have learn. And it require that we really UNDERSTAND what we have learned.

Our current physics/mathematics education system address too much on calculation. We should focus more on CONCEPTUAL UNDERSTANDING. Let's why I put Conceptual Learning of Science as major title for this web site.

I do not want to give you code for you to CUT and PASTE.
I hope you can solve it by yourself  with the above provided information.
We should teach our student to learn how to solve problem by themselves.
If we alway give them full detail of solution, they will only COPY and PASTE, and most of them will never learn how to solve the real problem.

May be you have thought: Why most of the simulations in this web site did not provide full detail information.
I did it in purpose.  I hope students/users can use the provided information and starts to think about the problem. If they could not figure it out, they can post question and I will provide more information. But I do not want to give full solution in the first place.
User will be able to enjoy the joy of learning physics when s/he figure out the problem by her/himself.
What teacher should do is helping students to solve the problem, not to solve problem for students to remember.

A good physics teacher is not the one that students think the teacher is very good in physics.
A good teacher is the one who make students think they can be very good in physics. (students can solve physics problem by themselves.)

Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: September 22, 2008, 03:04:06 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

It is easy with EJS if you just want to calculate the area for know function f(t).
Because what you want to do is calculate the integration of the function f(t).
Remember in evolution page when you type
dx/dt= v;
and
dv/dt=a; // or what ever function you have provided
What EJS did was integrate those two functions : v(t) and a(t) for you.
If you save the value x(t) before you let the time evolute as  xs and x(t) just after the end time of your integration as xn.
Then, xn-xs is the area that you want.

A good physics teacher is not the one that students think the teacher is very good in physics.
A good teacher is the one who make students think they can be very good in physics. (students can solve physics problem by themselves.)



Let me try this first!
If you save the value x(t) before you let the time evolute as  xs and x(t) just after the end time of your integration as xn.
Then, xn-xs is the area that you want.
When i encounter problem, i am ask again Smiley

I do agree on the strength of empowering, enabling, engaging the students...... make them believe in their own abilities/themselves. I know you are using EJS as a pedagogy tool for deep and meaningful learning. That is why i am learning and sharpening my tool!


BTW i figure out the logic of the polygon the simple area of a polygon with 4 vertices
(PT[0],PY1[0])
(PT[1],PY1[1])
(PT[2],PY1[2])
(PT[3],PY1[3]). 
Area = 1/2 ( base)( height) = 1/2 ( PX[3] - PX[0] ) {( PT[2] - PT[3] )+(PT[1] - PT[0])}
not as elegant as the method you mentioned


« Last Edit: September 26, 2008, 11:36:34 am by lookang » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: September 22, 2008, 10:15:22 pm »

I know you are a quick and smart learner, that is why I leave more space for you to work out by yourself.
But I will always be available when you DO need help!


Your equation only work if two side are parallel. It is O.K. for integration.  Cheesy

For more general polygon: try to think about the meaning of cross product.  A X B
Logged
Pages: [1]   Go Up
  Print  
"Vision, mission and action." ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Calculate volumn of sphere: cut it into many disks
misc
Fu-Kwun Hwang 0 5169 Last post January 31, 2010, 12:48:08 pm
by Fu-Kwun Hwang
Calculate volumn of sphere: cut it into many disks
misc
ahmedelshfie 0 3103 Last post May 21, 2010, 01:07:09 am
by ahmedelshfie
how do you calculate forces in a collision?
Question related to Physics or physics related simulation
Bluzkin 1 4529 Last post November 24, 2010, 09:51:48 pm
by Fu-Kwun Hwang
Cooling/Heating Curve Remixed
Collaborative Community of EJS
engrg1 9 11789 Last post May 03, 2013, 01:32:59 pm
by engrg1
Lissajous Curve from Y-suspended pendulum
Dynamics
Fu-Kwun Hwang 0 7049 Last post March 18, 2015, 08:07:56 pm
by Fu-Kwun Hwang
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.067 seconds with 22 queries.since 2011/06/15