{"id":44810,"date":"2026-03-24T20:04:36","date_gmt":"2026-03-24T12:04:36","guid":{"rendered":"https:\/\/www.qiusir.com\/?p=44810"},"modified":"2026-04-03T11:42:53","modified_gmt":"2026-04-03T03:42:53","slug":"qiutopia%e7%90%86%e6%83%b3%e6%b0%94%e4%bd%93%e5%8e%8b%e5%bc%ba%e6%a8%a1%e6%8b%9f%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.qiusir.com\/?p=44810","title":{"rendered":"qiutopIA\u6c14\u4f53\u538b\u5f3a\u6a21\u62df"},"content":{"rendered":"\r\n<div id=\"qiusir-gas-lab-v4\" style=\"box-sizing: border-box; background: #ffffff; color: #1e293b; padding: 20px; border: 1px solid #e2e8f0; border-radius: 12px; font-family: -apple-system, sans-serif; max-width: 1000px; margin: 20px auto;\">\r\n    <style>\r\n        #qiusir-gas-lab-v4 *, #qiusir-gas-lab-v4 *:before, #qiusir-gas-lab-v4 *:after { box-sizing: inherit; }\r\n        #qiusir-gas-lab-v4 .layout-stack { display: flex; flex-direction: column; gap: 20px; }\r\n        #qiusir-gas-lab-v4 canvas { width: 100%; display: block; background: #f8fafc; border: 1.5px solid #cbd5e1; border-radius: 8px; }\r\n        #qiusir-gas-lab-v4 .control-bar { background: #f1f5f9; padding: 20px; border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }\r\n        #qiusir-gas-lab-v4 .data-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; align-items: stretch; }\r\n        #qiusir-gas-lab-v4 .card { border: 1px solid #e2e8f0; padding: 15px; border-radius: 8px; background: #ffffff; display: flex; flex-direction: column; justify-content: center; }\r\n        #qiusir-gas-lab-v4 .p-val { font-family: 'Courier New', monospace; font-size: 3.2rem; font-weight: 800; color: #2563eb; line-height: 1; margin: 10px 0; }\r\n        #qiusir-gas-lab-v4 input[type=range] { width: 100%; cursor: pointer; margin-top: 8px; accent-color: #2563eb; }\r\n        #qiusir-gas-lab-v4 .label-text { font-size: 0.9rem; font-weight: 600; color: #64748b; display: flex; justify-content: space-between; }\r\n    <\/style>\r\n\r\n    <div style=\"border-bottom: 2px solid #f8fafc; margin-bottom: 20px; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline;\">\r\n        <h2 style=\"margin: 0; font-size: 1.5rem; color: #0f172a;\">\u6c14\u4f53\u538b\u5f3a\u6a21\u62df <span style=\"font-weight: 400; color: #94a3b8; font-size: 1rem;\">qiutopIA<\/span><\/h2>\r\n        <div style=\"font-size: 0.85rem; color: #64748b; font-style: italic;\">$P = \\frac{1}{3}\\frac{N}{V}m\\bar{v^2}$<\/div>\r\n    <\/div>\r\n\r\n    <div class=\"layout-stack\">\r\n        <canvas id=\"qiusirMainCanvas\" style=\"height: 480px;\"><\/canvas>\r\n\r\n        <div class=\"data-grid\">\r\n            <div class=\"card\" style=\"border-left: 5px solid #2563eb;\">\r\n                <div style=\"font-size: 0.75rem; color: #94a3b8; text-transform: uppercase;\">\u5b9e\u65f6\u538b\u5f3a P<\/div>\r\n                <div id=\"qiusirPShow\" class=\"p-val\">0.00<\/div>\r\n                <div style=\"font-size: 0.7rem; color: #94a3b8;\">Unit: Relative Momentum \/ Area<\/div>\r\n            <\/div>\r\n            <div class=\"card\" style=\"padding: 5px; min-height: 140px;\">\r\n                <canvas id=\"qiusirPTCanvas\" style=\"height: 100%; border: none; background: transparent;\"><\/canvas>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"control-bar\">\r\n            <div>\r\n                <div class=\"label-text\">\r\n                    <span>\u5206\u5b50\u5bc6\u5ea6 (Count)<\/span>\r\n                    <span id=\"qiusirNLab\" style=\"color: #2563eb;\">100<\/span>\r\n                <\/div>\r\n                <input type=\"range\" id=\"qiusirNInput\" min=\"20\" max=\"400\" value=\"100\">\r\n            <\/div>\r\n            <div>\r\n                <div class=\"label-text\">\r\n                    <span>\u5e73\u5747\u901f\u7387 (Speed)<\/span>\r\n                    <span id=\"qiusirVLab\" style=\"color: #2563eb;\">5.0<\/span>\r\n                <\/div>\r\n                <input type=\"range\" id=\"qiusirVInput\" min=\"1\" max=\"15\" step=\"0.5\" value=\"5\">\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <button id=\"qiusirClearBtn\" style=\"width: 100%; padding: 10px; background: #1e293b; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 600;\">\r\n            \u6e05\u9664\u7edf\u8ba1\u6570\u636e\u91cd\u7f6e\u66f2\u7ebf\r\n        <\/button>\r\n    <\/div>\r\n\r\n    <script>\r\n    (function() {\r\n        const root = document.getElementById('qiusir-gas-lab-v4');\r\n        const mainC = root.querySelector('#qiusirMainCanvas');\r\n        const ptC = root.querySelector('#qiusirPTCanvas');\r\n        const mCtx = mainC.getContext('2d');\r\n        const pCtx = ptC.getContext('2d');\r\n\r\n        let atoms = [];\r\n        let momentumSum = 0;\r\n        let history = [];\r\n        const limit = 120;\r\n\r\n        const opt = { n: 100, v: 5, r: 4 };\r\n\r\n        function adapt() {\r\n            mainC.width = mainC.offsetWidth;\r\n            mainC.height = mainC.offsetHeight;\r\n            ptC.width = ptC.offsetWidth;\r\n            ptC.height = ptC.offsetHeight;\r\n        }\r\n\r\n        class Atom {\r\n            constructor() { this.init(); }\r\n            init() {\r\n                this.x = Math.random() * (mainC.width - opt.r * 2) + opt.r;\r\n                this.y = Math.random() * (mainC.height - opt.r * 2) + opt.r;\r\n                const a = Math.random() * Math.PI * 2;\r\n                this.vx = Math.cos(a) * opt.v;\r\n                this.vy = Math.sin(a) * opt.v;\r\n            }\r\n            step() {\r\n                this.x += this.vx;\r\n                this.y += this.vy;\r\n\r\n                \/\/ \u8fb9\u754c\u68c0\u6d4b\uff1a\u5b8c\u5168\u6d88\u9664 && \u548c ||\r\n                if (this.x < opt.r) {\r\n                    this.x = opt.r;\r\n                    momentumSum += Math.abs(this.vx * 2);\r\n                    this.vx *= -1;\r\n                } else {\r\n                    if (this.x > mainC.width - opt.r) {\r\n                        this.x = mainC.width - opt.r;\r\n                        momentumSum += Math.abs(this.vx * 2);\r\n                        this.vx *= -1;\r\n                    }\r\n                }\r\n\r\n                if (this.y < opt.r) {\r\n                    this.y = opt.r;\r\n                    momentumSum += Math.abs(this.vy * 2);\r\n                    this.vy *= -1;\r\n                } else {\r\n                    if (this.y > mainC.height - opt.r) {\r\n                        this.y = mainC.height - opt.r;\r\n                        momentumSum += Math.abs(this.vy * 2);\r\n                        this.vy *= -1;\r\n                    }\r\n                }\r\n            }\r\n            draw() {\r\n                mCtx.beginPath();\r\n                mCtx.arc(this.x, this.y, opt.r, 0, Math.PI * 2);\r\n                mCtx.fillStyle = '#3b82f6';\r\n                mCtx.fill();\r\n            }\r\n        }\r\n\r\n        function populate() {\r\n            atoms = [];\r\n            for(let i=0; i<opt.n; i++) atoms.push(new Atom());\r\n        }\r\n\r\n        \/\/ \u4ea4\u4e92\u903b\u8f91\r\n        root.querySelector('#qiusirNInput').oninput = function() {\r\n            opt.n = parseInt(this.value);\r\n            root.querySelector('#qiusirNLab').innerText = opt.n;\r\n            populate();\r\n        };\r\n\r\n        root.querySelector('#qiusirVInput').oninput = function() {\r\n            opt.v = parseFloat(this.value);\r\n            root.querySelector('#qiusirVLab').innerText = opt.v.toFixed(1);\r\n            atoms.forEach(a => {\r\n                let s = Math.sqrt(a.vx*a.vx + a.vy*a.vy);\r\n                if (s > 0) {\r\n                    a.vx = (a.vx\/s) * opt.v;\r\n                    a.vy = (a.vy\/s) * opt.v;\r\n                } else {\r\n                    a.init();\r\n                }\r\n            });\r\n        };\r\n\r\n        root.querySelector('#qiusirClearBtn').onclick = function() {\r\n            history = [];\r\n            momentumSum = 0;\r\n        };\r\n\r\n        let lastT = Date.now();\r\n        function render() {\r\n            mCtx.clearRect(0, 0, mainC.width, mainC.height);\r\n            atoms.forEach(a => { a.step(); a.draw(); });\r\n\r\n            let perim = 2 * (mainC.width + mainC.height);\r\n            let pNow = (momentumSum \/ perim) * 12;\r\n            momentumSum *= 0.94; \/\/ \u5e73\u6ed1\u8870\u51cf\r\n\r\n            root.querySelector('#qiusirPShow').innerText = pNow.toFixed(2);\r\n\r\n            let now = Date.now();\r\n            if (now - lastT > 100) {\r\n                history.push(pNow);\r\n                if (history.length > limit) history.shift();\r\n                lastT = now;\r\n            }\r\n\r\n            drawPlot();\r\n            requestAnimationFrame(render);\r\n        }\r\n\r\n        function drawPlot() {\r\n            pCtx.clearRect(0, 0, ptC.width, ptC.height);\r\n            if (history.length < 2) return;\r\n            pCtx.beginPath();\r\n            pCtx.strokeStyle = '#2563eb';\r\n            pCtx.lineWidth = 2.5;\r\n            let step = ptC.width \/ (limit - 1);\r\n            history.forEach((v, i) => {\r\n                let x = i * step;\r\n                let y = ptC.height - (v * 5) - 10;\r\n                if (i === 0) pCtx.moveTo(x, y);\r\n                else pCtx.lineTo(x, y);\r\n            });\r\n            pCtx.stroke();\r\n        }\r\n\r\n        const observer = new ResizeObserver(adapt);\r\n        observer.observe(mainC);\r\n\r\n        adapt();\r\n        populate();\r\n        render();\r\n    })();\r\n    <\/script>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>\u6c14\u4f53\u538b\u5f3a\u6a21\u62df qiutopIA $P = \\frac{1}{3}\\frac{N}{V}m\\bar{v^2}$  &#8230; <a title=\"qiutopIA\u6c14\u4f53\u538b\u5f3a\u6a21\u62df\" class=\"read-more\" href=\"https:\/\/www.qiusir.com\/?p=44810\" aria-label=\"\u9605\u8bfb qiutopIA\u6c14\u4f53\u538b\u5f3a\u6a21\u62df\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[443,247],"class_list":["post-44810","post","type-post","status-publish","format-standard","hentry","category-physics","tag-ai","tag-physics"],"_links":{"self":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/44810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=44810"}],"version-history":[{"count":15,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/44810\/revisions"}],"predecessor-version":[{"id":44900,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=\/wp\/v2\/posts\/44810\/revisions\/44900"}],"wp:attachment":[{"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=44810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=44810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qiusir.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=44810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}