Hi there, fellow users in MathCad. I'm totally a beginner in MathCad. I don't know why Mathcad said the variable is undefined when I try to solve the integral function. When I put my task's value which are a=-2 and b=4 the integral function said it's value is undefined.
Where did I do wrong? Is there any other command that I should add ?
Regards,
Adlil
Solved! Go to Solution.
Welcome to the forum.
You should understand that mathcad has two different processors. One is numerical, the other is symbolic.
The numerical processor wants every variable to be numerically defined BEFORE it is used. The symbolic processor is happy to work with symbols, their numeric values don't need to be known (and in many cases it's even better that they're not numerically defined.)
{Also, the numeric processor is deisgned to work with units, like m, s A, V, N etc. The symbolic processor doesn't understand that, mit treats m, s, A etc. as symbols. That's not your problem here, but as a newcomer, it's good to know}
With your integral, F(x), you've defined it, ( F(x):=.... ) And next you are evaluating it ( F(x)= ).
This evaluation is numerical evaluation, you're (implicitly) calling the numeric processor. And x is not numerically defined.
Had you typed F(3), a numerical answer would result (if the integral can be numerically solved).
If you want to know the symbolic answer, you'll have to evaluate the integral symbolically, that is with the -> operator (instead of = ). You get -> by typing [Ctrl .] (Pressing and holding the Ctrl button while tapping the . (the dot or point).
Now the result of your integral is independent of x, so instead of function F(x), you could define it as a variable F.
What you also see here is that the numeric and symbolic processors are 'different beasts' sometimes one of the two can't find a solution, while the other can.
Note that in the remainder of your sheet you actually use the function F as a parameter to your PrPram Trap and Simps functions... So for those, F does need to be defined as a function of one parameter.
Success!
Luc
Welcome to the forum.
You should understand that mathcad has two different processors. One is numerical, the other is symbolic.
The numerical processor wants every variable to be numerically defined BEFORE it is used. The symbolic processor is happy to work with symbols, their numeric values don't need to be known (and in many cases it's even better that they're not numerically defined.)
{Also, the numeric processor is deisgned to work with units, like m, s A, V, N etc. The symbolic processor doesn't understand that, mit treats m, s, A etc. as symbols. That's not your problem here, but as a newcomer, it's good to know}
With your integral, F(x), you've defined it, ( F(x):=.... ) And next you are evaluating it ( F(x)= ).
This evaluation is numerical evaluation, you're (implicitly) calling the numeric processor. And x is not numerically defined.
Had you typed F(3), a numerical answer would result (if the integral can be numerically solved).
If you want to know the symbolic answer, you'll have to evaluate the integral symbolically, that is with the -> operator (instead of = ). You get -> by typing [Ctrl .] (Pressing and holding the Ctrl button while tapping the . (the dot or point).
Now the result of your integral is independent of x, so instead of function F(x), you could define it as a variable F.
What you also see here is that the numeric and symbolic processors are 'different beasts' sometimes one of the two can't find a solution, while the other can.
Note that in the remainder of your sheet you actually use the function F as a parameter to your PrPram Trap and Simps functions... So for those, F does need to be defined as a function of one parameter.
Success!
Luc
Hi Luc,
I apologize for the late reply. If there is a feature that I can rate your answer, I would give 11 out of 10. Your explanation really help me a lot. I solved the problem plus with better understanding. I didn't know there is other way to solve this simple problem with just a click of button, MathCad make my day.
I can't thank you enough Luc . May God bless you and your family. Once again ,thank you and appreciate for the answer. Stay safe.
Regards,
Adlil