```python
from sympy import *
i, b_L, b_0, h, N = symbols('i b_L b_0 h N')
L = N*h
x_i = i*h
u_i = -x_i**2 + (b_L + 2*L)*x_i + b_0
u_im1 = u_i.subs(i, i-1)
u_ip1 = u_i.subs(i, i+1)

# General equation
R = 1/h**2*(-u_im1 + 2*u_i - u_ip1) - 2
print(R)
R = simplify(R)
print(R)

# Right boundary equation
R = 1/h**2*(-u_im1 + u_i) - b_L/h - 1
R = R.subs(i, N)
print(R)
R = simplify(R)
print(R)
```

    -2 + (-2*h**2*i**2 + h**2*(i - 1)**2 + h**2*(i + 1)**2 + 2*h*i*(2*N*h + b_L) - h*(i - 1)*(2*N*h + b_L) - h*(i + 1)*(2*N*h + b_L))/h**2
    0
    -b_L/h - 1 + (-N**2*h**2 + N*h*(2*N*h + b_L) + h**2*(N - 1)**2 - h*(N - 1)*(2*N*h + b_L))/h**2
    0



```python

```

2f3e7a5860e7ec6febc2975bcc43635e37768427
ipynb
Jupyter Notebook
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/EXAMPLES/FINITE_ELEMENTS/INTRO/SRC/36_SYMPY_BVP_EXACT.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/EXAMPLES/FINITE_ELEMENTS/INTRO/SRC/36_SYMPY_BVP_EXACT.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/EXAMPLES/FINITE_ELEMENTS/INTRO/SRC/36_SYMPY_BVP_EXACT.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
2022-02-09T15:41:33.000Z
2022-02-11T07:47:40.000Z
Qwen/Qwen-72B
1. YES
2. YES