Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
on: July 17, 2011, 05:29:32 pm » |
|
 I have one question about one program that i'm programming in EJS: I try to made the simulation of this program and i get one error "_view.drawingPanel3D.repaint();" ...i don't know what mean with this error message, because my simulation is in 2D and i don't have anything about 3D in my program. This is the "applet source code" of my programm: * Class : satelite_474Applet.java * Generated using * Easy Java Simulations Version 4.3.3.2, build 110619. Visit http://www.um.es/fem/Ejs */
...package satelite_474_pkg;
import org.colos.ejs.library._EjsConstants;
public class satelite_474Applet extends org.colos.ejs.library.LauncherApplet {
static {
org.opensourcephysics.display.OSPRuntime.loadTranslatorTool = false;
org.opensourcephysics.display.OSPRuntime.loadExportTool = false; }
public void init () {
super.init();
org.opensourcephysics.tools.ResourceLoader.addAppletSearchPath("/");
org.opensourcephysics.tools.ResourceLoader.addSearchPath(getCodeBase()+""); // This is for relative files
org.opensourcephysics.tools.ResourceLoader.addSearchPath(""); // This is for relative files, too
//org.colos.ejs.library.Simulation.setPathToLibrary(getCodeBase()); // This is for classes (such as EjsMatlab) which needs to know where the library is
satelite_474._addHtmlPageInfo("Página Intro","_default_","Página Intro","./satelite_474_Intro 1.html");
if (getParentFrame()!=null) {
_model = new satelite_474 ("drawingFrame",getParentFrame(),getCodeBase(),this,(String[])null,true);
_simulation = _model._getSimulation();
_view = _model._getView();
}
else {
_model = new satelite_474 (null,null,getCodeBase(),this,(String[])null,true);
_simulation = _model._getSimulation();
_view = _model._getView();
}
_simulation.initEmersion(); } public void _reset() { ((satelite_474)_model)._reset(); } public void _initialize() { ((satelite_474)_model)._initialize(); } public void stop() { ((satelite_474)_model)._onExit(); } } // End of class satelite_474Applet
Someone could help me? thanks....
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #1 on: July 17, 2011, 05:39:01 pm » posted from:Taipei,T'ai-pei,Taiwan |
|
 Please upload your ejs source as attachement. You should not compile ejs generated java file. You should use EJS to compile it for you!
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #2 on: July 17, 2011, 05:43:44 pm » |
|
 I attach the .xml, i think that this is the file that you mean. Thank you.
|
*** There are 1 more attached files. You need to login to acces it!
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #3 on: July 17, 2011, 07:23:52 pm » posted from:Taipei,T'ai-pei,Taiwan |
|
 1. You have defined many variables in variable panel, However, you did not provide initial values for many of those variables. For example: You want satalite to rotate with angle o, but you never provide a value to variable o. 2. You defined a variables named as "drawingPanel3D". However, it is the same name for a 3D object(drawingPanel3D). 3. You have added two empty plottingPanel(without any GUI element in it). There are too many strange setting in your ejs file and I do not know what you really want to do. So I do not know how to correct it for you!
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #4 on: July 18, 2011, 04:30:35 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE |
|
 I attach the .xml, i think that this is the file that you mean.
Thank you.
i think you need to remove all the codes that are creating the errors for example Incorrect value for transformation: ro:PosVol i have removed all the errors, u need to put it back in with the appropriate syntax. the key to programming in ejs could be to rename your project files at key implementation stages of new codes. satellite_474.xml do you have satellite_460 to share? i cannot get your source to run so i have little idea with your simulation aims to do and can do.
|
*** There are 1 more attached files. You need to login to acces it!
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #5 on: July 18, 2011, 05:01:53 pm » |
|
 What do you mean with satellite_460?? How do you put out the error messages?? (thank you) The salellite should turn and should be controlled for the wheel, the unic variable control is the Torque.
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #6 on: July 18, 2011, 05:21:43 pm » posted from:Singapore,,Singapore |
|
 Can u find the search icon on ejs? I look at the error codes generated from the console. Use the search to identify the location of the search For example "posvol" It will show all instants where the "posvol" occur Remove them or fix them. It is ok not to have satellite 4xx.XML Just start to save different versions now so if things screw up so badly, can always abandon the file n revert to older files. Look at the new source codes for the details
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #7 on: July 18, 2011, 05:23:14 pm » |
|
 How should i indicate the rotation of the satellite?? i wrote this "r:0,0 & ro:o" but doesn't work.
|
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #8 on: July 18, 2011, 08:15:51 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL |
|
 May i misunderstanding something here, but when i check the xml source code, found that have many variables missed, uncompleted values, even the simulation doesn't running with me is always frozen, by the way : I'm using the last version ejs 4.3.3.1
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #9 on: July 18, 2011, 08:26:38 pm » |
|
 I attach the last version, anyway i don't get the rotation of the satellite.
|
*** There are 1 more attached files. You need to login to acces it!
|
|
Logged
|
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #11 on: July 19, 2011, 01:30:18 am » posted from:Uberaba,Minas Gerais,Brazil |
|
 Well, i suggest that you can use some satellite motion examples in ntnu as a reference, applets created by prof Hwang, lookang, i believe this can help you To watch what you miss variables page, here some examples URLs http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=517.0http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1877.0http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1723.0You can download the jar file and unzip, open xml source code using Ejs and look to variables to find what your project missed and what you need to add.
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #12 on: July 19, 2011, 10:18:10 pm » |
|
 The first thing, thank you really much too all for the help. You did amazing things with EJS  !!! For me is new this word, but really interesting. The second thing, i check the examples thet you sent me and the question is: do I need one string for make the rotation? My simulation is more easy than yours, i call this object satellite, becuase in the text of the exercise was write satelite, but the real thing is that is one obeject who's move only with rotation. So..... for make the rotation (in my case that is 2D) i understood that i should create one variable string (in my case rotString "y:0"). Am i rigth? 
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #13 on: July 19, 2011, 10:20:53 pm » |
|
 Could you send me more examples where one object made one move of rotation??? Thank you really much.
|
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #14 on: July 19, 2011, 11:01:16 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL |
|
 May you attach images for what you want , for me can have idea, i can also modified applet for be like you want, but as i said will be helpful that you attach some images show the object that you want, this help professor Hwang, lookang and me to help you. For example here is a simple modified i done, the original applet created by prof Hwang. Embed a running copy of this simulation Embed a running copy link(show simulation in a popuped window) Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site listPress 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: July 20, 2011, 12:36:50 am by ahmedelshfie »
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #15 on: July 20, 2011, 08:18:48 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE |
|
 the applet above looks modified by ahmed! nice one  where is the link for the applet? it is on your board? i cannot find it
|
|
« Last Edit: July 20, 2011, 08:21:00 am by lookang »
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #16 on: July 20, 2011, 11:20:57 am » posted from:Taipei,T'ai-pei,Taiwan |
|
 You are welcomed to check out the following simple examples:
|
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #17 on: July 20, 2011, 05:05:50 pm » posted from:Uberaba,Minas Gerais,Brazil |
|
 Thanks, yes in my board you can find at http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1723.0For Alex_10, i hope this what you need, for you watch the applet you need to click on the eye image.  Embed a running copy of this simulation Embed a running copy link(show simulation in a popuped window) Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site listPress 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: July 20, 2011, 07:07:51 pm by ahmedelshfie »
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #18 on: July 20, 2011, 10:40:00 pm » |
|
 Thank you for all the things that you are sending me  I don't know miss something in my exercise but i thing i'm really close, know the satellite turn, but in one moment disappear. I attach all the things that i have, all the information about the exercise, like this may be your answer are completily usefull for me. 1º I attach the picture of the thing that should turn, this object should have one move of rotation. Have two views but the simulation shuold be in 2D. 2º I attach the ecuations with that should have this object (satellite). 3º I attach my .xml 4º Is a control system the angle "θ" of an axis of a satellite using a rotating wheel. To vary the angular velocity of the satellite "ω" changes the angular velocity of the wheel "v" by a motor located in the satellite. Data: (Ω = v - ω) both are angular velocity. B = 1,01.10 -6 (N.ms/rad) viscous friction coefficient. J1 = 13,6 kg.m 2 moment of inertia of the satellite J2 = 13,6.10 -4 kg.m 2 moment of inertia of the flywheel. Je equivalent moment of inertia. T torque developed by the motor.
|
*** There are 1 more attached files. You need to login to acces it!
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #19 on: July 20, 2011, 11:09:22 pm » posted from:Uberaba,Minas Gerais,Brazil |
|
 Well, your XML code doesn't work with me, is frozen, i try find the reason to this error, however try look for the last applet and how rotate is work look to variables pi,c and also look to Evolution page last variable is dc.
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #20 on: July 22, 2011, 07:15:28 pm » |
|
 The problem is that the simulation of Professor the move of rotational is constant, mine is the state variable that specify the angular position. I tried to add this variables, pi, period,.... I changed the intial values, the programm gives good the initial value, but the object disppier one second after starting the simulation. I'm a little bit pissed with my program, I do not know what else I can change. 
|
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #21 on: July 22, 2011, 08:05:16 pm » posted from:SAO PAULO,SAO PAULO,BRAZIL |
|
 You should to check the variable o initial value =20 , i believe this variable is the reason to object disappear when you run the applet, try check. For example try delete o form first shape (open Satelite, down at transform you add variable o delete) and run the applet again.
|
|
« Last Edit: July 22, 2011, 08:31:18 pm by ahmedelshfie »
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #22 on: July 22, 2011, 10:56:40 pm » |
|
 I tried this before and doesn't work. I change all the variables, and the initial values.... 
|
|
|
Logged
|
|
|
|
ahmedelshfie
Ahmed
Hero Member
Offline
Posts: 954
|
 |
«
Embed this message
Reply #23 on: July 22, 2011, 11:09:30 pm » posted from:Uberaba,Minas Gerais,Brazil |
|
 Well, as i said in my last post to you watch object you have to delete o variable i already test this and later i run applet the object is appear. I'm gonna attach image please Check image i attach down post. You should to delete this variable and run applet again object will appear try it.
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #24 on: July 23, 2011, 06:54:04 pm » |
|
 Yes this is true, but if you put out this variable the object doesn't move, is totally stop.
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #25 on: July 23, 2011, 09:45:09 pm » posted from:Taipei,T'ai-pei,Taiwan |
|
 Normally, transform is used to rotate the object or change it width or height (shape) ...etc. If you want to move an object, you can define variable x,y and assign them to Pos X and Pos Y. Then provide equation to specify how x,y should change with time. e.g. if you define dx/dt=vx; then the object will move with velocity vx in x direction.
|
|
|
Logged
|
|
|
|
Alex_10
Newbie
Offline
Posts: 6
|
 |
«
Embed this message
Reply #26 on: July 23, 2011, 11:25:18 pm » |
|
 I tried to do this also, but the problem is that i put the refence in the middle of the object, so in my case PosX = 0 and PosY = 0 all the time. If i separate the componet x and the componet y, i would have to put the reference in a corner of the object. And i was searching this option for change the reference and i didn't find it. 
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #27 on: July 24, 2011, 09:59:37 am » posted from:Taipei,T'ai-pei,Taiwan |
|
 Pos X and Pos Y are (x,y) coordinate for center of the object. The default for (x,y) is refer to middle of the object. (You can change Offset property to change it;s reference point). You should define x,y and set Pos X, Pos Y properties to x and y. You are welcomed to check out description for those properties at http://www.um.es/fem/EjsWiki/Main/ElementsShape2D
|
|
|
Logged
|
|
|
|
|