Author Topic: Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet  (Read 25082 times)

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Name after 26 April 2010
Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet

Magnetic Bar Field Model to rename to Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet as request by one of the authors.
written by Wolfgang Christian, Francisco Esquembre, and Anne Cox remixed now by lookang :)
special thanks to Fu-Kwun Hwang for mentoring this learning community.
http://www.compadre.org/osp/document/ServeFile.cfm?ID=9414&DocID=1310#Doc1310

This now has great features, thanks to Wolfgang Christian, Francisco Esquembre, and Anne Cox for sharing their original applet, special thanks to Fu-Kwun Hwang for mentoring this learning community, support the development of this new and improved Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet.

This material is re-released under the GNU General Public License Version 3. http://www.gnu.org/licenses/gpl.html as legally required by the original authors.

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
  • Please feel free to post your ideas about how to use the simulation for better teaching and learning.
  • Post questions to be asked to help students to think, to explore.
  • Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!
« Last Edit: June 16, 2010, 05:47:25 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #1 on: December 10, 2009, 12:11:26 am »
found a Youtube video creative commons license
http://www.davidcolarusso.com/blog/



Enjoy!

YouTube. Was stuck at Portland airport from 11pm to 4am, decided to use the time to make some promotional video on the applets shared during 2010 AAPT Summer Meeting in Portland, Oregon
« Last Edit: July 26, 2010, 10:24:10 pm by lookang »

Coffee makers

  • Posts: -5
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #2 on: December 17, 2009, 03:56:46 pm »
Nice post thanks
« Last Edit: December 17, 2009, 04:27:53 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #3 on: April 14, 2010, 05:32:20 pm »
14April 2010
7 added Bx., By, Angle to the compass measurement like http://phet.colorado.edu/simulations/sims.php?sim=Faradays_Electromagnetic_Lab
8 added thetadeg which shows the degree format
9 added codes to make the inside of the magnet Bx = 225 T, By = 0 T
10 modify the getBComputeField() to work for the Field only and the getB work for the compass
11 added MagneticFieldStrength B is affected by the slider by a factor of 0 to 1 by using vectorfieldmaxopposite can changing it the double solve the bug of displaying 0 or 225 cause by the integer type initially assigned by original authors
12 learn a new code from open source physics _view.format(getB(xCompass, yCompass)[1],"0.00")
fieldValueBx="B_{x}= "+_view.format(getB(xCompass, yCompass)[0],"0.00")+" T";
fieldValueBy="B_{y}= "+_view.format(getB(xCompass, yCompass)[1],"0.00")+" T";
fieldValueAngle="$\theta$= "+_view.format(getB(xCompass, yCompass)[3],"0.00") + "radian";
angledeg= getB(xCompass, yCompass)[3]*180/Math.PI;
fieldValueAngledeg = "$\theta$= "+ _view.format(angledeg,"0.0") + "$\degree$";

« Last Edit: April 17, 2010, 12:37:40 am by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #4 on: April 17, 2010, 12:37:20 am »
16April 2010
13 rearrange the buttons at the bottom to be more grouped logically
14 added flip magnet from SN to NS orientation!!!! figure out how to change the B field as well as the Get B
15 added accompanying graphics to the new orientation by doing a rotation 180 deg
16 added picture of compass licensed by This file is licensed under the Creative Commons Attribution ShareAlike 3.0 by Sofia from http://en.wikipedia.org/wiki/File:Kompas_Sofia.JPG resize it to only 4 kb
17 change the evolution equation to domega/dt = -k*getB(xCompass, yCompass)[2]*(Math.sin(deltaTheta))-damp*omega so that the motion of the compass depends on the B strength at the location of the xCompass, yCompass.
18 change damping factor of compass to damp instead of b which was confusing to the calculations of b[0]....b[3] in the custom function
19 varied the value of k from 1 to 0.2 to simulate real life behavior closer less spring force constant since B vary from 0 to 225 arbitrary set by lookang
20 varied damp from 0.2 to 1 to simulate real life behavior closer damping higher more critically damped


There appears to be a runtime bug, the applet hangs if there is on drag on the compass for a long time, it jams, strange. how to fix ? hmmmm
Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: 21
   at org.opensourcephysics.drawing2d.VectorField.processMagnitude(Unknown Source)
   at org.opensourcephysics.drawing2d.VectorField.prepareField(Unknown Source)
   at org.opensourcephysics.drawing2d.VectorField.draw(Unknown Source)
   at org.opensourcephysics.display.DrawingPanel.paintDrawableList(Unknown Source)
   at org.opensourcephysics.display.DrawingPanel.paintEverything(Unknown Source)
   at org.opensourcephysics.display.DrawingPanel.render(Unknown Source)
   at org.opensourcephysics.display.DrawingPanel.render(Unknown Source)
   at org.colos.ejs.library.control.swing.ControlDrawablesParent.finalUpdate(Unknown Source)
   at org.colos.ejs.library.control.EjsControl.finalUpdate(Unknown Source)
   at org.colos.ejs.library.Animation.update(Unknown Source)
   at org.colos.ejs.library.Animation.updateWhenIdle(Unknown Source)
   at org.colos.ejs.library.control.EjsControl.updateSimulationWhenIdle(Unknown Source)
   at org.colos.ejs.library.control.ControlElement.variablesChanged(Unknown Source)
   at org.colos.ejs.library.control.drawing2d.ControlElement2D.propagatePosition(Unknown Source)
   at org.colos.ejs.library.control.drawing2d.ControlElement2D.reportMouseMotion(Unknown Source)
   at org.colos.ejs.library.control.drawing2d.ControlElement2D.interactionPerformed(Unknown Source)
   at org.opensourcephysics.drawing2d.Element.invokeActions(Unknown Source)
   at org.colos.ejs.library.control.swing.UpdateHotSpot2DDelayedAction.performAction(Unknown Source)
   at org.colos.ejs.library.Animation.checkMethodsInvokedByView(Unknown Source)
   at org.colos.ejs.library.Animation.update(Unknown Source)
   at org.colos.ejs.library.Animation.step(Unknown Source)
   at org.colos.ejs.library.Animation.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:637)

but in
public void _method_for_hideField_actionoff () { // line 634
  hideField=false; // line 635
  computeField(); // line 636
  }  // line 637 there is nothing ??? strange
« Last Edit: April 17, 2010, 01:50:14 am by lookang »

ahmedelshfie

  • Hero Member
  • Posts: 930
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #5 on: April 17, 2010, 03:08:26 am »
IS very interesting that you Edit src code Prof  ;)

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #6 on: April 17, 2010, 08:19:12 am »
I have written down here what I learnt and made the original applet into a learning object that I would use.
That how I benefit the world :)
u can do it 2 , and it is really fun, but tough fun.
« Last Edit: April 24, 2010, 10:30:12 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Re: Ejs Open Source Bar Magnet Model java applet
« Reply #7 on: April 25, 2010, 11:35:23 pm »
google earth picture of asia

still working on it
« Last Edit: April 26, 2010, 01:50:03 pm by lookang »

lookang

  • Moderator
  • Hero Member
  • *****
  • Posts: 1774
  • http://weelookang.blogspot.com
    • lookang web
Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet.
This now has great features, thanks to Wolfgang Christian, Francisco Esquembre, and Anne Cox for sharing their original applet, special thanks to Fu-Kwun Hwang for mentoring this learning community, support the development of this new and improved Ejs Open Source Bar Magnet & Compass Model with Earth visualization java applet.
This has been a great learning journey for me :)
Enjoy!
Attached are the pictures of the last remix and the powerup rotation remix thanks to Prof Fu-Kwun Hwang.