Python Forum
Python sympy problem for symbolic equation definition
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python sympy problem for symbolic equation definition
#1
I have a problem forming a symbolic equation with the sympy command "sp.Eq()".I have an Excel sheet with equations formed by concatenation of cells as follow :

[Image: EQN1.jpg]

Then, an Excel concatenation is done to form the equation :

'+F_WORM_X*1+R_WORM_LOW_BEA_X*1+R_WORM_UP_BEA_X*1+F_WORM_FRIC_X*1'

So this Excel equation is put in a panda dataframe from the Excel sheet :

Quote:FBD_WORM_ = pd.read_excel("FUSION EPS_LOAD CASE_BIGBLUE_V03.xlsx", sheet_name = "FBD worm", )

And the symbolic equation is formed from the content of the dataframe :

Quote:EQ_W_1 = sp.Eq(FBD_WORM_.iloc[14, 3], 0)

It gives me a sympify error :

Quote:runfile('G:/Mon disque/2023-08-07/Nouveau classement/PROJETS/FUSION/LOAD CASES VS BIGBLUE/Fusion_Bearing Analysis_BiBlue Case_V03.py', wdir='G:/Mon disque/2023-08-07/Nouveau classement/PROJETS/FUSION/LOAD CASES VS BIGBLUE')Traceback (most recent call last):

File C:\ProgramData\anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File g:\mon disque\2023-08-07\nouveau classement\projets\fusion\load cases vs bigblue\fusion_bearing analysis_biblue case_v03.py:65 EQ_W_1 = sp.Eq(FBD_WORM_.iloc[14, 3], 0)

File C:\ProgramData\anaconda3\lib\site-packages\sympy\core\relational.py:626 in new lhs = _sympify(lhs)

File C:\ProgramData\anaconda3\lib\site-packages\sympy\core\sympify.py:529 in _sympify return sympify(a, strict=True)

File C:\ProgramData\anaconda3\lib\site-packages\sympy\core\sympify.py:450 in sympify raise SympifyError(a)

SympifyError: SympifyError: '+F_WORM_X1+R_WORM_LOW_BEA_X1+R_WORM_UP_BEA_X1+F_WORM_FRIC_X1'

Is it a bas equation formation?

It is not clear for me what is the problem with the equation?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Symplify symbolic expression Pavel_47 1 725 Oct-09-2023, 08:54 AM
Last Post: Pavel_47
  Build Lapalce symbolic expression from nominator/denominator arrays Pavel_47 0 870 Oct-07-2022, 01:35 PM
Last Post: Pavel_47
  Sympy nonlinsolve does not return explicit solution axelle 1 2,255 Jan-20-2021, 11:38 AM
Last Post: Serafim
  plot differential equation sympy dan_adi 0 3,017 Oct-13-2020, 10:44 AM
Last Post: dan_adi
  Attribute error - Sympy VictorG8 1 5,013 Apr-09-2020, 06:03 PM
Last Post: snippsat
  How to use list of symbols for sympy calculation in python? tanmaybhise 1 2,809 Mar-01-2020, 10:36 PM
Last Post: Gribouillis
  Next zero of a function on sympy VicenteM 0 2,092 Aug-21-2019, 04:58 PM
Last Post: VicenteM
  sympy psosmol 9 5,057 Mar-11-2019, 11:09 PM
Last Post: scidam
  How implement parametric ODE equation in python meesmaeili 1 2,221 Oct-16-2018, 01:39 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020