TI-89 Programming: When Function Error

Thread Starter

Adanovinivici

Joined Sep 5, 2014
57
Hello All,

I'm trying to program a simple statement into my calculator to assign a function c(k) to cc(k) since the value of c(k) is undefined at 0, but the limit of c(k) as k approaches 0 is 1/2. However, the calculator keeps telling me I'm missing parentheses, even though the number of parenthesis facing right is equal to the number of parentheses facing left. I tried finding the solution on the internet, but I did not see a description of this specific problem. Could anyone help me out?

when(k=0, 1/2, c(k)-->cc(k))

Much Appreciated,
Adanovinivici
 

Papabravo

Joined Feb 24, 2006
21,228
I think your problem is the function assignment in the 'false part'. I think what it wants is an expression not an assignment. Can you provide the context for the when statement?
Isn't the when() statement is used in graphing, and in no other context.
 
Last edited:

Thread Starter

Adanovinivici

Joined Sep 5, 2014
57
I think your problems is the function assignment in the 'false part'. I think what it wants is an expression not an assignment. Can you provide the context for the when statement?
I'm creating a Fourier Series on the calculator using the exponential form Sum(-n,+n) Dn*e^-j*w0*t where w0 is the fundamental angular frequency and Sum is a sigma sign from -n to n. c(k) is equal to Dn=1/To * integral(-T0/2, T0/2) f(k)*e^-j*n*w0*t.

The main point of the statement is that Dn or c(k) at 0 is undefined so I have to take the limit at k=0, so I won't receive an error when I plot the function. By assigning c(k) to cc(k), I am left with a function without an undefined value at k=0.
 

Papabravo

Joined Feb 24, 2006
21,228
You missed entirely what I was asking. Do you understand the difference between an 'expression' and an 'assignment'?
Do I understand that cc(k) is a function that is the same as c(k), except that, unlike c(k), it is defined at k=0?
So the 'context' I was looking for is the complete definition of the function cc(k)
 

Thread Starter

Adanovinivici

Joined Sep 5, 2014
57
I think your problem is the function assignment in the 'false part'. I think what it wants is an expression not an assignment. Can you provide the context for the when statement?
Isn't the when() statement is used in graphing, and in no other context.
Thank you for the response . However, if I try to use an equal sign,
You missed entirely what I was asking. Do you understand the difference between an 'expression' and an 'assignment'?
Do I understand that cc(k) is a function that is the same as c(k), except that, unlike c(k), it is defined at k=0?
So the 'context' I was looking for is the complete definition of the function cc(k)
Alright then. cc(k) is the fourier series of a square wave in exponential form where cc(0)=1/2.
 

Papabravo

Joined Feb 24, 2006
21,228
The definition of the 'when' statement won't allow you to use an assignment statemnt in place of an expression. Some languages and compilers will let you do this an others won't. If I could see the entire multi-line definition of the function I might be able to help. Otherwise, I guess I'm done.
 
Top