Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
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
Solved! Go to Solution.
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.
I have corrected it. Thanks a lot.
Here is my attempt
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..
Chad G. wrote:
Here is my attempt
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
My tired old eyes read your .5 as 5 earlier!
Mine too!
But at least I don't drool yet