{"id":296,"date":"2025-09-10T07:10:06","date_gmt":"2025-09-10T07:10:06","guid":{"rendered":"https:\/\/learn-by-animation.com\/?page_id=296"},"modified":"2025-09-10T08:18:22","modified_gmt":"2025-09-10T08:18:22","slug":"torricellis-theorem","status":"publish","type":"page","link":"https:\/\/learn-by-animation.com\/?page_id=296","title":{"rendered":"Torricelli&#8217;s Theorem"},"content":{"rendered":"\n<div class=\"torricelli-widget\">\n  <h2>Torricelli&#8217;s Theorem: Real-Life Interactive Example of Bernoulli\u2019s Principle for Velocity of Efflux<\/h2>\n\n  <div class=\"description\">\n    <p><strong>Real-Life Context:<\/strong> Torricelli&#8217;s theorem applies Bernoulli&#8217;s principle to calculate the speed of fluid flowing out of a small hole in a container, like water draining from a punctured bottle, a leaking tank, or even in fire hoses. It&#8217;s used in engineering for tank drainage times, irrigation systems, and understanding fluid jets.<\/p>\n    <p><strong>How to Interact:<\/strong> Adjust the sliders for fluid depth \\( h \\) (above the hole) and gravity \\( g \\). Watch the water jet animate with a parabolic trajectory, see the efflux velocity update, and observe the energy terms in the bar chart.<\/p>\n  <\/div>\n\n  <div>\n    <canvas id=\"tankCanvas\" width=\"600\" height=\"300\"><\/canvas>\n  <\/div>\n\n  <div class=\"bar-chart\">\n    <canvas id=\"barChart\"><\/canvas>\n  <\/div>\n  <p>Bar heights show potential energy converting to kinetic energy. Total remains constant.<\/p>\n\n  <div class=\"sliders\">\n    <div class=\"slider-container\">\n      <label>Depth <i>h<\/i> (m)<\/label><br>\n      <input type=\"range\" id=\"heightSlider\" min=\"0.5\" max=\"10\" value=\"2\" step=\"0.1\">\n      <span id=\"heightValue\">2.0<\/span>\n    <\/div>\n    <div class=\"slider-container\">\n      <label>Gravity <i>g<\/i> (m\/s\u00b2)<\/label><br>\n      <input type=\"range\" id=\"gravitySlider\" min=\"1\" max=\"20\" value=\"9.81\" step=\"0.1\">\n      <span id=\"gravityValue\">9.81<\/span>\n    <\/div>\n  <\/div>\n\n  <div class=\"equation\">\n    Torricelli: \\( v = \\sqrt{2gh} \\) = <span id=\"velocityDisplay\">0 m\/s<\/span><br>\n    Bernoulli: <span id=\"equationDisplay\">\u03c1gh = \u00bd\u03c1v\u00b2<\/span>\n  <\/div>\n\n  <div class=\"terms\">\n    <div class=\"term\">\n      <strong>Surface (Point 1)<\/strong><br>\n      Potential: <span id=\"potentialValue\">0 Pa<\/span><br>\n      Kinetic: ~0 Pa<br>\n      Pressure: Atm\n    <\/div>\n    <div class=\"term\">\n      <strong>Efflux (Point 2)<\/strong><br>\n      Potential: 0 Pa<br>\n      Kinetic: <span id=\"kineticValue\">0 Pa<\/span><br>\n      Pressure: Atm\n    <\/div>\n  <\/div>\n<\/div>\n\n<style>\n.torricelli-widget {\n  max-width: 900px;\n  margin: 0 auto;\n  padding: 20px;\n  background-color: #f9fafb;\n  border-radius: 10px;\n  box-shadow: 0 4px 12px rgba(0,0,0,.08);\n}\n.torricelli-widget h2 {\n  text-align: center;\n  margin-bottom: 15px;\n}\n.torricelli-widget canvas#tankCanvas {\n  display: block;\n  margin: 20px auto;\n  background-color: #e0f7fa;\n  border: 1px solid #ccc;\n}\n.torricelli-widget .sliders { margin: 20px 0; }\n.torricelli-widget .slider-container { margin: 10px 0; }\n.torricelli-widget .equation {\n  font-size: 1.1em;\n  margin: 20px 0;\n  text-align: center;\n}\n.torricelli-widget .terms {\n  display: flex;\n  justify-content: space-around;\n  margin: 20px 0;\n  flex-wrap: wrap;\n}\n.torricelli-widget .term {\n  text-align: center;\n  width: 45%;\n  margin-bottom: 10px;\n}\n.torricelli-widget .bar-chart {\n  max-width: 400px;\n  margin: 20px auto;\n}\n.torricelli-widget .description {\n  text-align: left;\n  margin: 20px 0;\n}\n<\/style>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js@4.4.4\/dist\/chart.umd.min.js\"><\/script>\n<script>\nconst rho = 1000;\nconst particles = [];\nconst heightSlider = document.getElementById('heightSlider');\nconst gravitySlider = document.getElementById('gravitySlider');\nconst heightValue = document.getElementById('heightValue');\nconst gravityValue = document.getElementById('gravityValue');\nconst velocityDisplay = document.getElementById('velocityDisplay');\nconst equationDisplay = document.getElementById('equationDisplay');\nconst potentialValue = document.getElementById('potentialValue');\nconst kineticValue = document.getElementById('kineticValue');\nconst canvas = document.getElementById('tankCanvas');\nconst ctx = canvas.getContext('2d');\nconst barChartCanvas = document.getElementById('barChart');\n\nconst barChart = new Chart(barChartCanvas, {\n  type: 'bar',\n  data: {\n    labels: ['Potential (Surface)', 'Kinetic (Efflux)'],\n    datasets: [{ data: [0, 0], backgroundColor: ['#ffce56', '#36a2eb'] }]\n  },\n  options: {\n    responsive: true,\n    plugins: { legend: { display: false } },\n    scales: { y: { beginAtZero: true, title: { display: true, text: 'Energy\/Volume (Pa)' } } }\n  }\n});\n\nclass Particle {\n  constructor(x,y,vx,vy){ this.x=x; this.y=y; this.vx=vx; this.vy=vy; }\n  update(g){ this.x+=this.vx; this.y+=this.vy; this.vy+=g\/30;\n    if(this.y>canvas.height||this.x>canvas.width) this.reset(); }\n  draw(){ ctx.beginPath(); ctx.arc(this.x,this.y,2,0,2*Math.PI);\n    ctx.fillStyle='#0077ff'; ctx.fill(); }\n  reset(){ this.x=150; this.y=canvas.height-50; this.vy=0; }\n}\nfor(let i=0;i<50;i++){ particles.push(new Particle(150,canvas.height-50,0,0)); }\n\nlet currentV=Math.sqrt(2*9.81*2), currentG=9.81;\n\nfunction drawTank(h){\n  ctx.clearRect(0,0,canvas.width,canvas.height);\n  ctx.fillStyle='#ccc';\n  ctx.fillRect(50,50,100,canvas.height-100);\n  const waterHeight=(h\/10)*(canvas.height-150);\n  ctx.fillStyle='#add8e6';\n  ctx.fillRect(50,canvas.height-50-waterHeight,100,waterHeight);\n  ctx.fillStyle='#000';\n  ctx.fillRect(150,canvas.height-55,10,10);\n}\nfunction animate(){\n  drawTank(parseFloat(heightSlider.value));\n  particles.forEach(p=>{ p.vx=currentV\/10; p.update(currentG); p.draw(); });\n  requestAnimationFrame(animate);\n}\nanimate();\n\nfunction update(){\n  const h=parseFloat(heightSlider.value);\n  const g=parseFloat(gravitySlider.value);\n  const v=Math.sqrt(2*g*h);\n  const potential=rho*g*h;\n  const kinetic=0.5*rho*v*v;\n  heightValue.textContent=h.toFixed(1);\n  gravityValue.textContent=g.toFixed(2);\n  velocityDisplay.textContent=v.toFixed(2)+' m\/s';\n  equationDisplay.innerHTML=`\u03c1gh = \u00bd\u03c1v\u00b2 \u2248 ${potential.toFixed(0)} Pa`;\n  potentialValue.textContent=potential.toFixed(0)+' Pa';\n  kineticValue.textContent=kinetic.toFixed(0)+' Pa';\n  barChart.data.datasets[0].data=[potential,kinetic]; barChart.update();\n  currentV=v; currentG=g\/30;\n}\nupdate();\nheightSlider.addEventListener('input',update);\ngravitySlider.addEventListener('input',update);\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>Torricelli&#8217;s Theorem: Real-Life Interactive Example of Bernoulli\u2019s Principle for Velocity of Efflux Real-Life Context: Torricelli&#8217;s theorem applies Bernoulli&#8217;s principle to calculate the speed of fluid flowing out of a small hole in a container, like water draining from a punctured bottle, a leaking tank, or even in fire hoses. It&#8217;s used in engineering for tank [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-296","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/pages\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296"}],"version-history":[{"count":2,"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/pages\/296\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=\/wp\/v2\/pages\/296\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/learn-by-animation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}