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

Easy Java Simulations (2001- ) => Questions related to EJS => Topic started by: Rosehu on November 24, 2010, 10:39:29 pm



Title: How to plot bode diagram with ejs?
Post by: Rosehu on November 24, 2010, 10:39:29 pm
Dear all,

I've got problem with plotting the bode diagram in Ejs. I've tried to plot it with Trace-element, but it doesn't work. Does anybody have some ideas or suggestions about it? 
Thanks a lot in advance :)

Best wishes,
Rose


Title: Re: How to plot bode diagram with ejs?
Post by: Fu-Kwun Hwang on November 25, 2010, 12:12:46 pm
Please attached you ejs source code , explain what kind of trace you want to plot and how you did it.


Title: Re: How to plot bode diagram with ejs?
Post by: Rosehu on November 25, 2010, 10:22:51 pm
Well, I want to draw a curve about the function G(w)= 1/Math.sqrt((c-m*w*w)*(c-m*w*w)+b*b*w*w), where the parameter c, m and b can be changed by sliders. The w is the x axis input, and it has a fixed range from 0 to 5000. G is the y axis input.
In other words, this curve can be modified automaticly if the parameter c, m or b is changed.

I just put this funtion under the Fixed-Relation. I don't know how to define the range of w, so I just made a loop in the code:

for (w=0; w<=5000; w=w+0.05)
G= 1/Math.sqrt((c-m*w*w)*(c-m*w*w)+b*b*w*w);

Anyways the curve didn't show up in the plotting panel. :'(

hope I've explained clearly. :)