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 omorr  
#1 Posted : 15 April 2012 15:52:22(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

I am continuing to struggle with my nonlinear equations and this one just can not understand. It is again connected to Jacob() function.



I already mentioned this problem in another post regarding failing of solve() and roots() http://en.smath.info/forum/default.aspx?g=posts&m=6579#post6579.
I just do not understand why the "Syntax is incorrect" error here. The Jacob() itself is giving a matrix, but I can not define a function with it. I already did many similar problems like this one, but this particular one just drives me crazy Mad . I tried lots of different things here, but without success. Am I doing something wrong? Do I miss something? Is there some trivial thing that I can not see at the moment?

Here is the accompanied file Primer65cc.sm

Could someone take a look at it please.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"

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

Offline Andrey Ivashov  
#2 Posted : 16 April 2012 00:31:37(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
This should work:
fJ(X#):Jacob(ff(X#),mat(el(X#,1),el(X#,2),el(X#,3),el(X#,4),el(X#,5),el(X#,6),el(X#,7),el(X#,8),el(X#,9),el(X#,10),el(X#,11),el(X#,12),12,1))

Will check if I can fix this issue.

Regards.
Offline omorr  
#3 Posted : 16 April 2012 13:43:16(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Andrey,

Thank you for answering but It seems that I was wrong in some way. I forgot that making a symbolic vector say X with the elements of the same name as the vector itself i.e. X[1],X[2]...is problematic.
Here is the example:



To be honest, I am not quite sure way is this not possible. There must be some reason for that, I suppose.
Therefore, the previous example with Jacob() was a kind of mistake. I should use another name for the vector, and then it would work:



On the other hand, If we try to use Jacob() inside a function which apply Newton Raphson method, there might be a problem. Here I continue with the previous example:



If we want to use this function fNewtonm() we must take care that the first argument "f(1)" is a function with as single argument, the second argument is "xs" - a symbolic vector. The problem is that we have to know in advance that the local function "fJ(X)" inside fNewtonm() must have the vector argument X with the symbolic vector elements X[1],X[2],..., otherwise this will not work. Therefore when we call the function fNewtonm() the second symbolic vector, "XS" here, must have symbolic vector elements with X[1],X[2],.... I do not know how to make this particular fNewtonm() more general in order to work with some arbitrary named symbolic vector because what Jacob() returns depends on "xs" vector and the argument name of "fJ()" function might be different.

Here is the accompanied file - Primer65ccc.sm

I hope I made myself understood.

Regards,
Radovan

Edited by user 16 April 2012 13:50:55(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
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.