Python Forum
complex algebraic function simplify
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
complex algebraic function simplify
#1
import sympy

a=sympy.Symbol('a')
C=sympy.Symbol('C')
t=sympy.Symbol('t')
E=sympy.Symbol('E')
R1=sympy.Symbol('R1')
R2=sympy.Symbol('R2')
i=sympy.Symbol('i')

i=E/(R1+1/(R2+a*i*t/(C-i)))
res=sympy.solve(i,t)
print(res)
i dont have result from res, is it because i is on both sides of the equation?
is there any other way to have a result of i=f(t)
Thank you!!!
Reply
#2
Use an expression that must be zero in solve() as the docstrings says
>>> import sympy
>>> a, C, t, E, R1, R2, i = sympy.symbols("a, C, t, E, R1, R2, i")
>>> a
a
>>> C
C
>>> z = i - E/(R1 + 1/(R2 + a * i * t / (C-i)))                                              
>>> sympy.solve(z, t)                                                                        
[(C - i)*(-E*R2 + R1*R2*i + i)/(a*i*(E - R1*i))]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trouble with creating a looping function in python 2.7 (complex) Afterdarkreader 3 3,060 Dec-12-2017, 06:56 PM
Last Post: Afterdarkreader

Forum Jump:

User Panel Messages

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