cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Symbolic trignometric functions

ChadG.
1-Newbie

Symbolic trignometric functions

How to tell the symbolic processor that n is an integer so while evaluating

cos((n+.5)* pi)==>0

and sin((n+.5)*pi)==>1

is there a way to force the symbolic process to do that once it sees these expressions it will just replace them with 0 or 1

The reason I am not using n as integer range is: this is part of a long calculation/derivation

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:ChadG.)

8 REPLIES 8

Chad G. wrote:

How to tell the symbolic processor that n is an integer so while evaluating

cos((n+.5)* pi)==>0

and sin((n+.5)*pi)==>1

is there a way to force the symbolic process to do that once it sees these expressions it will just replace them with 0 or 1

The reason I am not using n as integer range is: this is part of a long calculation/derivation

You might want to think more carefully about the values you've suggested for the cosines and sines! However, try using both the 'assume integer=n' and 'simplify' symbolic qualifiers.

Alan

Thanks Alan I did not know about that "how to use the qualifiers assume n=integer?"

You think there is something wrong mathematically!

Chad G. wrote:

You think there is something wrong mathematically!

Well, cos((n+5)*pi) is -(-1)^n when n is an integer and sin((n+5)*pi) is 0.

Alan

I just checked it. Thanks for the great observation. I am trying to use the same subroutines instead of rewriting them to set sines and cosines. On the other hand I could not figure how to tell Mathcad n is integer.

cos-sin.bmp

I have corrected it. Thanks a lot.

cos-sin-correct.bmp

Here is my attempt

symbolic-assume-integer.bmp

It would be better if we can sort of declare n is integer for all instead of having to declare it every time I do the symbolic process..

RichardJ
19-Tanzanite
(To:ChadG.)

Add a "simplify"

Chad G. wrote:

Here is my attempt

symbolic-assume-integer.bmp

It would be better if we can sort of declare n is integer for all instead of having to declare it every time I do the symbolic process..

My tired old eyes read your .5 as 5 earlier!

I'm not clear why you want to call the function every time anyway - why not just use 0 or 1 (though I notice your latest function is somewhat different - contains an n in the denominator)? Do you need to call it with non-integer values as well?

Also, why do you need a symbolic solution?

If you were to post a worksheet showing what you were really trying to do, we might be able to suggest something slicker (then again, we might not!).

Alan

RichardJ
19-Tanzanite
(To:AlanStevens)

My tired old eyes read your .5 as 5 earlier!

Mine too!

But at least I don't drool yet

Top Tags