import%20marimo%0A%0A__generated_with%20%3D%20%220.14.10%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20from%20marimo%20import%20md%0A%20%20%20%20return%20(md%2C)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20from%20sympy%20import%20simplify%2C%20expand%2C%20dsolve%2C%20Function%20%2C%20Derivative%2C%20Eq%2C%20sqrt%2C%20sin%2C%20cos%2C%20I%2C%20exp%2C%20pi%2C%20%5C%0A%20%20%20%20%20%20%20%20expand_power_exp%2C%20symbols%2C%20integrate%2C%20oo%2C%20diff%2C%20powsimp%2C%20solveset%2C%20solve%0A%20%20%20%20from%20sympy.abc%20import%20k%2CA%2CB%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20Derivative%2C%0A%20%20%20%20%20%20%20%20Eq%2C%0A%20%20%20%20%20%20%20%20Function%2C%0A%20%20%20%20%20%20%20%20I%2C%0A%20%20%20%20%20%20%20%20dsolve%2C%0A%20%20%20%20%20%20%20%20integrate%2C%0A%20%20%20%20%20%20%20%20simplify%2C%0A%20%20%20%20%20%20%20%20solve%2C%0A%20%20%20%20%20%20%20%20symbols%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell%0Adef%20_(symbols)%3A%0A%20%20%20%20x%2Ct%2Cm%2CE%20%3D%20symbols(%22x%20t%20m%20E%22%2C%20positive%3DTrue%2C%20real%3DTrue)%0A%20%20%20%20C3%2C%20k1%2C%20k2%20%3D%20symbols(%22C_3%20K_1%20K_2%22%2C%20real%3DTrue)%0A%20%20%20%20return%20k1%2C%20m%2C%20t%2C%20x%0A%0A%0A%40app.cell%0Adef%20_(symbols)%3A%0A%20%20%20%20hbar%20%3D%20symbols(%22hbar%22)%0A%20%20%20%20return%20(hbar%2C)%0A%0A%0A%40app.cell%0Adef%20_(Function)%3A%0A%20%20%20%20Psi%20%3D%20Function(%22Psi%22)%0A%20%20%20%20psi%20%3D%20Function(%22psi%22)%0A%20%20%20%20phi%3D%20Function(%22phi%22)%0A%20%20%20%20v%20%3D%20Function(%22V%22)%0A%20%20%20%20return%20Psi%2C%20phi%2C%20psi%2C%20v%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(md)%3A%0A%20%20%20%20md(%22%22%22%0A%20%20%20%20We%20start%20off%20with%20the%20Schr%C3%B6dinger%20Equation.%20%20The%20object%20is%20to%20solve%20this%20for%20the%20infinite%20square%20well.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(Derivative%2C%20Eq%2C%20I%2C%20Psi%2C%20hbar%2C%20m%2C%20t%2C%20v%2C%20x)%3A%0A%20%20%20%20schrodinger_eqn%20%3D%20Eq(I*hbar*Derivative(Psi(x%2Ct)%2Ct)%2C%20-hbar**2%2F(2*m)*Derivative(Psi(x%2Ct)%2Cx%2Cx)%20%2B%20Psi(x%2Ct)*v(x))%0A%20%20%20%20schrodinger_eqn%0A%20%20%20%20return%20(schrodinger_eqn%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(md)%3A%0A%20%20%20%20md(%22%22%22%0A%20%20%20%20%23%23%23%20Separation%20of%20variables%20%23%23%23%0A%0A%20%20%20%20We%20subsitute%20in%20%24%5CPsi(x%2Ct)%20%3D%20%5Cphi(x)%5Cpsi(t)%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Psi%2C%20phi%2C%20psi%2C%20schrodinger_eqn%2C%20t%2C%20x)%3A%0A%20%20%20%20psiphi_schrodinger_eqn%20%3D%20schrodinger_eqn.subs(Psi(x%2Ct)%2C%20psi(x)*phi(t)).doit()%0A%20%20%20%20psiphi_schrodinger_eqn%0A%20%20%20%20return%20(psiphi_schrodinger_eqn%2C)%0A%0A%0A%40app.cell%0Adef%20_(Eq%2C%20k1%2C%20phi%2C%20psi%2C%20psiphi_schrodinger_eqn%2C%20simplify%2C%20t%2C%20x)%3A%0A%20%20%20%20slhs%20%3D%20Eq(simplify(psiphi_schrodinger_eqn.args%5B0%5D%2F(phi(t)*psi(x)))%2C%20k1)%0A%20%20%20%20slhs%0A%20%20%20%20return%20(slhs%2C)%0A%0A%0A%40app.cell%0Adef%20_(integrate%2C%20k1%2C%20slhs%2C%20t)%3A%0A%20%20%20%20integral_lhs%20%3D%20integrate(slhs.lhs%20-%20k1%2C%20t)%0A%20%20%20%20integral_lhs%0A%20%20%20%20return%20(integral_lhs%2C)%0A%0A%0A%40app.cell%0Adef%20_(integral_lhs%2C%20phi%2C%20solve%2C%20t)%3A%0A%20%20%20%20phi_t%20%3D%20solve(integral_lhs%2C%20phi(t))%5B0%5D%0A%20%20%20%20phi_t%0A%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(psiphi_schrodinger_eqn)%3A%0A%20%20%20%20srhs%20%3D%20psiphi_schrodinger_eqn.args%5B1%5D%0A%20%20%20%20srhs%0A%20%20%20%20return%20(srhs%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(md)%3A%0A%20%20%20%20md(%22In%20the%20case%20of%20the%20Infinite%20Square%20well%20we%20set%20V(x)%20%3D%200%20in%20the%20region%20inside%20the%20well%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(k1%2C%20phi%2C%20psi%2C%20simplify%2C%20srhs%2C%20t%2C%20v%2C%20x)%3A%0A%20%20%20%20integrand_rhs%20%3D%20simplify(srhs.subs(v(x)%2C0)%2F(psi(x)*%20phi(t)))%20-k1%0A%20%20%20%20integrand_rhs%0A%20%20%20%20return%20(integrand_rhs%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(dsolve%2C%20integrand_rhs%2C%20psi%2C%20x)%3A%0A%20%20%20%20psi_x_soln%20%3D%20dsolve(integrand_rhs%2Cpsi(x))%0A%20%20%20%20psi_x_soln%0A%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(md)%3A%0A%20%20%20%20md(r%22%22%22%0A%20%20%20%20Given%20that%20%24C%20e%5E%7Bi%5Ctheta%7D%20%3D%20C%20%5Ccos(%5Ctheta)%20%2B%20iC%20%5Csin(%5Ctheta)%20%5CRightarrow%20C_1%20e%5E%7Bi%5Ctheta%7D%20%2B%20C_2%20e%5E%7B-i%5Ctheta%7D%20%3D%20C_1%20%5Ccos(%5Ctheta)%20%2B%20i%20C_1%20%5Csin(%5Ctheta)%20%2B%20C_2%20%5Ccos(%5Ctheta)%20-%20i%20C_2%20%5Csin(%5Ctheta)%24%20%0A%0A%20%20%20%20Simplifying%20yields%20%24C_1%20e%5E%7Bi%5Ctheta%7D%20%2B%20C_2%20e%5E%7B-i%5Ctheta%7D%20%3D%20(C_1%2BC_2)%5Ccos(%5Ctheta)%20%2B%20i(C_1-C2)%5Csin(%5Ctheta)%24%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
43414e306b980f3137ecb59a46d0fd205ae71af40a11526e6ec6b4148a35264b