Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Ioan  
#1 Posted : 16 September 2012 23:32:13(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

Was thanked: 1 time(s) in 1 post(s)
Hi Andrey,


Here attached I have an other case where the symbolic optimisation gives a completely false results.
Hoping to serve for yours futures improvements.


Best regards,


Ioan
File Attachment(s):
rotsys.sm (23kb) downloaded 31 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 17 September 2012 18:34:42(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

Was thanked: 1126 time(s) in 723 post(s)
Hello

The function norme(v) is buggy (known issue in the forum). Use sqrt(v^2) instead if v is a single column as in your example. Works with both numeric and symbolic optimization.

Best regards, Martin Kraska
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Ioan  
#3 Posted : 17 September 2012 20:18:38(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

Was thanked: 1 time(s) in 1 post(s)
Hello Martin,


Thanks for your answer.
I replaced all norme(v) as you suggest (see attached file) and for case of symbolic optimisation the results are still wrongs (?).


Best regards,


Ioan
File Attachment(s):
rotsys2.sm (28kb) downloaded 19 time(s).
Offline mkraska  
#4 Posted : 18 September 2012 02:29:32(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

Was thanked: 1126 time(s) in 723 post(s)
Originally Posted by: Ioan Go to Quoted Post


Thanks for your answer.
I replaced all norme(v) as you suggest (see attached file) and for case of symbolic optimisation the results are still wrongs (?).




Hello Ioan,

ok, you are right. Replacing enorm is not sufficient to solve the problem. There is another one with trig operations. The problem is that sin(θ) is symbolically evaluated to zero, whereas the correct value is sqrt(2)/sqrt(3). If you ask SMath to simplify sin(acos(a)) you get sin(acos(a))=sqrt(1-a^2). If you use that instead of sin(θ) :

RSadidentity(3)+sqrt(1-({v.f*v.i}/{sqrt(v.f^2)*sqrt(v.i^2)})^2)*mat(0,-el(p,3),el(p,2),el(p,3),0,-el(p,1),-el(p,2),el(p,1),0,3,3)+(1-cos(θ))*(p*transpose(p)-identity(3)))

then you get the correct symbolic result.

R=mat(-{1-sqrt(3)}/{2*sqrt(3)},{1+sqrt(3)}/{2*sqrt(3)},1/sqrt(3),{1+sqrt(3)}/{2*sqrt(3)},-{1-sqrt(3)}/{2*sqrt(3)},-1/sqrt(3),-1/sqrt(3),1/sqrt(3),-1/sqrt(3),3,3)

Symbolic evaluation seems to be not really reliable. Simplifications are not done even if SMath is well aware of that they could be done.
An example is

cos(θ)={mat(0,0,-1,3,1)*mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)}/{sqrt(mat(0,0,-1,3,1)^2)*sqrt(mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)^2)}

which is not simplified although the following works:

{mat(0,0,-1,3,1)*mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)}/{sqrt(mat(0,0,-1,3,1)^2)*sqrt(mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)^2)}=-1/sqrt(3)


Also, if sin(acos(a))=sqrt(1-a^2) then the following cannot be correct:

sin(θ)=sqrt({sqrt(mat(0,0,-1,3,1)^2)^2*sqrt(mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)^2)^2-1}/{sqrt(mat(0,0,-1,3,1)^2)^2*sqrt(mat(1/sqrt(3),-1/sqrt(3),1/sqrt(3),3,1)^2)^2})

Here, perhaps the symbolic engine tries to apply the square to the dot product by applying the square to the factors individually. This yields 1 because both vectors are unit vectors. It might be correct for scalars but definitely not for vectors. BTW it does not help to use matrix formulation of the dot product el(transpose(v)*v,1). We had such issues already with SMath assuming matrix multiplication to be commutative.


By the way, instead of your special function you could write v.i†v.f=mat(1/sqrt(3),1/sqrt(3),0,3,1).

Best regards, Martin Kraska


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Ioan  
#5 Posted : 18 September 2012 09:29:56(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

Was thanked: 1 time(s) in 1 post(s)
Hello Martin,


Thanks a lot for your useful analysis.


Best regards,


Ioan
Offline mkraska  
#6 Posted : 20 October 2012 12:27:08(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

Was thanked: 1126 time(s) in 723 post(s)
Hi,

here is one more example for incomplete symbolic simplification in trig context. SMath knows that sin(30° ) equals 1/2 but can't find out symbolically that cosec(30° )=1/sin(30° ) is 2.

Best regards, Martin Kraska

Edited by user 20 October 2012 12:32:40(UTC)  | Reason: Not specified

File Attachment(s):
trig.sm (10kb) downloaded 12 time(s).
mkraska attached the following image(s):
trig.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Geraldinehenry  
#7 Posted : 22 October 2012 08:42:00(UTC)
Geraldinehenry

Rank: Newbie

Groups: Registered
Joined: 22/10/2012(UTC)
Posts: 1
Location: 212 Jackson Ave,Warren, Pennsylvania,United States

Originally Posted by: mkraska Go to Quoted Post
Hi,

here is one more example for incomplete symbolic simplification in trig context. SMath knows that sin(30° ) equals 1/2 but can't find out symbolically that cosec(30° )=1/sin(30° ) is 2.

Best regards, Martin Kraska

Wow, so difficult to me:'(
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.