Skip navigation
19260 Views 29 Replies Latest reply: Jan 6, 2015 9:36 AM by ptc-6829384 RSS
AlvaroDíaz Silver 895 posts since
Oct 5, 2001
Currently Being Moderated

Apr 27, 2009 12:00 AM

Cramer's rule

Cramer's rule in Mathcad.

Alvaro.
Attachments:
  • ptc-1368288 Copper 15,155 posts since
    Nov 15, 2007
    Currently Being Moderated
    Apr 27, 2009 12:00 AM (in response to AlvaroDíaz)
    Cramer's rule
    On 4/27/2009 9:24:19 AM, adiaz wrote:
    >Cramer's rule in Mathcad.
    >
    >Alvaro.
    __________________________

    Past a certain size of the system, the solving is by Cholesky decomposition. But I don't know about at what size it starts. Cramer is for the first year algebra class ! The Gauss decomposition was well used at the times of TI-59 but the memory was the limit, may be close to 10 equations ?

    Jean



    Attachments:
  • Narlin Copper 158 posts since
    May 20, 2001
    Currently Being Moderated
    Apr 28, 2009 12:00 AM (in response to AlvaroDíaz)
    Cramer's rule
    Cramer's Rule is useful for teaching purposes but not so great for calculation as has been shown in these posts.
    Gaussian elimination is pretty good for most scientific and engineering calculation. I have had to program it into dozens of languages over the years - somewhat surprisingly MCad is one of the more difficult ones.
    Anyway, many students find Gaussian elimination boring and tedious to follow. Long ago i found a flowchart in textbook (reference lost) that showed how to program a set of simultaneous equations as a square matrix of coefficients plus a right hand column of constant values, to untangle it all and get a diagonal matrix of "1"s and the value of each unknown down the right hand column.
    I have attached both the flowchart and a MathCad example.
    However, the real use of the flowchart is for stupid languages like javascript or php, so that you can do live math on a web site.

    Regards,
    narlin
    Attachments:
    • ptc-1368288 Copper 15,155 posts since
      Nov 15, 2007
      Currently Being Moderated
      Apr 28, 2009 12:00 AM (in response to Narlin)
      Cramer's rule
      It shouldn't be more difficult programing Gauss elimination in Mathcad than it was in TI-59, should it ?

      jmG
    • PhilipOakley Silver 2,095 posts since
      Feb 20, 2007
      Currently Being Moderated
      Apr 28, 2009 12:00 AM (in response to Narlin)
      Cramer's rule
      On 4/28/2009 9:45:37 AM, Narlin wrote:
      >Gaussian elimination is pretty
      >good for most scientific and
      >engineering calculation. I
      >have had to program it into
      >dozens of languages over the
      >years - somewhat surprisingly
      >MCad is one of the more
      >difficult ones.

      I found that too. And the various speed up versions that select the best row element to diagonalise.

      I posted a thread some wher about it. If I remember I wanted an inner for loop which had an i<>j exclusion in it...

      Philip Oakley
    • lvl107 Gold 356 posts since
      Jan 22, 2007
      Currently Being Moderated
      Oct 12, 2009 12:00 AM (in response to Narlin)
      Cramer's rule
      ...There's an error...
      Attachments:
      • TomGutman Silver 10,537 posts since
        Oct 22, 2006
        Currently Being Moderated
        Oct 13, 2009 12:00 AM (in response to lvl107)
        Cramer's rule
        I don't understand what this is doing in this thread. AFAIK echelon form bears no relation to Cramer's rule. Nor do I understand the point of the sheet. Clearly the user define Echelon function in this sheet is defective. Happens. People are careless, and make mistakes. Mathcad's built in echelon function (rref) works with this matrix.

        Oh, the form A-1·C is not the preferred Mathcad way to solve the system A·X=C. It's the mathematical solution converted to Mathcad. lsolve is generally better on a number of grounds.
        __________________
        � � � � Tom Gutman
    • lvl107 Gold 356 posts since
      Jan 22, 2007
      Currently Being Moderated
      Sep 26, 2010 9:05 AM (in response to Narlin)
      Re: Cramer's rule

      I just add a "handwork" in here.

        -LL-

      Attachments:
      • Platinum 622 posts since
        Jun 22, 2010
        Currently Being Moderated
        Sep 26, 2010 12:57 PM (in response to lvl107)
        Re: Cramer's rule

        Loi Le wrote:

         

        I just add a "handwork" in here.

          -LL-

        What was your point if everything had been said in the past on that and that of what was said can be read again back in time  On the top of that I just posted the use of solving rref. What is the point reworking rref if it is sourced in Mathcad and the source is largely accepted and proved working ? Did you find a bug in the Mathcad built-in rref ?

  • TomGutman Silver 10,537 posts since
    Oct 22, 2006
    Currently Being Moderated
    Apr 28, 2009 12:00 AM (in response to AlvaroDíaz)
    Cramer's rule
    Cramer is almost never a good option. To use it you need to calculate the determinant of the matrix. Getting the entire solution is only slightly more work than simply calculating the determinant. A lot less than the two determinants which is the minimum for Cramer's rule (solving for only one variable).
    __________________
    � � � � Tom Gutman
  • TomGutman Silver 10,537 posts since
    Oct 22, 2006
    Currently Being Moderated
    Apr 28, 2009 12:00 AM (in response to PhilipOakley)
    Cramer's rule
    >>If I remember I wanted an inner for loop which had an i<>j exclusion in it...<<

    That's a continue statement.
    __________________
    � � � � Tom Gutman
    • PhilipOakley Silver 2,095 posts since
      Feb 20, 2007
      Currently Being Moderated
      Apr 28, 2009 12:00 AM (in response to TomGutman)
      Cramer's rule
      On 4/28/2009 3:56:21 PM, Tom_Gutman wrote:
      >>>If I remember I wanted an inner for loop which had an i<>j exclusion in it...<<
      >
      >That's a continue statement.
      >__________________
      >� � � � Tom Gutman

      Just looked up my old notes (2006) - it was the partial pivoting / Scaled partial pivoting method for LU/Gaussian elimination that I was looking at.

      I'll try to remember the "continue" statement, which I rarely use :-(

      Somehow it doesn't feel right to have that "skip" style command. (it's almost like a GOTO End !)

      Philip Oakley
  • ptc-1368288 Copper 15,155 posts since
    Nov 15, 2007
    Currently Being Moderated
    Oct 12, 2009 12:00 AM (in response to lvl107)
    Cramer's rule
    On 10/12/2009 9:09:17 PM, lvl107 wrote:
    > ...There's an error...
    ________________________

    Cramer has no use in real modern maths. The other thing you may be doing no use either. Matrix operations are essentially based on Cholesky. So, just use Mathcad matrix operations from Mathcad native numerical algos. In other words: there is nothing to program with "Cramer museum".

    jmG



    • ptc-1368288 Copper 15,155 posts since
      Nov 15, 2007
      Currently Being Moderated
      Oct 13, 2009 12:00 AM (in response to ptc-1368288)
      Cramer's rule
      Didn't realised the subject is an old vintage and was already commented.

      >Gaussian elimination is pretty good for most scientific and engineering calculation. I have had to program it into dozens of languages over the years - somewhat surprisingly MCad is one of the more difficult ones.< [Narlin]

      ==> not sure how to interpret:
      ==> programming environments/languages ?
      ==> or "Pocket Calculators"
      ==> what would be the use of either programming environment or language not doing the minimum linear algebra.

      When it is applicable, the Cholesky decomposition is roughly twice as efficient as the LU decomposition for solving systems of linear equations.[1]

      jmG

  • ptc-1368288 Copper 15,155 posts since
    Nov 15, 2007
    Currently Being Moderated
    Oct 13, 2009 12:00 AM (in response to ptc-1368288)
    Cramer's rule
    Sorry, Alvaro: earlier, I messed your sheet.

    jmG
    Attachments:
  • ptc-1368288 Copper 15,155 posts since
    Nov 15, 2007
    Currently Being Moderated
    Oct 13, 2009 12:00 AM (in response to AlvaroDíaz)
    Cramer's rule
    On 10/13/2009 2:31:36 AM, adiaz wrote:
    >On 10/12/2009 9:09:17 PM, lvl107
    >wrote:
    > ...There's an error...

    Check
    >please if this fix all the
    >cases.
    Regards. Alvaro.
    ___________________________

    Elementary Row Operations on Matrices (Mathsoft Matrix treasury).

    jmG



    Attachments:
    • TomGutman Silver 10,537 posts since
      Oct 22, 2006
      Currently Being Moderated
      Oct 13, 2009 12:00 AM (in response to AlvaroDíaz)
      Cramer's rule
      I don't understand your point. I didn't question this post in the collaboratory, nor the placement in this particular section. I questioned the placement of this post, dealing with an error in a particular implementation of a reduction to echelon for, in an established thread dealing with Cramer's rule. It is a quite different issue, and should start its own thread.

      As to the point of the post, well, what is it? The post merely states that there is an error, borne out by the sheet. Is this just a complaint about the particular implementation (source unknown)? Or is it a statement that the echelon form solution doesn't work in general?

      If indeed intended as commentary of some sort in the particular implemention, what is wanted? The identification of where the error occurs (a lot of users seem to have never learned to use the error trace facility)? A patch type fix for this particular routine? A general discussion of how to do gaussian elimination in a robust way?
      __________________
      � � � � Tom Gutman
  • ptc-6829384 Copper 2 posts since
    Jan 6, 2015
    Currently Being Moderated
    Jan 6, 2015 9:36 AM (in response to AlvaroDíaz)
    Re: Cramer's rule

    Nice discussion and very informatiove.

    Moreover, i have found a very useful step by step tutorial of cramer's rule of simplification of two and three equation system with pictorial views.

    'http://www.electricaltechnology.org/2015/01/cramers-rule-2-3-equation-systems-easy-step-step.html

     

    I hope you will like it

More Like This

  • Retrieving data ...

Bookmarked By (0)