Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: how to solve a set of nonlinear equation systems with changing coefficients
Date: Tue, 3 Nov 2009 18:23:02 +0000 (UTC)
Organization: Joo Gyusok
Lines: 30
Message-ID: <hcpse6$7ac$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257272582 7500 172.30.248.35 (3 Nov 2009 18:23:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 18:23:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666798
Xref: news.mathworks.com comp.soft-sys.matlab:582119


Hello,

I have to solve the following problem; I hope that someone can help me.
I would like to solve the function and obtain a vector x = [x(1); x(2)]
for varying values of theta and the vector p =[ p(1); p(2)]

>>
function findphi = findphi(x)
findphi = [cos(theta)*(sin(x(1)) - x(2)*x(1)*cos(x(1))) + ...
          sin(theta) * (cos(x(1)) + x(2) * x(1) * cos(x(1))) - p(1) ;
         -sin(theta) * (sin(x(1)) - x(2) * x(1) * cos(x(1))) + ...
          cos(theta) * (cos(x(1)) + x(2) * x(1) * cos(x(1))) - p(2)];
>>

I could use the 'fsolve' command for one specific case, but I have to do this 77 times for changing values of p and theta.

e.g. if I insert

>> 
x0 = [0.7; 1]
x = fsolve('findphi', x0)
>>
The values of the coefficients are not known to the function 'findphi' although present in workspace.
Does anybody know how I can pass these coefficients to my function?

Is there any suitable way for stack processing this?

Thank you for your help-.

Gyusok