Menu

Piecewise function

Help
2004-11-30
2023-10-16
  • Nobody/Anonymous

    I am very new to MathML in general.  I was wondering if I can place a "How to..." question on this forum?  My question is how would I be able to create piecewise functions using MathCast where there would be multiple line after the curly braces.  For example, see:

    http://www.purplemath.com/modules/fcns/fcnnot02.gif
    or
    http://mathworld.wolfram.com/PiecewiseFunction.html

     
    • Tom Chekam

      Tom Chekam - 2004-11-30

      Sure you can place how to questions.

      Enter a regular matrix after the '{' sign. Take a look in the "calculus 2.xml" example from the examples folder. Take a look in the Help->Using MathCast->Rapid Mathline to see the exact paraeters of entering a  matrix.

       
    • Nobody/Anonymous

      This kind of works, but all of the functions to the right of the curly brace are centered justified instead of left justified against the brace.

      <math display="block">
        <mstyle mathsize="1.5em">
          <mrow>
            <munderover>
              <mo>&sum;</mo>
              <mrow>
                <mi>k</mi>
                <mo>=</mo>
                <mn>0</mn>
              </mrow>
              <mi>n</mi>
            </munderover>
            <mrow>
              <mfenced>
                <mrow>
                  <mi>n</mi>
                  <mfrac>
                    <mo>!</mo>
                    <mrow>
                      <mi>k</mi>
                      <mo>!</mo>
                      <mfenced>
                        <mrow>
                          <mi>n</mi>
                          <mo>&minus;</mo>
                          <mi>k</mi>
                        </mrow>
                      </mfenced>
                      <mo>!</mo>
                    </mrow>
                  </mfrac>
                </mrow>
              </mfenced>
              <msubsup>
                <mi>p</mi>
                <mrow>
                  <mi>u</mi>
                </mrow>
                <mrow>
                  <mi>k</mi>
                </mrow>
              </msubsup>
              <msup>
                <mfenced>
                  <mrow>
                    <mn>1</mn>
                    <mo>&minus;</mo>
                    <msub>
                      <mi>p</mi>
                      <mi>u</mi>
                    </msub>
                  </mrow>
                </mfenced>
                <mrow>
                  <mi>n</mi>
                  <mo>&minus;</mo>
                  <mi>k</mi>
                </mrow>
              </msup>
            </mrow>
            <mo>=</mo>
            <mo>{</mo>
            <mtable>
              <mtr>
                <mtd>
                  <mfrac>
                    <mrow>
                      <mn>1</mn>
                      <mo>&minus;</mo>
                      <mi>c</mi>
                    </mrow>
                    <mn>2</mn>
                  </mfrac>
                  <mspace width="1em" />
                  <mo>,</mo>
                  <mn>0</mn>
                  <mo>&lt;</mo>
                  <mi>x</mi>
                  <mo>&lt;</mo>
                  <mi>n</mi>
                </mtd>
              </mtr>
              <mtr>
                <mtd>
                  <mn>1</mn>
                  <mspace width="1em" />
                  <mo>,</mo>
                  <mi>x</mi>
                  <mo>=</mo>
                  <mi>n</mi>
                </mtd>
              </mtr>
              <mtr>
                <mtd>
                  <mn>1</mn>
                  <mo>&minus;</mo>
                  <msup>
                    <mfenced>
                      <mrow>
                        <mfrac>
                          <mrow>
                            <mn>1</mn>
                            <mo>&minus;</mo>
                            <mi>C</mi>
                          </mrow>
                          <mn>2</mn>
                        </mfrac>
                      </mrow>
                    </mfenced>
                    <mrow>
                      <mfrac>
                        <mn>1</mn>
                        <mi>n</mi>
                      </mfrac>
                    </mrow>
                  </msup>
                  <mspace width="1em" />
                  <mo>,</mo>
                  <mi>x</mi>
                  <mo>=</mo>
                  <mn>0</mn>
                </mtd>
              </mtr>
            </mtable>
          </mrow>
        </mstyle>
      </math>

      There is a <piecewise></piecewise> tag (See http://www.zvon.org/xxl/MathML/Output/el_piecewise.html\).
      This gives me the results I need.  Will it be possible for MathCast to support the piecewise tag sometime in the future?

       
    • Tom Chekam

      Tom Chekam - 2004-12-01

      Hi,

      MathCast doesn't support the piecewise tag. Perhaps future versions will. Though probably not in the near future, since I don't have a lot of time to work on it, and there are a few other things that I want to improve first.

       
  • Ap Muthu

    Ap Muthu - 2023-10-16

    Has this been implemented in v0.92 now in 2023 yet?

     

Log in to post a comment.