Created
March 29, 2024 22:19
-
-
Save DeflateAwning/2dd0d113518a7311b0fcf70e44a815e1 to your computer and use it in GitHub Desktop.
An example of using Sympy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import symbols, Eq, solve | |
# Define symbols | |
k1, k2, k3 = symbols('incoming_slope normal_slope outgoing_slope') | |
# Define the equation | |
equation = Eq((k1 - k2) / (1 + (k1*k2)), (k2 - k3) / (1 + (k2*k3))) | |
# Solve the equation for k3 | |
solution = solve(equation, k3) | |
print(solution) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment