Applets:Periodendauer periodischer Signale: Unterschied zwischen den Versionen

Aus LNTwww
Wechseln zu:Navigation, Suche
Zeile 1: Zeile 1:
 
{{LntExplicitLoadMathjax}}
 
{{LntExplicitLoadMathjax}}
 
<p>
 
{{BlaueBox|TEXT=
 
$x(t) = A_1\cdot cos\Big(2\pi f_1\cdot t- \frac{2\pi}{360}\cdot \phi_1\Big)+A_2\cdot cos\Big(2\pi f_2\cdot t- \frac{2\pi}{360}\cdot \phi_2\Big)$
 
}}
 
</p>
 
  
 
<html>
 
<html>
 
<head>
 
<head>
    <meta charset="utf-8" />
+
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.99.6/jsxgraphcore.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/0.99.6/jsxgraphcore.js"></script>
+
  <script type="text/javascript" src="https://cdn.rawgit.com/mathjax/MathJax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <!-- <script type="text/javascript" src="https://www.lntwww.de/MathJax/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full,local/mwMathJaxConfig"></script> -->
+
  <style>
    <style>
+
  .button1{
        .button {
+
    background-color: black;
            background-color: black;
+
    border: none;
            border: none;
+
    color: white;
            color: white;
+
    font-family: arial;
            font-family: arial;
+
    padding: 8px 20px;
            padding: 8px 20px;
+
    text-align: center;
            text-align: center;
+
    text-decoration: none;
            text-decoration: none;
+
    display: inline-block;
            display: inline-block;
+
    font-size: 16px;
            font-size: 16px;
+
    border-radius: 15px;
            border-radius: 15px;
+
    position:relative;
        }
+
    top: 205px;
        .button:active {
+
    left: 530px;
            background-color: #939393;
+
  }
        }
 
  
        table {
+
  .button1:active {
            border-collapse: separate;
+
    background-color: #939393;}
            border-spacing: 20px 0;
 
        }
 
    </style>
 
</head>
 
  
 +
    .formel {
 +
        background-color: #f5f5f5;
 +
        border-radius: 4px ;
 +
        padding: 20px 30px;
 +
        font-family: arial;
 +
        position:absolute;
 +
        top: 250px;
 +
        left: 10px;
 +
    }
  
 +
  </style>
 +
</head>
 +
<body>
  
<body>
+
<form id="myForm">
<form id="jxgForm">
 
    <!-- Resetbutton, Checkbox, Regler und Plots -->
 
    <p>
 
        <input type="checkbox" id="gridbox" onclick="showgrid();" checked> <label for="gridbox">Gitterlinien Zeigen</label>
 
        <button class="button" onclick="rst()">Reset</button>
 
    </p>
 
    <div id="cnfBoxHtml" class="jxgbox" style="width:600px; height:100px; float:top; margin:-10px 20px 100px 0px;"></div>
 
    <div id="pltBoxHtml" class="jxgbox" style="width:600px; height:600px; border:1px solid black; margin:-10px 20px 100px 0px;"></div>
 
</form>
 
  
<!-- Ausgabefelder -->
+
<!-- Resetbutton, Checkbox und Formel -->
<table>
+
<button class="button1" style="font-size:0.750em" onclick="zurueck()">Reset</button>
    <tr>
+
<p><span class="separate" style="position:absolute; top:180px; left:550px; font-family:arial; font-size:0.750em;">mit Gitter<input name="gridbox" id="gridbox" type="checkbox" onclick="showgrid();" checked="checked"></span></p>
        <td>$x(t)$=     <span id="x(t)"></span>     </td>
+
<box class="formel">\(x(t)=A_1\cdot cos\Big(2\pi f_1\cdot t- \frac{2\pi}{360}\cdot \phi_1\Big)+A_2\cdot cos\Big(2\pi f_2\cdot t- \frac{2\pi}{360}\cdot \phi_2\Big)\)</box>
        <td>$x(t+ T_0)$=<span id="x(t+T_0)"></span> </td>
 
        <td>$x(t+2T_0)$=<span id="x(t+2T_0)"></span></td>
 
    </tr>
 
    <tr>
 
        <td>$x_{\text{max}}$=<span id="x_max"></span></td>
 
        <td>$T_0$=          <span id="T_0"></span>  </td>
 
    </tr>
 
</table>
 
  
 +
<div id="box1" class="jxgbox" style="width:600px; height:600px; border:1px solid black; margin:300px 20px 100px 0px;"></div>
 +
<div id="box2" class="jxgbox" style="width:500px; height:200px; border:1px solid white; margin:-1000px 20px 100px 0px;"></div>
 +
<div id="box3" class="jxgbox" style="width:600px; height:100px; border:1px solid white; margin:700px 20px 100px 0px;"></div>
  
 
<script type="text/javascript">
 
<script type="text/javascript">
    // Grundeinstellungen der beiden Applets
 
    JXG.Options.text.useMathJax = true;
 
    var cnfBox = JXG.JSXGraph.initBoard('cnfBoxHtml', {
 
        showCopyright: false, showNavigation: false, axis: false,
 
        grid: false, zoom: { enabled: false }, pan: { enabled: false },
 
        boundingbox: [-1, 2.2, 12.4, -2.2]
 
    });
 
    var pltBox = JXG.JSXGraph.initBoard('pltBoxHtml', {
 
        showCopyright: false, axis: false,
 
        zoom: { factorX: 1.1, factorY: 1.1, wheel: true, needshift: true, eps: 0.1 },
 
        grid: false, boundingbox: [-0.5, 2.2, 12.4, -2.2]
 
    });
 
    cnfBox.addChild(pltBox);
 
  
    // Einstellungen der Achsen
+
//Grundeinstellungen der beiden Applets
    xaxis = pltBox.create('axis', [[0, 0], [1, 0]], {
+
JXG.Options.text.useMathJax = true;
        name: '$\\dfrac{t}{T}$',
+
var brd1 = JXG.JSXGraph.initBoard('box1', {showCopyright:false, axis:false, zoom:{factorX:1.1, factorY:1.1, wheel:true, needshift:true, eps: 0.1}, grid:false, boundingbox: [-0.5, 2.2, 12.4, -2.2]});
        withLabel: true, label: { position: 'rt', offset: [-25, -10] }
+
var brd2 = JXG.JSXGraph.initBoard('box2', {showCopyright:false, showNavigation:false, axis:false, grid:false, zoom:{enabled:false}, pan:{enabled:false}, boundingbox: [-1, 2.2, 12.4, -2.2]});
    });
+
var brd3 = JXG.JSXGraph.initBoard('box3', {showCopyright:false, showNavigation:false, axis:false, grid:false, zoom:{enabled:false}, pan:{enabled:false}, boundingbox: [-1, 2.2, 12.4, -2.2]});
    yaxis = pltBox.create('axis', [[0, 0], [0, 1]], {
+
brd2.addChild(brd1);
        name: '$x(t)$',
+
brd2.addChild(brd3);
        withLabel: true, label: { position: 'rt', offset: [10, -5] }
+
 
    });
+
//Einstellungen der Achsen
 +
xaxis = brd1.create('axis', [[0, 0], [1,0]], {name:'\\[t/T\\]', withLabel:true, label:{position:'rt', offset:[-25, 15]}});
 +
yaxis = brd1.create('axis', [[0, 0], [0, 1]], {name:'\\[x(t)\\]', withLabel:true, label:{position:'rt', offset:[10, -5]}});
  
    // Erstellen der Schieberegler
+
//Festlegen der Schieberegler
    a = cnfBox.create('slider', [ [-0.7, 1.5], [3, 1.5], [0, 0.5, 1] ], {
+
a = brd2.create('slider',[[-0.7,1.5],[3,1.5],[0,0.5,1]], {withLabel:false, withTicks:false, snapWidth:0.01}),
        suffixlabel: '$A_1=$',
+
b = brd2.create('slider',[[-0.7,0.5],[3,0.5],[0,1,10]], {withLabel:false, withTicks:false, snapWidth:0.1}),
        unitLabel: 'V', snapWidth: 0.01
+
c = brd2.create('slider',[[-0.7,-0.5],[3,-0.5],[-180,0,180]], {withLabel:false, withTicks:false, snapWidth:5}),
        }),
+
d = brd2.create('slider',[[6,1.5],[9.7,1.5],[0,0.5,1]], {withLabel:false, withTicks:false, snapWidth:0.01}),
    b = cnfBox.create('slider', [ [-0.7, 0.5], [3, 0.5], [0, 1, 10] ], {
+
e = brd2.create('slider',[[6,0.5],[9.7,0.5],[0,2,10]], {withLabel:false, withTicks:false, snapWidth:0.1}),
        suffixlabel: '$f_1=$',
+
g = brd2.create('slider',[[6,-0.5],[9.7,-0.5],[-180,90,180]], {withLabel:false, withTicks:false, snapWidth:5}),
        unitLabel: 'kHz', snapWidth: 0.1
+
t = brd2.create('slider',[[-0.7,-1.5],[3,-1.5],[0,0,10]], {withLabel:false, withTicks:false, snapWidth:0.2}),
    }),
 
    c = cnfBox.create('slider', [ [-0.7, -0.5], [3, -0.5], [-180, 0, 180] ], {
 
        suffixlabel: '$\\phi_1=$',
 
        unitLabel: 'Grad', snapWidth: 5
 
    }),
 
    d = cnfBox.create('slider', [ [6, 1.5], [9.7, 1.5], [0, 0.5, 1] ], {
 
        suffixlabel: '$A_2=$',
 
        unitLabel: 'V', snapWidth: 0.01
 
    }),
 
    e = cnfBox.create('slider', [ [6, 0.5], [9.7, 0.5], [0, 2, 10] ], {
 
        suffixlabel: '$f_2=$',
 
        unitLabel: 'kHz', snapWidth: 0.1
 
    }),
 
    g = cnfBox.create('slider', [ [6, -0.5], [9.7, -0.5], [-180, 90, 180] ], {
 
        suffixlabel: '$\\phi_2=$',
 
        unitLabel: 'Grad', snapWidth: 5
 
    }),
 
    t = cnfBox.create('slider', [ [-0.7, -1.5], [3, -1.5], [0, 0, 10] ], {
 
        suffixlabel: '$t=$',
 
        unitLabel: 's', snapWidth: 0.2
 
    }),
 
  
    // Definition der Funktion
 
    signaldarstellung = pltBox.create('functiongraph', [function(x) {
 
        return (a.Value() * Math.cos(2 * Math.PI * b.Value() * x - 2 * Math.PI * c.Value() / 360) + d.Value() * Math.cos(2 * Math.PI * e.Value() * x - 2 * Math.PI * g.Value() / 360))
 
    }], {
 
        strokeColor: "red"
 
    });
 
  
    // Definition des Punktes p_T0, des Hilfspunktes p_T0h und der Geraden l_T0 für Periodendauer T_0
+
//Definition der Ausgabefelder
    p_T0 = pltBox.create('point', [
+
texta=brd2.create('text',[3.2,1.7, function()
        function() {
+
  { return '\\[A_1= '+ Math.round(a.Value()*100)/100 +' \\text{ V}\\]';}], {fixed:true, visible:true});
            return (Math.round(getT0() * 100) / 100);
+
textb=brd2.create('text',[3.2,0.7, function()
        },
+
  { return '\\[f_1= '+ Math.round(b.Value()*100)/100 +' \\text{ kHz}\\]';}], {fixed:true, visible:true});
        function() {
+
textc=brd2.create('text',[3.2,-0.3, function()
            return a.Value() * Math.cos(2 * Math.PI * b.Value() * (Math.round(getT0() * 100) / 100) - 2 * Math.PI * c.Value() / 360) +
+
  { return '\\[\\phi_1= '+ Math.round(c.Value()*100)/100 +' \\text{ Grad}\\]';}], {fixed:true, visible:true});
                d.Value() * Math.cos(2 * Math.PI * e.Value() * (Math.round(getT0() * 100) / 100) - 2 * Math.PI * g.Value() / 360);
+
textd=brd2.create('text',[9.9,1.57, function()
        }],
+
  { return '\\[A_2= '+ Math.round(d.Value()*100)/100 +' \\text{ V}\\]';}], {fixed:true, visible:true});
        { color: "blue", fixed: true, label: false, size: 1, name: '' }
+
texte=brd2.create('text',[9.9,0.57, function()
    );
+
  { return '\\[f_2= '+ Math.round(e.Value()*100)/100 +' \\text{ kHz}\\]';}], {fixed:true, visible:true});
    p_T0h = pltBox.create('point',
+
textg=brd2.create('text',[9.9,-0.43, function()
        [function() { return (Math.round(getT0() * 100) / 100); }, 2],
+
  { return '\\[\\phi_2= '+ Math.round(g.Value()*100)/100 +' \\text{ Grad}\\]';}], {fixed:true, visible:true});
        { visible: false, color: "blue", fixed: true, label: false, size: 1, name: '' }
+
textt=brd2.create('text',[3.2,-1.3, function()
    );
+
  { return '\\[t= '+ Math.round(t.Value()*100)/100 +' \\]';}], {fixed:true, visible:true});
    l_T0 = pltBox.create('line', [p_T0, p_T0h])
 
  
    // Bestimmung des Wertes T_0 mit der Funktion von Siebenwirth
+
textergebnis1=brd3.create('text',[-0.5,1.5, function()
    setInterval(function() {
+
  { return '\\[x(t)= '+ Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*t.Value()-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*t.Value()-2*Math.PI*g.Value()/360))*1000)/1000 +' \\]';}], {fixed:true, visible:true});
        document.getElementById("T_0").innerHTML = Math.round(getT0() * 100) / 100;
+
textergebnis2=brd3.create('text',[1.6,1.5, function()
    }, 50);
+
  { return '\\[x(t+T_0)= '+ Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(t.Value()+Math.round(getT0() *1000)/1000)-c.Value())+d.Value()*Math.cos(2*Math.PI*e.Value()*(t.Value()+Math.round(getT0() *1000)/1000)-g.Value()))*1000)/1000 +' \\]';}], {fixed:true, visible:true});
 +
textergebnis3=brd3.create('text',[4.5,1.5, function()
 +
  { return '\\[x(t+2T_0)= '+ Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(t.Value()+2*Math.round(getT0() *1000)/1000)-c.Value())+d.Value()*Math.cos(2*Math.PI*e.Value()*(t.Value()+2*Math.round(getT0() *1000)/1000)-g.Value()))*1000)/1000 +' \\]';}], {fixed:true, visible:true});
 +
textergebnis4=brd3.create('text',[7.75,1.5, function()
 +
{var x = new Array(50000);
 +
for (var i = 0; i < 50001; i++) {x[i] = Math.round((a.Value()*Math.cos(2*Math.PI*b.Value()*(i/1000)-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*(i/1000)-2*Math.PI*g.Value()/360)) *1000)/1000;};
 +
return '\\[x_{max}= '+ Math.max.apply(Math,x)+' \\]';}], {fixed:true, visible:true});
 +
textergebnis5=brd3.create('text',[10.5,1.5, function()
 +
  { return '\\[T_0= '+ Math.round(getT0() *100)/100 +' \\]';}], {fixed:true, visible:true, strokeColor:'blue'});
  
  
 +
//Definition der Funktion
 +
signaldarstellung = brd1.create('functiongraph',[function(x){
 +
        return (a.Value()*Math.cos(2*Math.PI*b.Value()*x-2*Math.PI*c.Value()/360)+d.Value()*Math.cos(2*Math.PI*e.Value()*x-2*Math.PI*g.Value()/360))
 +
    }], {strokeColor: "red"});
  
    function isInt(n) {
+
//Definition des Punktes p_T0, des Hilfspunktes p_T0h und der Geraden l_T0 für Periodendauer T_0
         return n % 1 === 0;
+
p_T0=brd1.create('point', [function(){ return Math.round(getT0() *100)/100;},
    }
+
      function(){ return a.Value()*Math.cos(2*Math.PI*b.Value()*(Math.round(getT0() *100)/100)-2*Math.PI*c.Value()/360)
 +
         +d.Value()*Math.cos(2*Math.PI*e.Value()*(Math.round(getT0() *100)/100)-2*Math.PI*g.Value()/360);}], {color:"blue", fixed:true, label:false, size:1, name:''})
 +
p_T0h = brd1.create('point', [function(){ return Math.round(getT0() *100)/100;}, 2], {visible: false, color:"blue", fixed:true, label:false, size:1, name:''})
 +
l_T0 = brd1.create('line', [p_T0, p_T0h])
  
 +
//Bestimmung des Wertes T_0 mit der Funktion von Siebenwirth
 
     function getT0() {
 
     function getT0() {
 +
 
         var A, B, C, Q;
 
         var A, B, C, Q;
 
         if (b.Value() < e.Value()) {
 
         if (b.Value() < e.Value()) {
Zeile 162: Zeile 127:
 
             A = e.Value();
 
             A = e.Value();
 
         }
 
         }
         // console.log('Berechne T0 mit A=' + A, 'B=' + B);
+
 
 +
         console.log('Berechne T0 mit A=' + A, 'B=' + B);
 +
 
 
         for (var x = 1; x <= 100; x++) {
 
         for (var x = 1; x <= 100; x++) {
 
             C = A / x;
 
             C = A / x;
 
             Q = B / C;
 
             Q = B / C;
             // console.log(x + '. Durchgang: C = ' + C, 'Q = ' + Q);
+
             console.log(x + '. Durchgang: C = ' + C, 'Q = ' + Q);
 
             if (isInt(Q)) {
 
             if (isInt(Q)) {
                 // console.log('Q ist eine Ganzzahl!!! T0 ist damit ', 1 / C);
+
                 console.log('Q ist eine Qanzzahl!!! T0 ist damit ', 1 / C);
 
                 return 1 / C;
 
                 return 1 / C;
 
             }
 
             }
Zeile 174: Zeile 141:
 
                 return 10;
 
                 return 10;
 
             }
 
             }
             if ((1 / C) > 10)
+
             if ((1/C) > 10)
 
                 return 10
 
                 return 10
 
         }
 
         }
 
     }
 
     }
  
 +
    function isInt(n) {
 +
        return n % 1 === 0;
 +
    }
  
  
    // Ausgabe des Wertes x(t)
 
    setInterval(function() {
 
        document.getElementById("x(t)").innerHTML = Math.round((a.Value() * Math.cos(2 * Math.PI * b.Value() * t.Value() - 2 * Math.PI * c.Value() / 360) + d.Value() * Math.cos(2 * Math.PI * e.Value() * t.Value() - 2 * Math.PI * g.Value() /
 
            360)) * 1000) / 1000;
 
    }, 50);
 
  
    // Ausgabe des Wertes x(t+T_0)
+
//Definition der Funktion zum An- und Ausschalten des Koordinatengitters
    setInterval(function() {
+
function showgrid() {
        document.getElementById("x(t+T_0)").innerHTML = Math.round((a.Value() * Math.cos(2 * Math.PI * b.Value() * (t.Value() + Math.round(getT0() * 1000) / 1000) - c.Value()) + d.Value() * Math.cos(2 * Math.PI * e.Value() * (t.Value() +
+
    if (gridbox.checked) {
            Math.round(getT0() * 1000) / 1000) - g.Value())) * 1000) / 1000;
+
      xaxis = brd1.create('axis', [[0, 0], [1,0]], {});
    }, 50);
+
      yaxis = brd1.create('axis', [[0, 0], [0, 1]], {});
 +
    } else {
 +
    xaxis.removeTicks(xaxis.defaultTicks);
 +
    yaxis.removeTicks(yaxis.defaultTicks);
 +
    }
 +
    brd1.fullUpdate();
 +
};
 +
</script>
 +
</form>
  
    // Ausgabe des Wertes x(t+2T_0)
+
<script>
    setInterval(function() {
 
        document.getElementById("x(t+2T_0)").innerHTML = Math.round((a.Value() * Math.cos(2 * Math.PI * b.Value() * (t.Value() + 2 * Math.round(getT0() * 1000) / 1000) - c.Value()) + d.Value() * Math.cos(2 * Math.PI * e.Value() * (t.Value() +
 
            2 * Math.round(getT0() * 1000) / 1000) - g.Value())) * 1000) / 1000;
 
    }, 50);
 
  
    // Ausgabe des Wertes x_max
+
//Definition des Reset-Buttons
    setInterval(function() {
+
function zurueck() {
        var x = new Array(50000);
+
    document.getElementById("myForm").reset();
        for (var i = 0; i < 50001; i++) {
+
};
            x[i] = Math.round((a.Value() * Math.cos(2 * Math.PI * b.Value() * (i / 1000) - 2 * Math.PI * c.Value() / 360) + d.Value() * Math.cos(2 * Math.PI * e.Value() * (i / 1000) - 2 * Math.PI * g.Value() / 360)) * 1000) / 1000;
+
</script>
        }
 
        document.getElementById("x_max").innerHTML = Math.max.apply(Math, x);
 
    }, 50);
 
  
 
 
    // Definition der Funktion zum An- und Ausschalten des Koordinatengitters
 
    function showgrid() {
 
        if (gridbox.checked) {
 
            xaxis = pltBox.create('axis', [ [0, 0], [1, 0] ], {});
 
            yaxis = pltBox.create('axis', [ [0, 0], [0, 1] ], {});
 
        } else {
 
            xaxis.removeTicks(xaxis.defaultTicks);
 
            yaxis.removeTicks(yaxis.defaultTicks);
 
        }
 
        pltBox.fullUpdate();
 
    };
 
 
    // Definition des Reset-Buttons
 
    function rst() {
 
        document.getElementById("jxgForm").reset();
 
    };
 
</script>
 
 
</body>
 
</body>
 
</html>
 
</html>
 +
  
 
{{Display}}
 
{{Display}}

Version vom 13. September 2017, 14:52 Uhr

mit Gitter

\(x(t)=A_1\cdot cos\Big(2\pi f_1\cdot t- \frac{2\pi}{360}\cdot \phi_1\Big)+A_2\cdot cos\Big(2\pi f_2\cdot t- \frac{2\pi}{360}\cdot \phi_2\Big)\)