Difference between revisions of "Interactive bass model"
Jump to navigation
Jump to search
(Replaced content with "Interactive bass model Category:marketing Category:Model") Tag: Replaced |
|||
| Line 1: | Line 1: | ||
| − | + | <html> | |
| + | <div id="jxgbox" class="jxgbox" style="height:400px; width:600px;"></div> | ||
| + | </html> | ||
| + | |||
| + | <html> | ||
| + | <script type="text/javascript"charset="UTF-8"src="https://cdn.jsdelivr.net/npm/jsxgraph@1.1.0/distrib/jsxgraphcore.js"> | ||
| + | </script> | ||
| + | <link rel="stylesheet"type="text/css"href="https://cdn.jsdelivr.net/npm/jsxgraph@1.1.0/distrib/jsxgraph.cs"/> | ||
| + | </html> | ||
| + | <html> | ||
| + | <script> | ||
| + | var board = CreateBassModelBoard(); | ||
| + | |||
| + | var p_slider = board.create('slider', [[0,-2],[10,-2], [0.0,0.03, 1.0]], {name:'p',size:2}, {withLabel:false}); | ||
| + | var q_slider = board.create('slider', [[0,-5],[10,-5], [0.0,0.32, 1.0]], {name:'q',size:1}, {withLabel:false}); | ||
| + | var M_slider = board.create('slider', [[0,0],[0,200], [0.0,100, 2000]], {name:'Market potential,size:1'}, {withLabel:false}); | ||
| + | |||
| + | CreateBass_cF_fsumGraph(board, M_slider); | ||
| + | CreateBass_fGraph(board, M_slider); | ||
| + | |||
| + | function CreateBassModelBoard() | ||
| + | { | ||
| + | var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-4, 12, 5, -7], keepaspectratio:true, axis:true, showNavigation:true}); | ||
| + | JXG.removeEvent(board.containerObj, 'mousewheel', board.mouseWheelListener, board); | ||
| + | JXG.removeEvent(board.containerObj, 'DOMMouseScroll', board.mouseWheelListener, board); | ||
| + | |||
| + | return board; | ||
| + | } | ||
| + | |||
| + | function Bass_cF_fsum(M, p, q, t) | ||
| + | { | ||
| + | Value = M * (1 - exp_p_plus_q_times_t (p,q,t)) / (1+((q/p) * exp_p_plus_q_times_t (p,q,t))); | ||
| + | return Value ; | ||
| + | } | ||
| + | |||
| + | function exp_p_plus_q_times_t (p,q,t) | ||
| + | { | ||
| + | return Math.exp (-t * (p + q)); | ||
| + | } | ||
| + | |||
| + | function Bass_f( M, p, q, t) | ||
| + | { | ||
| + | Value = M * ((Math.pow(p+q,2)/p) * exp_p_plus_q_times_t (p,q,t) / Math.pow(1+(q/p) * exp_p_plus_q_times_t (p,q,t),2)) | ||
| + | return Value ; | ||
| + | } | ||
| + | |||
| + | function CreateBass_fGraph(board, M_slider) | ||
| + | { | ||
| + | var bassfunction = board.create | ||
| + | ( | ||
| + | 'functiongraph', | ||
| + | [ | ||
| + | function(x) | ||
| + | { | ||
| + | return Bass_f( M_slider.Y(), p_slider.Value(), q_slider.Value(), x); | ||
| + | }, | ||
| + | 0, | ||
| + | 20 | ||
| + | ] | ||
| + | ); | ||
| + | } | ||
| + | |||
| + | function CreateBass_cF_fsumGraph(board, M_slider) | ||
| + | { | ||
| + | var bassfunction = board.create | ||
| + | ( | ||
| + | 'functiongraph', | ||
| + | [ | ||
| + | function(x) | ||
| + | { | ||
| + | return Bass_cF_fsum( M_slider.Y(), p_slider.Value(), q_slider.Value(), x); | ||
| + | }, | ||
| + | 0, | ||
| + | 20 | ||
| + | ] | ||
| + | ,{'strokeColor':'red'} | ||
| + | ); | ||
| + | } | ||
| + | </script> | ||
| + | </html> | ||
| + | |||
[[Category:marketing]] | [[Category:marketing]] | ||
[[Category:Model]] | [[Category:Model]] | ||
Latest revision as of 19:50, 27 August 2020