trace() function broken

trace() function broken - 消息

#1 已发布: 2012/7/3 03:22:52
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

Hi,

I get the following with build 4559

[MATH lang=eng]trace(mat(1,3,2,4,2,2))=1@#[/MATH]

I need the trace function to fake the also broken norme() function using

[MATH lang=eng]M:mat(1,2,3,4,2,2)@#[/MATH]

[MATH]norm_e(M):sqrt(trace(transpose(M)*M))[/MATH]

Best regards, Martin Kraska
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#2 已发布: 2012/7/3 04:18:12
kmihaylovich

kmihaylovich

8个赞,共131个帖子。

组: User

Hmm, what results do you expect?
#3 已发布: 2012/7/3 05:00:09
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

Hello,
Wrote


I get the following with build 4559

[MATH lang=eng]trace(mat(1,3,2,4,2,2))=1@#[/MATH]


BTW., trace() is reserved function for debugging purpose - trace evaluations through Output window - see trace()

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 已发布: 2012/7/3 13:58:26
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

Hi,

ok, that is just my fault, I expected trace to be the trace of a matrix, i.e. the sum of the diagonal elements. In fact, I have to use tr(), than everything works as expected:

[MATH lang=eng]M=mat(1,2,3,4,2,2)@#[/MATH]

[MATH lang=eng]sqrt(tr(transpose(M)*M))=sqrt(30)@#[/MATH]

Thanks for the hints!

Best regards, Martin Kraska

Wrote

Hello,

Wrote


I get the following with build 4559

[MATH lang=eng]trace(mat(1,3,2,4,2,2))=1@#[/MATH]


BTW., trace() is reserved function for debugging purpose - trace evaluations through Output window - see trace()

Regards,
Radovan



Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
  • 有新帖
  • 无新帖