Title: Ask : How to draw v(t) with EJS Post by: ahmedelshfie on December 30, 2009, 05:42:18 pm Hello professor this project XML my ask is about
graphic of (V) i typing equations Vx,,Vy,,and V but only graic v about time no work so i change i think is mathematics on evolution... so (T)(V) graphic no Right .. thanks for help with my respet Ahmed Title: Re: Ask Post by: Fu-Kwun Hwang on December 31, 2009, 10:54:14 pm Quote Hello prof thank you for your help the project is motion project v;vx;vy i get equations vx and vy right valecoty, the ramp and grafity only problem about t(time) grfic of time so variables is,, t = 0.0,, y = 0.0,, vy = 0.0,, g = 9.8,, x = 0.0,, vx = 0.0,, v0 = 10,, theta = 1.57,,,, The above message is what I received in my private message box.ok and all type is (double) so i make equation in initialization vx and vy by this way vx = v0*Math.cos(theta); / vy = v0*Math.sin(theta); and typing in initialization t = 0; x =0; y =0; g =9.8; ok so all get right about grafic now only the problem is i wanna get grafic of time and for me get grfaic time on plot that mean i use (V) so v = math.sqrt(vx*vx)+(vy*vy-g*t); i typing by way of easy java becouse i try typing equation by mathtype and paste for you but no accept so prossor i hope u can help“me how i get (V) on program and grfic t (time) for (V) thank you profssor for you help with all my respect ahmed The following is my response to your question. Code: t = 0.100; The above is what you wrote in initialize page. Normally, what I will do isx = 0; y = 0; g =9.8; vx = v0*Math.cos(theta); vy = v0*Math.sin(theta)-g*t; Code: t=0.s; because you already set up correct evolution relations:x=0; y=0; g=-9.8; vx=v0*Math.cos(theta); vy=v0*Math.sin(theta); dx/dt=vx dy/dt=vy; dvy/dt=-g; when simulation is playing, it will calculate x(t),y(t),vy(t) according to the above equations. There are three trace in your plottingPanel: Code: The name: Input X and Input Y are 1. plot : x,y 2. plot2: x,vy 3. plot2: vx,t If I want to show trace vary as function as time t, the Input X property should be all time t. If you want to show v=Math.sqrt(vx*vx+vy*vy) as function of time you can assign Input X as t, and assign Inoput Y as Math.sqrt(vx*vx+vy*vy). If you assign Input X as t, and Input Y as vy, you will find a stralight line because vy=vy(t=0)-g*t; Title: Ask/board:29-100- Post by: ahmedelshfie on January 04, 2010, 04:47:00 pm Hello profssor this Xml file i post topic befor about this project like you ask me
im try get ghrapic of (V) i think the problem in evolution im wait your answer profssor with all my respect Ahmed Title: hi Post by: ahmedelshfie on January 04, 2010, 07:09:09 pm Hello prof i find word file i send you as jpg for you see graphics of velocity with time (V)(T)
thanks so much Ahmed Title: Re: hi Post by: lookang on January 04, 2010, 09:18:11 pm u want to plot vx , vy and |v| ?
U may want to look into the source xml here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=745.0 Title: Re: How to draw v(t) with EJS (modified EJS xml file) Post by: Fu-Kwun Hwang on January 05, 2010, 11:25:25 pm Hello prof i find word file i send you as jpg for you see graphics of velocity with time (V)(T) thanks so much Ahmed You should move Code: if (y< 0) _pause(); to Fixed relations tab.You do not need $\frac{dv}{dt}=g*t-vy$. $\frac{dvy}{dt}=-g$ will calculate $vy(t)=vy(t=0)-gt$ for you I have modified your ejs xml source. Please check out the attached file. |