1 Pages (8 items)
Single Integral Error - Messages
#1 Posted: 5/25/2010 2:47:26 PM
This is a great program. As a long time Mathcad user, who has become disenchanted with the versions developed by PTC, I'm looking forward to further development of SMath.
I'm having trouble with what I think is a simple definite integral.
I can integrate sin(x) from 0 to 2*Pi without any issues. However, if I hold parts of sin(x) at 0 using the IF function, when I then try to integrate the resulting function I get a "x is not defined" error.
Any help would be appreciated.
Vic Roberts
I'm having trouble with what I think is a simple definite integral.
I can integrate sin(x) from 0 to 2*Pi without any issues. However, if I hold parts of sin(x) at 0 using the IF function, when I then try to integrate the resulting function I get a "x is not defined" error.
Any help would be appreciated.
Vic Roberts
#2 Posted: 5/25/2010 2:57:32 PM
Can you post a screen shot of your problem? See the following wiki page on how to post screen shots.
Notes on Using the Forum
Thanks
Notes on Using the Forum
Thanks
Will Massie
Mechanical Engineer
Oregon, USA
#3 Posted: 5/25/2010 4:31:53 PM
The file is in a new directory called vroberts. The name is Integration Test
#4 Posted: 5/25/2010 4:40:16 PM
vroberts,
For the convenience of the forum participants, here is a link to your file:
Vroberts question
For the convenience of the forum participants, here is a link to your file:
Vroberts question
Will Massie
Mechanical Engineer
Oregon, USA
#5 Posted: 5/25/2010 4:44:44 PM
Thanks for adding the link. I didn't know how to so that.
Also, for completeness, this integral gives incorrect results in Mathcad using values of d close to but not exactly equal to Pi/2. It works properly in Mathematica.
Vic
Also, for completeness, this integral gives incorrect results in Mathcad using values of d close to but not exactly equal to Pi/2. It works properly in Mathematica.
Vic
#6 Posted: 5/25/2010 5:24:48 PM
Hello Vic,
Please see this post why "int" does not like "if",
You can also see the "Gauss-Legendre integration" example on the Wiki.
Generaly speaking, numerical integration of noncontinous functions should be avoided.
On the other hand, integration in SMath will not work with "if". You can try to use some construction like this to make a discontinous function in order to integrate it:
[MATH]f(x)←(x<1)*x^2+(x≥1)*x^3[/MATH]
But pay attention, this is proone to error.
Regards,
Radovan
Please see this post why "int" does not like "if",
You can also see the "Gauss-Legendre integration" example on the Wiki.
Generaly speaking, numerical integration of noncontinous functions should be avoided.
On the other hand, integration in SMath will not work with "if". You can try to use some construction like this to make a discontinous function in order to integrate it:
[MATH]f(x)←(x<1)*x^2+(x≥1)*x^3[/MATH]
But pay attention, this is proone to error.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#7 Posted: 5/26/2010 2:39:51 AM
Radovan,
Thank you for the link to the other thread that discusses the same issue. As I said, this integral does not work in Mathcad either, but at least with SMath I know it does not work. Mathcad just gives an incorrect answer. I am quite amazed that the same integral, using the If function, works in Mathematica.
This is my first day working with SMath. I'm sure I will have other questions.
Regards,
Vic Roberts
Thank you for the link to the other thread that discusses the same issue. As I said, this integral does not work in Mathcad either, but at least with SMath I know it does not work. Mathcad just gives an incorrect answer. I am quite amazed that the same integral, using the If function, works in Mathematica.
This is my first day working with SMath. I'm sure I will have other questions.
Regards,
Vic Roberts
#8 Posted: 5/26/2010 6:21:32 AM
Hello Vic,
Mathcad and SMath work in a different way concerning "if". Mathcad will work with "if" and integrals but SMath will not. Morover, SMath at the moment has a simple numerical procedure for calculating integrals. I think there is also a great chance that the integral calculated in SMath without using "if" function but using the procedure suggested in my previous post would be also wrong.
However, Mathematica uses its symbolic engine to solve the integrals, which is quite different. If you tried to solve the same problem in Mathcad numericaly and the result is wrong - problem is in Mathcad's numeric engine. If you tried to calculate it symbolicaly and the result is wrong, the problem is in Mathcad's symbolic engine (it depends which version of Mathcad you are using, that would be Maple or Mupad problem)
It is Ok. I would suggest you to read first the Tutorials and Examples on the Wiki and the other Wiki pages as well.
Regards,
Radovan
WroteAs I said, this integral does not work in Mathcad either, but at least with SMath I know it does not work. Mathcad just gives an incorrect answer. I am quite amazed that the same integral, using the If function, works in Mathematica.
Mathcad and SMath work in a different way concerning "if". Mathcad will work with "if" and integrals but SMath will not. Morover, SMath at the moment has a simple numerical procedure for calculating integrals. I think there is also a great chance that the integral calculated in SMath without using "if" function but using the procedure suggested in my previous post would be also wrong.
However, Mathematica uses its symbolic engine to solve the integrals, which is quite different. If you tried to solve the same problem in Mathcad numericaly and the result is wrong - problem is in Mathcad's numeric engine. If you tried to calculate it symbolicaly and the result is wrong, the problem is in Mathcad's symbolic engine (it depends which version of Mathcad you are using, that would be Maple or Mupad problem)
WroteThis is my first day working with SMath. I'm sure I will have other questions.
It is Ok. I would suggest you to read first the Tutorials and Examples on the Wiki and the other Wiki pages as well.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 Pages (8 items)
-
New Posts
-
No New Posts