NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
September 20, 2018, 02:26:38 pm
 Welcome, Guest. Please login or register.Did you miss your activation email? 1 Hour 1 Day 1 Week 1 Month Forever Login with username, password and session length

 Home Help Search Login Register
Last chance is the best chance. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: How to plot bode diagram with ejs?  (Read 4305 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?
Thanks a lot in advance

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
Last chance is the best chance. ...Wisdom