Re: Gauss-Seidel Iteration Problem - A Better Solution???
You're using dense matrices that violates one of the constraints right
away. Also, it is much more effective to use vectorized operations in
Matlab
Let A = L + D + U then write your Gauss-Seidel iterations as:
(U+D)x_{n+1} = b - L * x_n, or in Matlab syntax,
x_new = (U+D)\(b - L*x);
The mldivide (\) is smart enough to recognize purely triangular solves.
Compute U+D and L using spdiags (a sparse matrix constructor).
e = ones(n, 1); % n is your problem size
U+D is spdiags([4*e, e], 0:1, n, n) and L is spdiags(e, -1, n, n)
HTH.
.
Relevant Pages
- Re: Scheduling problem
... - of course quickly reduced through the constraints. ... > This gets into an area that I know nothing about--and I'm sure that Matlab ... The problem as you describe it can be tackled by an integer programming ... easiest method I can think of would be to use a branch and bound approach. ... (comp.soft-sys.matlab) - Re: system of differential equations with boundary conditions in spacetime !
... hopefully you have three such constraints, ... including all your unknown functions from the collection of ode's you get. ... DASSL is available from ... the code "ode15s" in matlab is based on the same method, ... (sci.math.num-analysis) - Re: AMPL - matlab
... I have a data for my optimization problem generated by matlab. ... If the direct import from matlab format is difficult, ... >Due to University fiscal constraints, .sigs may not be exceed one ... (sci.math.num-analysis) - Re: Multiple outputs from fmincon
... Steve, it is possible that a solution is to remove a semicolon: ... Local minimum found that satisfies the constraints. ... feasible directions, to within the default value of the function tolerance, ... MATLAB mathematical toolbox documentation ... (comp.soft-sys.matlab) - Re: fmincon
... >>> I am using 'fmincon' from the optimization toolboox of Matlab ... >> and produces a scalar result. ... >> f, subject to the constraints. ... > The constraints do use the same vector x as the objective function. ... (comp.soft-sys.matlab) |
|