Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Uwe Brauer Posts: 91 Registered: 12/7/04
Newton Raphson for nxn system using symbolic toolbox
Posted: Nov 1, 2011 6:20 AM

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

Date Subject Author
11/1/11 Uwe Brauer
11/1/11 Alan Weiss
11/9/11 Christopher Creutzig
11/11/11 Uwe Brauer
11/15/11 Christopher Creutzig
11/15/11 Uwe Brauer
11/15/11 Mircea Anghel
11/16/11 Christopher Creutzig