NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 11, 2018, 09:55:38 am

"That their main business was not put into the mind knowledge which was not there before, but to turn the mind's eye towards light so that it might see for itself." ...Plato's advice to educators(429-347BC)

 Pages: [1]   Go Down
 Author Topic: How to plot bode diagram with ejs?  (Read 4391 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Rosehu
Newbie

Offline

Posts: 2

 « Embed this message on: November 24, 2010, 10:39:29 pm » posted from:Aachen,Nordrhein-Westfalen,Germany

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?

Best wishes,
Rose
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3080

 « Embed this message Reply #1 on: November 25, 2010, 12:12:46 pm » posted from:Taipei,T'ai-pei,Taiwan

Please attached you ejs source code , explain what kind of trace you want to plot and how you did it.
 Logged
Rosehu
Newbie

Offline

Posts: 2

 « Embed this message Reply #2 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.

 Logged
 Pages: [1]   Go Up
"That their main business was not put into the mind knowledge which was not there before, but to turn the mind's eye towards light so that it might see for itself." ...Plato's advice to educators(429-347BC)