Nowhere differentiable continuous function: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 5: Line 5:
where <math>0<a<1</math> and <math>ab>1+3/2\pi</math>.
where <math>0<a<1</math> and <math>ab>1+3/2\pi</math>.
<jsxgraph width="500" height="500" box="box">
<jsxgraph width="500" height="500" box="box">
(function(){
  var bd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-5, 3, 5, -3]});
  var bd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-5, 3, 5, -3]});
  var a = bd.create('slider', [[0.5,2],[2.5,2],[0,0.3,1]], {name:'a'});
  var a = bd.create('slider', [[0.5,2],[2.5,2],[0,0.3,1]], {name:'a'});
Line 17: Line 18:
         };
         };
  var c = bd.create('functiongraph', [f], {doAdvancedPlot:false, numberPointsHigh:6000, numberPointsLow:500, strokeWidth:1});
  var c = bd.create('functiongraph', [f], {doAdvancedPlot:false, numberPointsHigh:6000, numberPointsLow:500, strokeWidth:1});
})();
</jsxgraph>
</jsxgraph>


Line 45: Line 47:


<jsxgraph width="500" height="500" box="box2">
<jsxgraph width="500" height="500" box="box2">
(function(){
  var bd = JXG.JSXGraph.initBoard('box2', {axis:true, boundingbox: [-5, 3, 5, -3]});
  var bd = JXG.JSXGraph.initBoard('box2', {axis:true, boundingbox: [-5, 3, 5, -3]});
  var a = bd.create('slider', [[0.5,2],[2.5,2],[0,0.3,1]], {name:'a'});
  var a = bd.create('slider', [[0.5,2],[2.5,2],[0,0.3,1]], {name:'a'});
Line 62: Line 65:
         };
         };
  var c = bd.create('functiongraph', [f], {doAdvancedPlot:false, numberPointsHigh:6000, numberPointsLow:500, strokeWidth:1});
  var c = bd.create('functiongraph', [f], {doAdvancedPlot:false, numberPointsHigh:6000, numberPointsLow:500, strokeWidth:1});
})();
</jsxgraph>
</jsxgraph>


[[Category:Examples]]
[[Category:Examples]]
[[Category:Curves]]
[[Category:Curves]]

Revision as of 18:52, 22 September 2011

This page shows the graph of the nowhere differentiable, but continuos function

[math]\displaystyle{ f(x) = \sum_{k=1}^{N} a^k\cos(b^k\pi x), }[/math]

where [math]\displaystyle{ 0\lt a\lt 1 }[/math] and [math]\displaystyle{ ab\gt 1+3/2\pi }[/math].

Reference

Wei-Chi Yang, "Technology has shaped up mathematics comunities", Proceedings of the Sixteenth Asian Technology Conference in Mathmatics (ATCM 16), pp 81-96.

The underlying JavaScript code

 var bd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-5, 3, 5, -3]});
 var a = bd.create('slider', [[0.5,2],[2.5,2],[0,0.3,1]], {name:'a'});
 var b = bd.create('slider', [[0.5,1.5],[2.5,1.5],[0,20,100]], {name:'b'}); 
 var N = bd.create('slider', [[0.5,1.0],[2.5,1.0],[0,2,30]], {name:'N'}); 
 var f = function(x){
            var k, s=0.0, n = N.Value(), aa= a.Value(), bb = b.Value(); 
            for (k=1; k<n; k++) {
                s += Math.pow(aa,k)*Math.cos(Math.pow(bb,k)*Math.PI*x);
            }
            return s;
         };
 var c = bd.create('functiongraph', [f], {
                    doAdvancedPlot:false, 
                    numberPointsHigh:15000, numberPointsLow:1000, 
                    strokeWidth:1});

Speed optimization