1 Pages (4 items)
derivative error - Messages
#1 Posted: 2/25/2012 10:59:10 PM
Dear SMath,
I did a simple derivative calculations with incorrect result.

If I use 2*tt^5 also the same problem.
regards
waluyo
I did a simple derivative calculations with incorrect result.

If I use 2*tt^5 also the same problem.
regards
waluyo
#2 Posted: 2/26/2012 3:29:38 AM
Hello waluyo,
I think there is nothing nothing wrong with your results. I suppose you wanted to use these functions on every elements of vector "tt". This should be done this way:
[MATH=eng]for(i,range(1,length(tt)),line(el(s,i):s(el(tt,i)),el(ds,i):v(el(tt,i)),el(dv,i):a(el(tt,i)),3,1))[/MATH]
[MATH=eng]s=mat(6,-16,-26,-12,38,5,1)[/MATH][MATH=eng]ds=mat(-24,-18,0,30,72,5,1)[/MATH][MATH=eng]dv=mat(0,12,24,36,48,5,1)[/MATH]
Pay attention then when you multiply two vectors you will get their scalar product - not the vector which represents the product of their appropriate elements:
[MATH=eng]tt*tt=30[/MATH] [MATH=eng]tt^2=30[/MATH] [MATH=eng]sum((el(tt,i)^2),i,1,length(tt))=30[/MATH]
Regards,
Radovan
I think there is nothing nothing wrong with your results. I suppose you wanted to use these functions on every elements of vector "tt". This should be done this way:
[MATH=eng]for(i,range(1,length(tt)),line(el(s,i):s(el(tt,i)),el(ds,i):v(el(tt,i)),el(dv,i):a(el(tt,i)),3,1))[/MATH]
[MATH=eng]s=mat(6,-16,-26,-12,38,5,1)[/MATH][MATH=eng]ds=mat(-24,-18,0,30,72,5,1)[/MATH][MATH=eng]dv=mat(0,12,24,36,48,5,1)[/MATH]
Pay attention then when you multiply two vectors you will get their scalar product - not the vector which represents the product of their appropriate elements:
[MATH=eng]tt*tt=30[/MATH] [MATH=eng]tt^2=30[/MATH] [MATH=eng]sum((el(tt,i)^2),i,1,length(tt))=30[/MATH]
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 2/26/2012 6:31:00 AM
Thanks Radovan,
What I did was actually similar what I have done in Mathcad. That works in Mathcad with all correct answers.
I was thinking it would be OK in SMath, but actually not acceptable in SMath.
I have to do a bit programming to calculate every element of the vector in SMath.
Your explanation is clear to me.
Regards,
waluyo
What I did was actually similar what I have done in Mathcad. That works in Mathcad with all correct answers.
I was thinking it would be OK in SMath, but actually not acceptable in SMath.
I have to do a bit programming to calculate every element of the vector in SMath.
Your explanation is clear to me.
Regards,
waluyo
#4 Posted: 2/26/2012 8:17:46 AM
You are welcome waluyo
Glad that I was of any help. Actually, I also often made mistakes in SMath mixing it with Mathcad, as well as you did.
Regards,
Radovan

Glad that I was of any help. Actually, I also often made mistakes in SMath mixing it with Mathcad, as well as you did.
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 Pages (4 items)
-
New Posts
-
No New Posts