Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

omorr Offline
#1 Posted : Sunday, April 15, 2012 3:52:22 PM(UTC)
omorr

Rank: Advanced Member

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

Was thanked: 99 time(s) in 88 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
smath Offline
#2 Posted : Monday, April 16, 2012 12:31:37 AM(UTC)
smath

Rank: Administration

Groups: Administrators
Joined: 7/11/2008(UTC)
Posts: 751
Man
Russian Federation

Was thanked: 218 time(s) in 120 post(s)
This should work:

Will check if I can fix this issue.

Regards.
omorr Offline
#3 Posted : Monday, April 16, 2012 1:43:16 PM(UTC)
omorr

Rank: Advanced Member

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

Was thanked: 99 time(s) in 88 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 Monday, April 16, 2012 1:50:55 PM(UTC)  | Reason: Not specified

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.