[Scilab-users] Solving linear simultaneous equations

Paul Bignier paul.bignier at scilab-enterprises.com
Wed Mar 19 11:03:54 CET 2014


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


On 03/19/2014 10:47 AM, aweeks at hidglobal.com wrote:
>
> 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)_
>     __aweeks at hidglobal.com_ <mailto:aweeks at hidglobal.com>_
>     __www.hidglobal.com_ <http://www.hidglobal.com/> 
>
> 	
>
>     <http://www.hidglobal.com/> 
>
>
>
> Inactive hide details for Paul Bignier ---18/03/2014 10:01:09---Hi 
> Tunji, linsolve help pagePaul Bignier ---18/03/2014 10:01:09---Hi 
> Tunji, linsolve help page
>
>
>     From: 
>
> 	
> Paul Bignier <paul.bignier at scilab-enterprises.com>
>
>     To: 
>
> 	
> "International users mailing list for Scilab." 
> <users at lists.scilab.org>, iootunniyi at futa.edu.ng
>
>     Date: 
>
> 	
> 18/03/2014 10:01
>
>     Subject: 
>
> 	
> Re: [Scilab-users] Solving linear simultaneous equations
>
>     Sent by: 
>
> 	
> "users" <users-bounces at lists.scilab.org>
>
> ------------------------------------------------------------------------
>
>
>
>
> Hi Tunji,
>
> linsolve _help page_ 
> <http://help.scilab.org/docs/5.4.1/en_US/linsolve.html> 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 throughthe 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
>     _users at lists.scilab.org_ <mailto:users at lists.scilab.org>
>     _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_ 
> <http://www.scilab-enterprises.com/>_______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20140319/82033c55/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4559 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140319/82033c55/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140319/82033c55/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20140319/82033c55/attachment-0002.gif>


More information about the users mailing list