Solving Equations Symbolically in Python
Author: David Manuel
In this video, it is shown how to solve equations symbolically using Python and save the results as variables to use the results in furthur calculations. We also learn how to recognize when Python is giving a small imaginary part due to round off errors. The example given in the video solves a trigonometric equations, and it is shown how to convert the radian answers into degrees.
Transcript 04
Transcript 04
Exercises
Python Code:
from sympy import *
theta=symbols('theta')
LHS=50*tan(theta)-13.61/(cos(theta))**2
thsol=solve(LHS,theta)
angle1=re(thsol[2])
angle2=re(thsol[3])
print(angle1*180/pi.evalf(),angle2*180/pi.evalf())
Open Python Notebook File
