Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'theta_A' is not defined #219

Open
k4sh4n1 opened this issue Sep 5, 2024 · 1 comment
Open

NameError: name 'theta_A' is not defined #219

k4sh4n1 opened this issue Sep 5, 2024 · 1 comment

Comments

@k4sh4n1
Copy link

k4sh4n1 commented Sep 5, 2024

I have these cells on a notebook:

import handcalcs.render
import forallpeople
forallpeople.environment('structural', top_level=True)
from sympy import *
%%render sympy
theta_A # Parameter
L # Parameter
Delta_B # Parameter

But I'm receiving this error:

NameError: name 'theta_A' is not defined

2024-09-05 07_36_53-lab (2) - JupyterLab - Opera

Question

Symbolic equations

I have studied this post: #22 (comment) But it's too complex.

I just simply want to display symbolic equations. How can I do that? I'm confused 😕

@Klummel69
Copy link

You should familiarize yourself with how sympy works. You must first assign sympy objects to the variables, e.g.

import sympy as sp
theta_A = sp.symbols("theta_A")
L = sp.symbols("L")
Delta_B = sp.symbols("Delta_B")

As described in the README of handcalcs, Sympy does not need handcalcs to render the equations. Only if the equations are to be calculated in handcalcs style at the end, handcalc makes sense.
See example in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants