Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Pe1bjt  
#1 Posted : 11 August 2023 21:47:51(UTC)
Pe1bjt

Rank: Newbie

Groups: Registered
Joined: 11/08/2023(UTC)
Posts: 1
Netherlands
Location: brabant

Hi guys,

I'm trying to plot a function that has the sigma operator in it.
I'm unable to do it with Smath.
I made a worksheet to demonstrate this issue.
It is a simple example that plots a square wave as function of the harmonics added to a sinusoidal wave.
First part is to show I plot a sinus function, which works just fine.
However when I try the square wave function with the summation operator in the function I does not work that way.
What I'm I doing wrong?

See attachment. square_wave.sm (10kb) downloaded 5 time(s).

Please help.
Best regards Sonya

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 11 August 2023 22:26:31(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. You are not doing nothing wrong, just SMath sometimes requires for some functions the line() instruction as a wrapper for delay de evaluations. And I don't know a general rule for that.

square_wave.sm (8kb) downloaded 20 time(s).

Clipboard01.png

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 12/08/2023(UTC)
Offline Jean Giraud  
#3 Posted : 12 August 2023 16:18:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Pe1bjt Go to Quoted Post
What I'm I doing wrong ?

Indirectly, the argument of Sum is over the vector xc.
If you vectorize that argument, no need local definition
Mesh finer xc for higher maximum.
By same token, your system is ordinary Fourier.
You may want experiment Fourier/Fejer/Lanczos.
Please, confirm it works.
Cheers ... Jean.

Fourier Fejer Lanczos.sm (12kb) downloaded 12 time(s).

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.