1 страниц (4 вхождений)
derivative error - Сообщения
#1 Опубликовано: 25.02.2012 22:59:10
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 Опубликовано: 26.02.2012 03:29:38
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 Опубликовано: 26.02.2012 06:31:00
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 Опубликовано: 26.02.2012 08:17:46
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 страниц (4 вхождений)
-
Новые сообщения
-
Нет новых сообщений