{"id":857,"date":"2026-03-16T13:41:25","date_gmt":"2026-03-16T12:41:25","guid":{"rendered":"https:\/\/home.agh.edu.pl\/~robertb\/?page_id=857"},"modified":"2026-03-16T13:56:58","modified_gmt":"2026-03-16T12:56:58","slug":"moc-czynna-bierna-pozorna","status":"publish","type":"page","link":"https:\/\/home.agh.edu.pl\/~robertb\/moc-czynna-bierna-pozorna\/","title":{"rendered":"Moc czynna, bierna, pozorna"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"pl\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Analiza Mocy AC &#8211; 50 Hz<\/title>\n    <script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n    <style>\n        body {\n            background-color: #f8fafc;\n        }\n        .card {\n            background: white;\n            border-radius: 12px;\n            box-shadow: 0 4px 6px -1px rgb(0 0 0 \/ 0.1);\n            padding: 1.5rem;\n        }\n    <\/style>\n<\/head>\n<body class=\"p-4 md:p-8\">\n    <div class=\"max-w-6xl mx-auto\">\n        <header class=\"mb-8 text-center\">\n            <h1 class=\"text-3xl font-bold text-slate-800\">\u26a1 Symulator Mocy w Obwodzie AC<\/h1>\n            <p class=\"text-slate-600\">Analiza wp\u0142ywu przesuni\u0119cia fazowego przy cz\u0119stotliwo\u015bci 50 Hz<\/p>\n        <\/header>\n\n        <div class=\"grid grid-cols-1 lg:grid-cols-4 gap-6\">\n            <!-- Panel sterowania -->\n            <div class=\"lg:col-span-1 space-y-6\">\n                <div class=\"card\">\n                    <h2 class=\"text-xl font-semibold mb-4 border-b pb-2\">Parametry<\/h2>\n                    \n                    <div class=\"mb-6\">\n                        <label class=\"block text-sm font-medium text-slate-700 mb-2\">\n                            Napi\u0119cie skuteczne (U<sub>RMS<\/sub>): <span id=\"uVal\" class=\"font-bold text-blue-600\">230<\/span> V\n                        <\/label>\n                        <input type=\"range\" id=\"uRange\" min=\"10\" max=\"400\" value=\"230\" class=\"w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer\">\n                    <\/div>\n\n                    <div class=\"mb-6\">\n                        <label class=\"block text-sm font-medium text-slate-700 mb-2\">\n                            Nat\u0119\u017cenie skuteczne (I<sub>RMS<\/sub>): <span id=\"iVal\" class=\"font-bold text-green-600\">10<\/span> A\n                        <\/label>\n                        <input type=\"range\" id=\"iRange\" min=\"1\" max=\"50\" value=\"10\" class=\"w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer\">\n                    <\/div>\n\n                    <div class=\"mb-6\">\n                        <label class=\"block text-sm font-medium text-slate-700 mb-2\">\n                            Przesuni\u0119cie fazowe (\u03c6): <span id=\"phiVal\" class=\"font-bold text-orange-600\">45<\/span>\u00b0\n                        <\/label>\n                        <input type=\"range\" id=\"phiRange\" min=\"-90\" max=\"90\" value=\"45\" class=\"w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer\">\n                    <\/div>\n\n                    <div class=\"p-3 bg-slate-50 rounded-lg\">\n                        <p class=\"text-xs text-slate-500 uppercase font-bold mb-1\">Cz\u0119stotliwo\u015b\u0107 sta\u0142a<\/p>\n                        <p class=\"text-lg font-mono\">50.00 Hz<\/p>\n                    <\/div>\n                <\/div>\n\n                <div class=\"card bg-blue-50 border border-blue-100\">\n                    <h2 class=\"text-lg font-semibold mb-3\">Wyniki Oblicze\u0144<\/h2>\n                    <div class=\"space-y-3\">\n                        <div>\n                            <span class=\"text-sm text-slate-600\">Moc Czynna (P):<\/span>\n                            <div id=\"pRes\" class=\"text-xl font-bold text-slate-800\">0 W<\/div>\n                        <\/div>\n                        <div>\n                            <span class=\"text-sm text-slate-600\">Moc Bierna (Q):<\/span>\n                            <div id=\"qRes\" class=\"text-xl font-bold text-slate-800\">0 var<\/div>\n                        <\/div>\n                        <div>\n                            <span class=\"text-sm text-slate-600\">Moc Pozorna (S):<\/span>\n                            <div id=\"sRes\" class=\"text-xl font-bold text-slate-800\">0 VA<\/div>\n                        <\/div>\n                        <div class=\"pt-2 border-t border-blue-200\">\n                            <span class=\"text-sm text-slate-600 font-bold italic\">cos(\u03c6):<\/span>\n                            <span id=\"cosPhi\" class=\"text-lg font-bold ml-2\">1.000<\/span>\n                        <\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Wykresy -->\n            <div class=\"lg:col-span-3 space-y-6\">\n                <div class=\"card\">\n                    <h2 class=\"text-lg font-semibold mb-4 italic\">Przebiegi czasowe: u(t), i(t), p(t)<\/h2>\n                    <div class=\"h-80 w-full\">\n                        <canvas id=\"timeChart\"><\/canvas>\n                    <\/div>\n                <\/div>\n\n                <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n                    <div class=\"card\">\n                        <h2 class=\"text-lg font-semibold mb-4\">Tr\u00f3jk\u0105t Mocy<\/h2>\n                        <div class=\"h-64 flex items-center justify-center\">\n                            <canvas id=\"triangleChart\"><\/canvas>\n                        <\/div>\n                    <\/div>\n                    <div class=\"card flex flex-col justify-center\">\n                        <h2 class=\"text-lg font-semibold mb-2 text-slate-800\">Interpretacja Fizyczna<\/h2>\n                        <p id=\"explanation\" class=\"text-slate-600 text-sm leading-relaxed\">\n                            Przy obecnym przesuni\u0119ciu fazowym, cz\u0119\u015b\u0107 energii jest zwracana do \u017ar\u00f3d\u0142a w ka\u017cdym cyklu, co wida\u0107 jako ujemne warto\u015bci na wykresie mocy chwilowej (kolor \u017c\u00f3\u0142ty).\n                        <\/p>\n                    <\/div>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ Inicjalizacja sta\u0142ych\n        const F = 50;\n        const OMEGA = 2 * Math.PI * F;\n        const SAMPLES = 200;\n        const CYCLES = 2;\n        const T_MAX = CYCLES \/ F;\n\n        \/\/ Elementy DOM\n        const uRange = document.getElementById('uRange');\n        const iRange = document.getElementById('iRange');\n        const phiRange = document.getElementById('phiRange');\n        \n        const uValDisp = document.getElementById('uVal');\n        const iValDisp = document.getElementById('iVal');\n        const phiValDisp = document.getElementById('phiVal');\n\n        const pRes = document.getElementById('pRes');\n        const qRes = document.getElementById('qRes');\n        const sRes = document.getElementById('sRes');\n        const cosPhiDisp = document.getElementById('cosPhi');\n        const explanationDisp = document.getElementById('explanation');\n\n        let timeChart, triangleChart;\n\n        function initCharts() {\n            \/\/ Wsp\u00f3lna konfiguracja stylu legendy (linie zamiast kwadrat\u00f3w)\n            const legendLabelConfig = {\n                usePointStyle: true,\n                pointStyle: 'line'\n            };\n\n            const ctxTime = document.getElementById('timeChart').getContext('2d');\n            timeChart = new Chart(ctxTime, {\n                type: 'line',\n                data: {\n                    labels: Array.from({length: SAMPLES}, (_, i) => (i * T_MAX \/ SAMPLES).toFixed(4)),\n                    datasets: [\n                        { \n                            label: 'u(t) [V]', \n                            borderColor: '#3b82f6', \n                            data: [], \n                            borderWidth: 2, \n                            pointRadius: 0, \n                            yAxisID: 'y' \n                        },\n                        { \n                            label: 'i(t) x 10 [A]', \n                            borderColor: '#22c55e', \n                            data: [], \n                            borderWidth: 2, \n                            pointRadius: 0, \n                            borderDash: [5, 5], \n                            yAxisID: 'y' \n                        },\n                        { \n                            label: 'p(t) [W]', \n                            backgroundColor: 'rgba(234, 179, 8, 0.2)', \n                            fill: true, \n                            borderColor: '#eab308', \n                            data: [], \n                            borderWidth: 1, \n                            pointRadius: 0, \n                            yAxisID: 'yPower' \n                        }\n                    ]\n                },\n                options: {\n                    responsive: true,\n                    maintainAspectRatio: false,\n                    scales: {\n                        y: { type: 'linear', position: 'left', title: { display: true, text: 'Napi\u0119cie \/ Pr\u0105d (skalowany)' } },\n                        yPower: { type: 'linear', position: 'right', title: { display: true, text: 'Moc chwilowa (W)' }, grid: { drawOnChartArea: false } }\n                    },\n                    plugins: { \n                        legend: { \n                            position: 'bottom',\n                            labels: legendLabelConfig\n                        } \n                    }\n                }\n            });\n\n            const ctxTri = document.getElementById('triangleChart').getContext('2d');\n            triangleChart = new Chart(ctxTri, {\n                type: 'scatter',\n                data: {\n                    datasets: [{\n                        label: 'Wektor Mocy',\n                        data: [{x: 0, y: 0}, {x: 0, y: 0}],\n                        showLine: true,\n                        borderColor: '#6366f1',\n                        borderWidth: 3,\n                        pointBackgroundColor: '#6366f1'\n                    }]\n                },\n                options: {\n                    responsive: true,\n                    maintainAspectRatio: false,\n                    scales: {\n                        x: { min: 0, title: { display: true, text: 'P [W]' } },\n                        y: { title: { display: true, text: 'Q [var]' } }\n                    },\n                    plugins: { \n                        tooltip: { enabled: false },\n                        legend: {\n                            position: 'bottom',\n                            labels: legendLabelConfig\n                        }\n                    }\n                }\n            });\n        }\n\n        function update() {\n            const U_rms = parseFloat(uRange.value);\n            const I_rms = parseFloat(iRange.value);\n            const phi_deg = parseFloat(phiRange.value);\n            const phi_rad = (phi_deg * Math.PI) \/ 180;\n\n            uValDisp.innerText = U_rms;\n            iValDisp.innerText = I_rms;\n            phiValDisp.innerText = phi_deg;\n\n            const S = U_rms * I_rms;\n            const P = S * Math.cos(phi_rad);\n            const Q = S * Math.sin(phi_rad);\n            const cosPhi = Math.cos(phi_rad);\n\n            pRes.innerText = `${P.toFixed(1)} W`;\n            qRes.innerText = `${Q.toFixed(1)} var`;\n            sRes.innerText = `${S.toFixed(1)} VA`;\n            cosPhiDisp.innerText = cosPhi.toFixed(3);\n\n            const uData = [];\n            const iData = [];\n            const pData = [];\n            \n            const U_peak = U_rms * Math.sqrt(2);\n            const I_peak = I_rms * Math.sqrt(2);\n\n            for (let i = 0; i < SAMPLES; i++) {\n                const t = i * T_MAX \/ SAMPLES;\n                const ut = U_peak * Math.sin(OMEGA * t);\n                const it = I_peak * Math.sin(OMEGA * t - phi_rad);\n                uData.push(ut);\n                iData.push(it * 10);\n                pData.push(ut * it);\n            }\n\n            timeChart.data.datasets[0].data = uData;\n            timeChart.data.datasets[1].data = iData;\n            timeChart.data.datasets[2].data = pData;\n            timeChart.update('none');\n\n            triangleChart.data.datasets[0].data = [\n                {x: 0, y: 0}, \n                {x: P, y: Q}\n            ];\n            triangleChart.options.scales.x.max = S * 1.1;\n            triangleChart.options.scales.y.min = -S * 1.1;\n            triangleChart.options.scales.y.max = S * 1.1;\n            triangleChart.update('none');\n\n            let charType = phi_deg > 0 ? \"indukcyjny (op\u00f3\u017anienie pr\u0105du)\" : \"pojemno\u015bciowy (wyprzedzenie pr\u0105du)\";\n            if (phi_deg === 0) {\n                explanationDisp.innerText = \"Obci\u0105\u017cenie czysto rezystancyjne. Pr\u0105d i napi\u0119cie s\u0105 w fazie. Ca\u0142a energia jest dostarczana do odbiornika (P=S, Q=0).\";\n            } else if (Math.abs(phi_deg) === 90) {\n                explanationDisp.innerText = `Obci\u0105\u017cenie czysto ${phi_deg > 0 ? 'indukcyjne' : 'pojemno\u015bciowe'}. \u015arednia moc czynna wynosi 0 \u2013 energia tylko 'pulsuje' mi\u0119dzy \u017ar\u00f3d\u0142em a odbiornikiem.`;\n            } else {\n                explanationDisp.innerText = `Charakter ${charType}. Przy k\u0105cie ${phi_deg}\u00b0, wsp\u00f3\u0142czynnik mocy wynosi ${cosPhi.toFixed(2)}. Im ni\u017cszy cos(\u03c6), tym wi\u0119cej mocy biernej kr\u0105\u017cy w obwodzie.`;\n            }\n        }\n\n        [uRange, iRange, phiRange].forEach(el => el.addEventListener('input', update));\n\n        window.onload = () => {\n            initCharts();\n            update();\n        };\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Analiza Mocy AC &#8211; 50 Hz \u26a1 Symulator Mocy w Obwodzie AC Analiza wp\u0142ywu przesuni\u0119cia fazowego przy cz\u0119stotliwo\u015bci 50 Hz Parametry Napi\u0119cie skuteczne (URMS): 230 V Nat\u0119\u017cenie skuteczne (IRMS): 10 A Przesuni\u0119cie fazowe (\u03c6): 45\u00b0 Cz\u0119stotliwo\u015b\u0107 sta\u0142a 50.00 Hz Wyniki Oblicze\u0144 Moc Czynna (P): 0 W Moc Bierna (Q): 0 var Moc Pozorna (S): 0&hellip;&nbsp;<a href=\"https:\/\/home.agh.edu.pl\/~robertb\/moc-czynna-bierna-pozorna\/\" class=\"\" rel=\"bookmark\">Czytaj wi\u0119cej &raquo;<span class=\"screen-reader-text\">Moc czynna, bierna, pozorna<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"neve_meta_sidebar":"full-width","neve_meta_container":"","neve_meta_enable_content_width":"on","neve_meta_content_width":100,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_ti_tpc_template_sync":false,"_ti_tpc_template_id":"","footnotes":""},"class_list":["post-857","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/pages\/857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/comments?post=857"}],"version-history":[{"count":4,"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/pages\/857\/revisions"}],"predecessor-version":[{"id":864,"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/pages\/857\/revisions\/864"}],"wp:attachment":[{"href":"https:\/\/home.agh.edu.pl\/~robertb\/wp-json\/wp\/v2\/media?parent=857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}