Редактирование: Цилиндр и наклонная плоскость (48.29)

Перейти к: навигация, поиск

Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.

Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия Ваш текст
Строка 5: Строка 5:
 
Используем уравнение Лагранжа 2-го рода:
 
Используем уравнение Лагранжа 2-го рода:
  
<math>\frac{d}{dt}\left(\frac{\partial L}{\partial\dot q_i}\right) - \frac{\partial L}{\partial q_i} = Q ,  (i = 1,2)</math> , где
+
<math>\frac{d}{dt}\left(\frac{\partial L}{\partial\dot q_i}\right) - \frac{\partial L}{\partial q_i} = 0 ,  (i = 1,2)</math> , где
 
  L = T - П - функция Лагранжа
 
  L = T - П - функция Лагранжа
 
  T - кинетическая энергия системы
 
  T - кинетическая энергия системы
 
  П - потенциальная энергия системы
 
  П - потенциальная энергия системы
 
  q - независимые обобщенные координаты
 
  q - независимые обобщенные координаты
Q - непотенциальная обобщённая сила
+
 
 
В данной задаче в качестве обобщенных координат примем изменяющиеся координату призмы <math>x</math> и координату цилиндра <math>c</math> по оси, направленной вдоль наклонной плоскости <math>\varphi </math>.
 
В данной задаче в качестве обобщенных координат примем изменяющиеся координату призмы <math>x</math> и координату цилиндра <math>c</math> по оси, направленной вдоль наклонной плоскости <math>\varphi </math>.
 
Представим:
 
Представим:
Строка 16: Строка 16:
 
<math>T = T_1+T_2</math>, где <math>T_1</math> - кинетическая энергия катка массы <math>m_1</math>, а <math>Т_2</math> - треугольной призмы массы <math>m</math>.
 
<math>T = T_1+T_2</math>, где <math>T_1</math> - кинетическая энергия катка массы <math>m_1</math>, а <math>Т_2</math> - треугольной призмы массы <math>m</math>.
  
Треугольная призма откатывается вдоль оси <math>x</math>, следовательно:
+
Треугольная призма откатывается вдоль оси <math>X</math>, следовательно:
  
<math>T_2 = \frac{1}{2}m\dot x^{2}</math>
+
<math>T_2 = \frac{1}{2}MR^{2}\dot x</math>
  
 
Движение цилиндра массы <math>m_1</math> плоское.
 
Движение цилиндра массы <math>m_1</math> плоское.
Строка 26: Строка 26:
 
Где <math>V_с</math> - абсолютная скорость центра масс цилиндра массой <math>m_1</math>:
 
Где <math>V_с</math> - абсолютная скорость центра масс цилиндра массой <math>m_1</math>:
  
<math>V_c=  \dot S_c \cos\alpha - \dot x</math>
+
<math>V_c=  \dot S_c \cos - \dot x</math>
 
+
<math>ω= \frac{1}\dot S_c r </math>
<math> ω= \frac{1}{r}\dot S_c</math>
 
 
 
Здесь <math>\dot S_c </math> - относительная скорость
 
 
 
<math>T = T_1+T_2= \frac{1}{2}m\dot x^{2} +\frac{1}{2}m_1(\dot S_c \cos^{2}\alpha - \dot x)^{2}+\frac{1}{4}m_1\dot S_c^{2}</math>
 
 
 
Получаем два равенства, соответствующие двум уравнениям Лагранжа:
 
 
 
<math>m\ddot x -m_1(\ddot S_c \cos^{2}\alpha - \ddot x)=m_1g\cos\alpha\sin\alpha</math>
 
 
 
<math>m_1(\ddot S_c \cos^{2}\alpha - \ddot x)\cos^{2}\alpha+\frac{m_1}{2}\ddot S_c=m_1g\sin\alpha </math>
 
 
 
Откуда получаем:
 
 
 
<math>\ddot x=a=-g\frac{m_1\sin 2\alpha}{3(m+m_1)-2m_1\cos^{2}\alpha}</math>
 
 
 
==Реализация на JavaScript==
 
  
{{#widget:Iframe |url=http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy/n4829.html|width=800 |height=600|border=0 }}
+
{{#widget:Iframe |url=http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy/4829.html|width=760 |height=560|border=0 }}
  
 
== Разработка ==
 
== Разработка ==
Строка 55: Строка 38:
 
<syntaxhighlight lang="javascript" line start="1" enclose="div">
 
<syntaxhighlight lang="javascript" line start="1" enclose="div">
 
<!DOCTYPE html>
 
<!DOCTYPE html>
 
+
    <html>
<html>
+
    <head>
 
+
<title>4829</title>
<head>
 
    <title>4829</title>
 
 
     <script type="text/javascript" src="http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy\three.js"></script>
 
     <script type="text/javascript" src="http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy\three.js"></script>
 
     <script type="text/javascript" src="http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy\OBJLoader.js"></script>
 
     <script type="text/javascript" src="http://tm.spbstu.ru/htmlets/VaraevV/mesherskiy\OBJLoader.js"></script>
Строка 72: Строка 53:
 
        
 
        
 
     </style>
 
     </style>
</head>
+
    </head>
<body>
+
    <body>
  
<div id="Stats-output">
+
    <div id="Stats-output">
</div>
+
    </div>
  
<div id="WebGL-output">
+
    <div id="WebGL-output">
</div>
+
    </div>
  
  
<script type="text/javascript">
+
    <script type="text/javascript">
  
 
     $(function () {
 
     $(function () {
var a = 0;
+
var a = 0;
var g = 9.8;
+
var g = 9.8;
var m = 20;
+
var m = 20;
var m1 = 15;
+
var m1 = 15;
var stats = initStats();
+
var stats = initStats();
 
+
        var scene = new THREE.Scene();
        var scene = new THREE.Scene();
+
        var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
 
+
        var renderer = new THREE.WebGLRenderer();
        var camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
+
        renderer.setClearColor(new THREE.Color(0xEEEEEE, 1.0));
 
+
        renderer.setSize(window.innerWidth, window.innerHeight);
        var renderer = new THREE.WebGLRenderer();
+
        renderer.shadowMapEnabled = true;
 
+
var spotLight = new THREE.SpotLight( 0xffffff );
        renderer.setClearColor(new THREE.Color(0x7722ff, 1.0));
+
spotLight.position.set( -100, 0, -10 ); //-40, 60, -10
        renderer.setSize(window.innerWidth, window.innerHeight);
+
scene.add(spotLight );
        renderer.shadowMapEnabled = true;
 
<!-- var spotLight = new THREE.SpotLight( 0x00ff00 ); -->
 
<!-- spotLight.position.set( -1000, 0, -10 ); -->
 
<!-- scene.add(spotLight ); -->
 
 
var ugol= 135;
 
var ugol= 135;
 
var alpha0 = Math.cos(ugol*Math.PI/180);
 
var alpha0 = Math.cos(ugol*Math.PI/180);
Строка 113: Строка 90:
 
cube.position.z=0;
 
cube.position.z=0;
 
scene.add(cube);
 
scene.add(cube);
var cylinder1 = createMesh1(new THREE.CylinderGeometry(25, 25, 80, 25, 1));
+
var cylinder1 = createMesh1(new THREE.CylinderGeometry(25, 25, 60, 15, 1));
 
cylinder1.position.x=cube.position.x-400*Math.cos((180-ugol)*Math.PI/180)+25*Math.sin((180-ugol)*Math.PI/180);
 
cylinder1.position.x=cube.position.x-400*Math.cos((180-ugol)*Math.PI/180)+25*Math.sin((180-ugol)*Math.PI/180);
 
cylinder1.position.y=cube.position.y;
 
cylinder1.position.y=cube.position.y;
Строка 129: Строка 106:
 
 
 
function createMesh0(geom) {
 
function createMesh0(geom) {
            var meshMaterial = new THREE.MeshNormalMaterial( { color: 0x550000 } );
+
                  var meshMaterial = new THREE.MeshNormalMaterial();
            meshMaterial.side = THREE.DoubleSide;
+
                  meshMaterial.side = THREE.DoubleSide;
            var wireFrameMat = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
+
                  var wireFrameMat = new THREE.MeshBasicMaterial();
            wireFrameMat.wireframe = true;
+
                  wireFrameMat.wireframe = true;
            var plane = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial, wireFrameMat]);
+
                  var plane = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial, wireFrameMat]);
            return plane;
+
                  return plane;
        }
+
          }
        function createMesh(geom) {
+
            function createMesh(geom) {
            var meshMaterial = new THREE.MeshNormalMaterial( { color: 0xffffff } );
+
            var meshMaterial = new THREE.MeshNormalMaterial();
            meshMaterial.side = THREE.DoubleSide;
+
            meshMaterial.side = THREE.DoubleSide;
            var wireFrameMat = new THREE.MeshBasicMaterial( { color: 0x9999ff } );
+
            var wireFrameMat = new THREE.MeshBasicMaterial();
            wireFrameMat.wireframe = true;
+
            wireFrameMat.wireframe = true;
            var mesh = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial, wireFrameMat]);
+
            var mesh = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial, wireFrameMat]);
            return mesh;
+
            return mesh;
        }
+
            }
function createMesh1(geom) {
+
function createMesh1(geom) {
            var mat = new THREE.MeshNormalMaterial( { color: 0xffff00 } );
+
                        var mat = new THREE.MeshNormalMaterial();
var mesh = new THREE.Mesh(geom,mat);
+
var mesh = new THREE.Mesh(geom,mat);
return mesh;
+
return mesh;
        }
+
          }
  
        camera.position.x = 0;
+
        camera.position.x = 0;
        camera.position.y = -1300;
+
        camera.position.y = -1300;
        camera.position.z = 1500;
+
        camera.position.z = 1500;
        camera.lookAt(scene.position);
+
        camera.lookAt(scene.position);
  
$("#WebGL-output").append(renderer.domElement);
+
$("#WebGL-output").append(renderer.domElement);
renderer.render(scene, camera);
+
renderer.render(scene, camera);
var stats = initStats();
+
var stats = initStats();
cameraControls = new THREE.OrbitControls(camera, renderer.domElement);
+
cameraControls = new THREE.OrbitControls(camera, renderer.domElement);
cameraControls.maxDistance = 900;
+
cameraControls.maxDistance = 800;
cameraControls.minDistance = 0.5;
+
cameraControls.minDistance = 0.5;
cameraControls.update();
+
cameraControls.update();
var controls = new function() {
+
var controls = new function() {
this.Speed = 0.1;
+
this.Speed = 0.1;
this.ugol = 135;
+
this.ugol = 135;
this.m = 20;
+
this.m = 20;
this.m1 = 15;
+
this.m1 = 15;
this.a='0'
+
this.a='0'
        }
+
            }
var obj = { start_again:function(){  
+
var obj = { start_again:function(){  
step=0;
+
step=0;
cube.position.x=0;
+
cube.position.x=0;
cube.position.y=0;
+
cube.position.y=0;
cube.position.z=0;
+
cube.position.z=0;
cylinder1.position.x=cube.position.x-400*Math.cos((180-ugol)*Math.PI/180)+25*Math.sin((180-ugol)*Math.PI/180);
+
cylinder1.position.x=cube.position.x-400*Math.cos((180-ugol)*Math.PI/180)+25*Math.sin((180-ugol)*Math.PI/180);
cylinder1.position.y=cube.position.y;
+
cylinder1.position.y=cube.position.y;
cylinder1.position.z=cube.position.z+400*Math.sin((180-ugol)*Math.PI/180)+25*Math.cos((180-ugol)*Math.PI/180);
+
cylinder1.position.z=cube.position.z+400*Math.sin((180-ugol)*Math.PI/180)+25*Math.cos((180-ugol)*Math.PI/180);
group1.position.x = 0;
+
group1.position.x = 0;
group1.position.y = 0;
+
group1.position.y = 0;
group1.position.z=0;
+
group1.position.z=0;
}};
+
}};
var gui = new dat.GUI();
+
var gui = new dat.GUI();
gui.add(controls, 'Speed',0.1,0.3);
+
gui.add(controls, 'Speed',0,0.2);
gui.add(controls, 'ugol',89.9999,180);
+
gui.add(controls, 'ugol',89.9999,180);
gui.add(controls, 'm',0.1,50);
+
gui.add(controls, 'm',0.1,50);
gui.add(controls, 'm1',0.1,50);
+
gui.add(controls, 'm1',0.1,50);
gui.add(controls,'a').listen();
+
gui.add(controls,'a').listen();
gui.add(obj,'start_again');
+
gui.add(obj,'start_again');
var step = 0;
+
var step = 0;
function render() {
+
function render() {
cameraControls.update();
+
cameraControls.update();
requestAnimationFrame(render);
+
requestAnimationFrame(render);
renderer.render(scene, camera);
+
renderer.render(scene, camera);
step += controls.Speed
+
step += controls.Speed
ugol = controls.ugol
+
        ugol = controls.ugol
controls.a=a;
+
controls.a=a;
m = controls.m
+
m = controls.m
m1=controls.m1
+
m1=controls.m1
if(ugol<=135) {
+
if(ugol<=135) {
 
group1.rotation.y=Math.cos(ugol*Math.PI/180);
 
group1.rotation.y=Math.cos(ugol*Math.PI/180);
}
+
}
else {
+
else {
group1.rotation.y=Math.cos(ugol*Math.PI/180)+Math.cos((ugol-55)*Math.PI/180);
+
group1.rotation.y=Math.cos(ugol*Math.PI/180)+Math.cos((ugol-55)*Math.PI/180);
}
+
}
cylinder1.rotation.y = step*step;
+
cylinder1.rotation.y = step*step;
a = -(g*m1*Math.sin(2*(180-ugol)*Math.PI/180))/(3*(m1+m)-2*m1*((Math.cos((180-ugol)*Math.PI/180))*(Math.cos((180-ugol)*Math.PI/180))));  
+
  a = -(g*m1*Math.sin(2*(180-ugol)*Math.PI/180))/(3*(m1+m)-2*m1*((Math.cos((180-ugol)*Math.PI/180))*(Math.cos((180-ugol)*Math.PI/180))));
var v =0.65*a;
+
var v =0.6*a;
 
+
if (cylinder1.position.z<=25*Math.sin((180-ugol)*Math.PI/180)) {
if (cylinder1.position.z<=25*Math.sin((180-ugol)*Math.PI/180)) {
+
cylinder1.position.x = 25;  
cylinder1.position.x = 25;  
+
cylinder1.position.z = 25*Math.sin((180-ugol)*Math.PI/180);
cylinder1.position.z = 25*Math.sin((180-ugol)*Math.PI/180);
 
 
cylinder1.rotation.y = 0;
 
cylinder1.rotation.y = 0;
group1.position.x =group1.position.x+v;
+
group1.position.x =group1.position.x+v;  
if (group1.position.x<=-500) {
 
step=0;
 
cube.position.x=0;
 
cube.position.y=0;
 
cube.position.z=0;
 
cylinder1.position.x=cube.position.x-400*Math.cos((180-ugol)*Math.PI/180)+25*Math.sin((180-ugol)*Math.PI/180);
 
cylinder1.position.y=cube.position.y;
 
cylinder1.position.z=cube.position.z+400*Math.sin((180-ugol)*Math.PI/180)+25*Math.cos((180-ugol)*Math.PI/180);
 
group1.position.x = 0;
 
group1.position.y = 0;
 
group1.position.z=0;
 
}
 
 
}  
 
}  
 
else {  
 
else {  
group1.position.x = (a*step*step)/2;
+
  group1.position.x = (a*step*step)/2;
 
cylinder1.position.x=26;   
 
cylinder1.position.x=26;   
cylinder1.position.z=d-g*Math.sin((180-ugol)*Math.PI/180)*step*step/2;
+
cylinder1.position.z=d-g*Math.sin((180-ugol)*Math.PI/180)*step*step/2;
}  
+
}  
}  
+
}  
        render();
+
        render();
function initStats() {
+
function initStats() {
            var stats = new Stats();
+
            var stats = new Stats();
            stats.setMode(0); // 0: fps, 1: ms
+
            stats.setMode(0); // 0: fps, 1: ms
            stats.domElement.style.position = 'absolute';
+
            stats.domElement.style.position = 'absolute';
            stats.domElement.style.left = '0px';
+
            stats.domElement.style.left = '0px';
            stats.domElement.style.top = '0px';
+
            stats.domElement.style.top = '0px';
            $("#Stats-output").append(stats.domElement);
+
            $("#Stats-output").append(stats.domElement);
            return stats;
+
            return stats;
        }
+
          }
    });
+
    });
 
</script>
 
</script>
 
</body>
 
</body>
Вам запрещено изменять защиту статьи. Edit Создать редактором

Обратите внимание, что все добавления и изменения текста статьи рассматриваются как выпущенные на условиях лицензии Public Domain (см. Department of Theoretical and Applied Mechanics:Авторские права). Если вы не хотите, чтобы ваши тексты свободно распространялись и редактировались любым желающим, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений или скопировали их из источника, допускающего свободное распространение и изменение своего содержимого.
НЕ РАЗМЕЩАЙТЕ БЕЗ РАЗРЕШЕНИЯ МАТЕРИАЛЫ, ОХРАНЯЕМЫЕ АВТОРСКИМ ПРАВОМ!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Отменить | Справка по редактированию  (в новом окне)