|
|
Line 17: |
Line 17: |
|
| |
|
| How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript] | | How do we visualize or predict using this topic. Consider embedding some vpython code here [https://trinket.io/glowscript/31d0f9ad9e Teach hands-on with GlowScript] |
|
| |
| <div id="glowscript" class="glowscript">
| |
| <link type="text/css" href="http://www.glowscript.org/css/redmond/1.1/jquery-ui.custom.css" rel="stylesheet" />
| |
| <link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
| |
| <link type="text/css" href="http://www.glowscript.org/css/ide.css" rel="stylesheet" />
| |
| <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
| |
| <script type="text/javascript" src="http://www.glowscript.org/lib/jquery/1.1/jquery.min.js"></script>
| |
| <script type="text/javascript" src="http://www.glowscript.org/lib/jquery/1.1/jquery-ui.custom.min.js"></script>
| |
| <script type="text/javascript" src="http://www.glowscript.org/package/glow.1.1.min.js"></script>
| |
| <script type="text/javascript" src="http://www.glowscript.org/package/RSrun.1.1.min.js"></script>
| |
| <script type="text/javascript">
| |
| ;(function() {
| |
| var __g=typeof global!=='undefined'?global:window;__g=(__g.__streamline||(__g.__streamline={}));__g.setEF=__g.setEF||function(e,f){e.__frame = e.__frame||f};var __srcName='undefined_.js';
| |
| function __func(_,__this,__arguments,fn,index,frame,body){if(!_){return __future.call(__this,fn,__arguments,index)}frame.file=__srcName;frame.prev=__g.frame;__g.frame=frame;try{body()}catch(e){__g.setEF(e,frame.prev);__propagate(_,e)}finally{__g.frame=frame.prev}}
| |
| function __cb(_,frame,offset,col,fn){frame.offset=offset;frame.col=col;var ctx=__g.context;return function ___(err,result){var oldFrame=__g.frame;__g.frame=frame;__g.context=ctx;try{if(err){__g.setEF(err,frame);return _(err)}return fn(null,result)}catch(ex){__g.setEF(ex,frame);return __propagate(_,ex)}finally{__g.frame=oldFrame}}}
| |
| function __future(fn,args,i){var done,err,result;var cb=function(e,r){done=true;err=e,result=r};args=Array.prototype.slice.call(args);args[i]=function ___(e,r){cb(e,r)};fn.apply(this,args);return function ___(_){if(done)_.call(this,err,result);else cb=_.bind(this)}.bind(this)}
| |
| function __propagate(_,err){try{_(err)}catch(ex){__trap(ex)}}
| |
| function __trap(err){if(err){if(__g.context&&__g.context.errorHandler)__g.context.errorHandler(err);else console.error("UNCAUGHT EXCEPTION: "+err.message+"\n"+err.stack)}}
| |
| /* 1 */ function main(wait) {
| |
| var version, box, sphere, cylinder, pyramid, cone, helix, ellipsoid, ring, arrow, graph, display, vector, _$GS_$END, scene, _$rapyd$_Temp, _$rapyd$_print, arange, field, ball, trail, g, deltat, Fnet, t;
| |
| var __frame = {
| |
| name: "main",
| |
| line: 1
| |
| };
| |
| return __func(wait, this, arguments, main, 0, __frame, function __$main() {
| |
| /* 3 */ version = ["1.1","glowscript",];
| |
| /* 4 */ window.__GSlang = "vpython";
| |
| /* 5 */ box = vp_box;
| |
| /* 6 */ sphere = vp_sphere;
| |
| /* 7 */ cylinder = vp_cylinder;
| |
| /* 8 */ pyramid = vp_pyramid;
| |
| /* 9 */ cone = vp_cone;
| |
| /* 10 */ helix = vp_helix;
| |
| /* 11 */ ellipsoid = vp_ellipsoid;
| |
| /* 12 */ ring = vp_ring;
| |
| /* 13 */ arrow = vp_arrow;
| |
| /* 14 */ graph = vp_graph;
| |
| /* 15 */ display = canvas;
| |
| /* 16 */ vector = vec;
| |
| /* 17 */ _$GS_$END = 0;
| |
| /* 18 */ scene = canvas();
| |
| /* 19 */ _$rapyd$_Temp = 0;
| |
| /* 20 */ _$rapyd$_print = GSprint;
| |
| /* 21 */ arange = range;
| |
| /* 23 */ scene.background = color.black;
| |
| /* 25 */ field = box({
| |
| /* 25 */ pos: vector(0, 0, 0),
| |
| /* 25 */ size: vector(300, 10, 100),
| |
| /* 25 */ color: color.red,
| |
| /* 25 */ opacity: 0.3
| |
| });
| |
| /* 27 */ ball = sphere({
| |
| /* 27 */ radius: 10,
| |
| /* 27 */ color: color.blue
| |
| });
| |
| /* 29 */ trail = curve({
| |
| /* 29 */ color: color.green,
| |
| /* 29 */ radius: 3
| |
| });
| |
| /* 31 */ ball.m = 0.6;
| |
| /* 33 */ ball.pos = vector(150["-u"](), 0, 0);
| |
| /* 35 */ ball.v = vector(30, 40, 0);
| |
| /* 37 */ g = vector(0, 9.8["-u"](), 0);
| |
| /* 39 */ t = 0;
| |
| /* 41 */ deltat = 0.001;
| |
| return (function ___(__break) {
| |
| var __more;
| |
| var __loop = __cb(wait, __frame, 0, 0, function __$main() {
| |
| __more = false;
| |
| /* 43 */ var __1 = (ball.pos.y >= 0);
| |
| if (__1) {
| |
| /* 45 */ return rate(1000, __cb(wait, __frame, 44, -1, function __$main() {
| |
| /* 47 */ Fnet = ball.m["*"](g);
| |
| /* 49 */ ball.v = ball.v["+"](Fnet["/"](ball.m)["*"](deltat));
| |
| /* 51 */ ball.pos = ball.pos["+"](ball.v["*"](deltat));
| |
| /* 53 */ trail.append({
| |
| /* 53 */ pos: ball.pos
| |
| });
| |
| /* 55 */ t = t["+"](deltat);
| |
| while (__more) {
| |
| __loop();
| |
| };
| |
| __more = true;
| |
| }));
| |
| }
| |
| else {
| |
| __break();
| |
| }
| |
| ;
| |
| });
| |
| do {
| |
| __loop();
| |
| } while (__more);
| |
| __more = true;
| |
| })(function __$main() {
| |
| /* 58 */ print;
| |
| /* 59 */ t;
| |
| /* 61 */ print;
| |
| /* 62 */ ball.pos;
| |
| wait();
| |
| });
| |
| });
| |
| };
| |
| /* 64 */ main;
| |
|
| |
| ;$(function(){ window.__context = { glowscript_container: $("#glowscript").removeAttr("id") }; main() })})()
| |
| </script>
| |
| </div>
| |
|
| |
|
| ==Examples== | | ==Examples== |
claimed by ngillis3
PLEASE DO NOT EDIT THIS PAGE. COPY THIS TEMPLATE AND PASTE IT INTO A NEW PAGE FOR YOUR TOPIC.
Short Description of Topic
The Main Idea
State, in your own words, the main idea for this topic
Electric Field of Capacitor
A Mathematical Model
What are the mathematical equations that allow us to model this topic. For example [math]\displaystyle{ {\frac{d\vec{p}}{dt}}_{system} = \vec{F}_{net} }[/math] where p is the momentum of the system and F is the net force from the surroundings.
A Computational Model
How do we visualize or predict using this topic. Consider embedding some vpython code here Teach hands-on with GlowScript
Examples
Be sure to show all steps in your solution and include diagrams whenever possible
Simple
Middling
Difficult
Connectedness
- How is this topic connected to something that you are interested in?
- How is it connected to your major?
- Is there an interesting industrial application?
History
Put this idea in historical context. Give the reader the Who, What, When, Where, and Why.
See also
Are there related topics or categories in this wiki resource for the curious reader to explore? How does this topic fit into that context?
Further reading
Books, Articles or other print media on this topic
External links
[1]
References
This section contains the the references you used while writing this page