Hello Adrian,
Indeed the '\' operator is easy-to-use and powerful (Lapack-based).
I advised it in a private exchange with Tunji (which should have
been made public):
"
Let's call your 6x6 matrix 'M'.
Try --> res = M(:,1:5) \ Mat(:, 6)
The idea is to divide M into a right-hand side ('b' in linsolve
page) and a left-hand side ('A') and use the '\' solving operator.
If you want a function to enter your coefficients directly, you can
write it:
function res = mySolve(M)
res = M(:,1:5) \ Mat(:, 6);
endfunction
"
Regards,
Paul
Hi Paul,
I have a suggestion but also a
more general observation.
I have also been solving
simultaneous linear equations of the form A * x = b. My first
thought was to use the method:
x = A \ b
and it seemed to me that if
Tunji's equations are well-behaved then this may be the
easiest method, rather than using 'linsolve'.
In my case I'm trying to solve
electrical circuit equations which are sparse and include
complex values. I used x = A \ b to begin with but for some
component values I get messages like:
Warning :
matrix is close to singular or
badly scaled. rcond = 1.0388D-08
computing least squares
solution. (see lsq).
The method goes to completion
but the results are obviously wrong.
If I use 'linsolve' instead, it
goes to completion without producing any warnings or errors
but the results are wrong.
For me, 'umfpack' is the best
method by far and works very well.
This is a situation which has
occurred several times before. SciLab is a very powerful
piece of software and as a result there may (apparently) be
several methods of doing the same thing but there are rarely
explanations of how each method works or why you would use one
method rather than another.
Best wishes,
Adrian.
Adrian
Weeks
Development Engineer
HID Global,
3 Cae Gwyrdd,
Green Meadow Springs
Business Park,
Cardiff CF15 7AB,
United Kingdom.
+44 (0)29 20528523 (Office)
[email protected]
www.hidglobal.com
|
|
Paul Bignier ---18/03/2014 10:01:09---Hi Tunji,
linsolve help page
Hi Tunji,
linsolve help page contains utilization examples.
If you still cannot use it, please tell us more about the
problem you are trying to solve.
Regards,
Paul
On 03/18/2014 10:16 AM, 'Tunji
OTUNNIYI wrote:
Hello:
I am quite a starter here.
Could someone please help me
through solving n x n linear simultaneous equations.
I saw linsolve in help, but can’t
follow through the arguments.
Applying the calling sequence to a simple example will be of
help.
Thanks a lot.
Tunji OTUNNIYI | MME SEET FUTA
Akure, Nigeria.
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
--
Paul BIGNIER
Development engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com _______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
--
Paul BIGNIER
Development engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com
|
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users