{ "metadata": { "language_info": { "codemirror_mode": { "name": "python", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8" }, "kernelspec": { "name": "python", "display_name": "Python (Pyodide)", "language": "python" } }, "nbformat_minor": 4, "nbformat": 4, "cells": [ { "cell_type": "code", "source": "#Setting up the Python with SymPy \nimport sympy\nfrom sympy import * #Importing all\n\ne=1.602E-19\nme=9.1E-31\nh=6.626E-34\nc=3E8\nb=2.90E-3\nsigma=5.67E-8\n", "metadata": { "trusted": true }, "execution_count": 262, "outputs": [] }, { "cell_type": "code", "source": "#Jakou MAXIMÁLNÍ vlnovou délku musí mít světlo, aby došlo k fotoemisi na hliníku, jehož výstupní práce je WAl = 4,2 eV. Jakou rychlost budou mít fotoelektrony, použijeme-li k osvětlení elektromagnetické záření vlnové délky λ = 250 nm a jaké je potřebné brzdné napětí?\nW_eV=3.15\nlambda0=211E-9\n\nW=W_eV*e", "metadata": { "trusted": true }, "execution_count": 267, "outputs": [] }, { "cell_type": "code", "source": "lambda_max=c/(W/h)\nv= sqrt((2*(h*(c/lambda0) - W)) /me)\nU=(me*v**2)/(2*e)", "metadata": { "trusted": true }, "execution_count": 268, "outputs": [] }, { "cell_type": "code", "source": "pprint(lambda_max)\npprint(v)\npprint(U)\nprint(\"λ_max = %g\" % (lambda_max)+\" m\")\nprint(\"v = %g\" % (v)+\" m/s\")\nprint(\"U = %g\" % (U)+\" V\")", "metadata": { "trusted": true }, "execution_count": 269, "outputs": [ { "name": "stdout", "text": "3.9391237144046135e-07\n980530.589776592\n2.73068232245239\nλ_max = 3.93912e-07 m\nv = 980531 m/s\nU = 2.73068 V\n", "output_type": "stream" } ] }, { "cell_type": "code", "source": "# Vlnová délka, na kterou připadá maximum vyzářené energie hvězdy, je 90 nm. Určete intenzitu vyzařování a teplotu hvězdy\n\nlambda0=90E-9", "metadata": { "trusted": true }, "execution_count": 287, "outputs": [] }, { "cell_type": "code", "source": "T=b/lambda0\nM=sigma*T**4", "metadata": { "trusted": true }, "execution_count": 288, "outputs": [] }, { "cell_type": "code", "source": "print(\"T = %g\" % (T)+\" K\")\nprint(\"M = %g\" % (M)+\" W/m2\")", "metadata": { "trusted": true }, "execution_count": 289, "outputs": [ { "name": "stdout", "text": "T = 32222.2 K\nM = 6.1123e+10 W/m2\n", "output_type": "stream" } ] }, { "cell_type": "code", "source": "# Za příznivých okolností může lidské oko registrovat 10–18 J elektromagnetické energie. Vypočítejte, kolik to představuje fotonů vlnové délky 600 nm?\nlambda0=600E-9\nE=10E-18\n\nN=E/(h*(c/lambda0))", "metadata": { "trusted": true }, "execution_count": 293, "outputs": [] }, { "cell_type": "code", "source": "print(\"N = %g\" % (N)+\" fotonu\")", "metadata": { "trusted": true }, "execution_count": 294, "outputs": [ { "name": "stdout", "text": "N = 30.1841 fotonu\n", "output_type": "stream" } ] }, { "cell_type": "code", "source": "from IPython.display import display, Latex\nfrom sympy import *\n\nx = symbols('x')\ndisplay(x)\n\nint_x = Integral(cos(x)*exp(x), x)\nresult = \"$${} = {}$$\".format(latex(int_x), latex(int_x.doit()))\ndisplay(Latex(result))\n\nderv_x = Derivative(cos(x)*exp(x), x)\nresult = \"$${} = {}$$\".format(latex(derv_x), latex(derv_x.doit()))\ndisplay(Latex(result))", "metadata": { "trusted": true }, "execution_count": 261, "outputs": [ { "output_type": "display_data", "data": { "text/plain": "x", "text/latex": "$\\displaystyle x$" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": "", "text/latex": "$$\\int e^{x} \\cos{\\left(x \\right)}\\, dx = \\frac{e^{x} \\sin{\\left(x \\right)}}{2} + \\frac{e^{x} \\cos{\\left(x \\right)}}{2}$$" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": "", "text/latex": "$$\\frac{d}{d x} e^{x} \\cos{\\left(x \\right)} = - e^{x} \\sin{\\left(x \\right)} + e^{x} \\cos{\\left(x \\right)}$$" }, "metadata": {} } ] }, { "cell_type": "code", "source": "", "metadata": {}, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": "", "metadata": {}, "execution_count": null, "outputs": [] } ] }