|
From: | Alexander Barth |
Subject: | Re: Using fsolve with time series data |
Date: | Fri, 9 Aug 2013 13:50:07 +0200 |
Hello All,
I am trying to solve a system of equations that involve time series data.
My system of equations are of the general form...
A1 = A0 - R1*x(3) + R1*x(6) - R1*x(5)*x(5) -R1*x(2)*x(2)
A2 = A0 - R2*x(3) + R2*x(6) - R2*x(5)*x(5) -R2*x(2)*x(2)
etc
where A1, A2...are known vectors (1,N).
R1, R2 etc are known scalars.
A0 is an unknown vector (1,N)
The other unknown variables, x(1), x(2) etc should be vectors (1,N).
I have 8 unknowns and 8 equations.
I have set up a script, where I define the scalars (R1 etc), and my known vectors, and define my
function in this form...
fcn = @(x) [x(7) - R1*x(3) + R1*x(6) - R1*x(5)*x(5) - R1*x(2)*x(2) - A1,
...
for all the equations
];
% where x(7) = A0,
and call fsolve, thus...
[x, fvec, info] = fsolve(fcn, [0 0 0 0 0 0 0 0]);
This is returning a solution, but the x(i) values that are returned are
scalars. They should be vectors (1,N).
Is it possible to solve a problem of this type, and if so, how should I reformulate/correct my approach so that the solution returns the x's as vectors?
Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |