No one is replying, lemme paste the code here:
import sympy as syms
import matplotlib.pyplot as plot
import numpy as linspace
n,t= syms.symbols('n,t')
T= 1
w= 2*syms.pi/T
V=1 # square wave of 1volts with 1second period
Ao= (w/syms.pi)* syms.integrate(V,(t,0,0.5))
An= (w/syms.pi)*syms.integrate(V*syms.cos(w*n*t),(t,0,T/2))
Bn= (w/syms.pi)*syms.integrate(V*syms.sin(w*n*t),(t,0,T/2))
f= Ao/2 +syms.Sum(An*syms.cos(n*w*t),(n,1,5))+
syms.Sum(Bn*syms.sin(n*w*t),(n,1,5))
f
syms.plot(f,(t,0,2*T))
On Friday, April 23, 2021 at 4:09:20 PM UTC+1 Areeb Sherjil wrote:
> Hi all,
> I hope everyone is enjoying themselves!
> I am trying to compute the Fourier series of a simple signal(1 Volt square
> with freq of 1hz and 0.5T pulse width).
>
> This is what I need help with:
> 1- How can I make sympy display the results of the sigma summation as :
> Ao+An1+An2+An3....... etc instead of the way it now?Like how do I expand it?
> 2- When I try to plot this, I get a warning message telling me to report
> this as a bug? Why is this ?(look at screenshot)
>
> Any response is very much appreciated
> All necessary file attached(CODE:
> https://drive.google.com/file/d/17W3GqiN0x1oByMdgAiZHssGNu2aCJdPV/view?usp=sharing
> )[image: Screenshot (286).png]
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/05c2fc4e-82a6-447f-aca3-3694af254938n%40googlegroups.com.