发布作品
    快乐的山雀Y头像快乐的山雀Y头像

    快乐的山雀Y

    简介:菜鸟

    2001粉丝1关注6304获赞关注
    5天前

    有两天没来写了,主要是五一假期过后调整了下作息时间 闲暇之余写了个计算爬坡电机功率相关的,保存成html就可以在网页端使用了 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>电机功率计算</title> </head> <body>

    电机功率计算

    <form id="calcForm"> <label for="gearRatio">变速箱速比:</label> <input type="number" id="gearRatio" required>
    <label for="speed">车速:</label> <input type="number" id="speed" required>
    <label for="wheelDiameter">车轮直径:</label> <input type="number" id="wheelDiameter" required>
    <button type="button" onclick="calculate()">计算</button> </form>
    <script> function calculate() { const gearRatio = parseFloat(document.getElementById("gearRatio").value); const speed = parseFloat(document.getElementById("speed").value); const wheelDiameter = parseFloat(document.getElementById("wheelDiameter").value); // 计算电机转速 const motorSpeed = speed / gearRatio; // 计算转矩 const carWeight = parseFloat(prompt("请输入车重:")); const frictionCoefficient = parseFloat(prompt("请输入摩擦系数:")); const wheelRadius = wheelDiameter / 2; const torque = (carWeight * frictionCoefficient * 9.8 * wheelRadius) / (gearRatio * 0.95); // 计算电机功率 const motorPower = motorSpeed * torque / 9500; // 显示结果 document.getElementById("result").innerHTML = `电机转速:${motorSpeed} RPM
    转矩:${torque} N·m
    电机功率:${motorPower} W`; } </script> </body> </html>

    6天前
    快乐的山雀Y图1快乐的山雀Y图1
    04-23
    02-26
    2023-12-22
    老实人在职场混不下去的原因图1老实人在职场混不下去的原因图1
    2023-12-19
    没有更多了~