Skip to main content
1-Visitor
March 11, 2020
Solved

assuming variable as integer

  • March 11, 2020
  • 3 replies
  • 3007 views

i am working with fourier at the moment and when i assume n as integer is gives an error message, as seen in the photo linked

maggen_0-1583918299594.png

 

am i using this wrong or is it not able to apply to this. i know the answer is 2/(pi^2*n^2) but i would like to have mathcad solve it for me for other equations

 

Best answer by Werner_E

The "assume" modifier in Mathcads symbolic is quite weak and ever so often does not do what we expect.

 

But in your case it should work OK and actually it does for me. I tried with Prime 6 where PTC introduced a new symbolic engine and found that both, the old and the new engine, can successfully simplify your expression.

As you can see in the picture, the old engine needs to be told to simplify the result.

 

Its hard to debug just a picture so I can say what went wrong when you tried it. I would advice that you always attach your worksheet with your question and also state, which version of Prime you are using.
Did you try using a fresh worksheet without any definitions and calculations done above? Maybe something you assigned earlier (n?) is responsible for the error.

 

Here is the screenshot from Prime 6 using the new and also the old symbolic engine:

Werner_E_1-1583930077571.png

 

BTW, I would suggest to turn c.n into a function by typing c(n):=.... so you can use it in further calculations with variable values of n.

 

EDIT: I overlooked at first glance hat you wrote a boolean equal sign and not an assignment. But I just gave it a try and it still worked OK, so thats not the cause for the error.

3 replies

23-Emerald IV
March 11, 2020

The question is, I guess, what would you like Prime to do, other than assuming that n is a integer?

You are writing that cn is equal to this integral. Note! You are NOT assigning the integral to cn.

Essentially the task here is for Prime to decide whether your statement, that cn equals that integer, is either true or false...

 

Luc

Werner_E25-Diamond IAnswer
25-Diamond I
March 11, 2020

The "assume" modifier in Mathcads symbolic is quite weak and ever so often does not do what we expect.

 

But in your case it should work OK and actually it does for me. I tried with Prime 6 where PTC introduced a new symbolic engine and found that both, the old and the new engine, can successfully simplify your expression.

As you can see in the picture, the old engine needs to be told to simplify the result.

 

Its hard to debug just a picture so I can say what went wrong when you tried it. I would advice that you always attach your worksheet with your question and also state, which version of Prime you are using.
Did you try using a fresh worksheet without any definitions and calculations done above? Maybe something you assigned earlier (n?) is responsible for the error.

 

Here is the screenshot from Prime 6 using the new and also the old symbolic engine:

Werner_E_1-1583930077571.png

 

BTW, I would suggest to turn c.n into a function by typing c(n):=.... so you can use it in further calculations with variable values of n.

 

EDIT: I overlooked at first glance hat you wrote a boolean equal sign and not an assignment. But I just gave it a try and it still worked OK, so thats not the cause for the error.

25-Diamond I
March 11, 2020

Here is an example of what I was talking about (turning c into a function of n):

Werner_E_0-1583931220968.png

 

ttokoro
21-Topaz I
21-Topaz I
March 12, 2020

7.png

t.t.
23-Emerald IV
March 11, 2020

Other than that, Prime should be happy to accept an assignment like this:

LucMeekes_0-1583930037518.png

LucMeekes_1-1583930051219.png

LucMeekes_2-1583930084459.png

et cetera.

 

Success!
Luc