Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Newton Raphson for nxn system using symbolic toolbox
Replies: 7   Last Post: Nov 16, 2011 5:09 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Uwe Brauer

Posts: 83
Registered: 12/7/04
Newton Raphson for nxn system using symbolic toolbox
Posted: Nov 1, 2011 6:20 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello

I have already implemented the Newton Raphson method for a
system of n equations. However in my implementation I have
to give the function and its Jacobian (written as a
function) as a input variable.

Now I want to use the symbolic toolbox in order not to
calculate the Jacobian myself. My basic problem is later to
evaluate that expression, since I don't know before hand the
size of the system. While this is not a problem for an
"ordinary" function which uses vectors it seems to be a
problem for symbolic expression.


Here is an example trying to use vectors
clear all
syms x y
e=[x y]
f1=sin(e(1)-e(2))
e(1)=1
e(2)=-1
eval(f1)

But this does not work! It gives sin(x+y)

While of course
x=1
y=-1
eval(f1)
works and gives
f1= 0.9093
but of course for a nxn system I don't know before hand the
size of the system and how many variables I have to set to
numerical values before evaluating the expression f1.

Can anybody help me?

thanks

Uwe Brauer



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.