acer

32385 Reputation

29 Badges

19 years, 334 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

This might be due to the ordering of the coefficients (in a set, say).

restart:
expr:=a*Zeta^2 + p*Zeta^5:
patmatch(expr, conditional(Zeta^n::posint*y::anything+z::anything,
         n >= 3), 's');s;s:='s':

                             false
                               s

restart:
expr:=p*Zeta^2 + a*Zeta^5:
patmatch(expr, conditional(Zeta^n::posint*y::anything+z::anything,
         n >= 3), 's');s;s:='s':

                              true
                  [                        2]
                  [n = 5, y = a, z = p Zeta ]

restart:
escloc:=proc() local a; a; end proc():
expr:=escloc*Zeta^2 + a*Zeta^5:
{escloc*Zeta^2, a*Zeta^5};
patmatch(expr, conditional(Zeta^n::posint*y::anything+z::anything,
         n >= 3), 's');s;s:='s':

                       /      5        2\ 
                      { a Zeta , a Zeta  }
                       \                / 
                              true
                  [                        2]
                  [n = 5, y = a, z = a Zeta ]

restart:
escloc:=proc() local a; a; end proc():
expr:=a*Zeta^2 + escloc*Zeta^5:
{a*Zeta^2, escloc*Zeta^5};
patmatch(expr, conditional(Zeta^n::posint*y::anything+z::anything,
         n >= 3), 's');s;s:='s':

                       /      2        5\ 
                      { a Zeta , a Zeta  }
                       \                / 
                             false
                               s

acer

@Christopher2222 Editing a post can in itself screw up contents between angle-brackets. It's a (very annoying) bug in the editor.

You can see an older version here. It had, at various lines,

A:=<<0|-4>,<-1|0>>;

beta:=<alpha|<0,0>>;

V1:=<-2,1>;

V2:=<2,1>;

(I've had to get into the habit of copying all of a post/comment/question to the clipboard before hitting the Edit button.)

I suppose that there are various ways for the student who does not immediately see the 7/9 part.

> restart:
           
> K:=7*10^i:         
> seq(K,i=0..2);     

                                  7, 70, 700

> P:=sum(K,i=0..j-1);

                                        j
                                    7 10
                               P := ----- - 7/9
                                      9

> seq(P,j=1..3);     

                                  7, 77, 777

> W:=sum(P,'j'=1..n);  

                                               (n + 1)
                                7 n   70   7 10
                         W := - --- - -- + -----------
                                 9    81       81

> seq(W,n=1..3);

                                  7, 84, 861

> u:=unapply(W,n):

> u(3);
                                      861

acer

I suppose that there are various ways for the student who does not immediately see the 7/9 part.

> restart:
           
> K:=7*10^i:         
> seq(K,i=0..2);     

                                  7, 70, 700

> P:=sum(K,i=0..j-1);

                                        j
                                    7 10
                               P := ----- - 7/9
                                      9

> seq(P,j=1..3);     

                                  7, 77, 777

> W:=sum(P,'j'=1..n);  

                                               (n + 1)
                                7 n   70   7 10
                         W := - --- - -- + -----------
                                 9    81       81

> seq(W,n=1..3);

                                  7, 84, 861

> u:=unapply(W,n):

> u(3);
                                      861

acer

Did you really intend e^(-34.32*10^4/t) and others like it, or were those intended as exp(-34.32*10^4/t) instead?

acer

@kail85 It's likely going to boil down to which you prefer to use: `freeze` and `thaw`, or `subs`, or maybe even frontend.

restart:

f:= a*exp(x) + b*exp(2*x) = 2*exp(x) + 5*exp(2*x):

frontend(solve, [identity(f,exp(x)), [a,b]],
         [{`+`,`*`,`=`},{[a,b],identity}]);

                                    [[a = 2, b = 5]]

I find that I often start off with `frontend`, and if the example gets involved I'll switch over and try with `freeze` and patmatch or typematch.

@kail85 It's likely going to boil down to which you prefer to use: `freeze` and `thaw`, or `subs`, or maybe even frontend.

restart:

f:= a*exp(x) + b*exp(2*x) = 2*exp(x) + 5*exp(2*x):

frontend(solve, [identity(f,exp(x)), [a,b]],
         [{`+`,`*`,`=`},{[a,b],identity}]);

                                    [[a = 2, b = 5]]

I find that I often start off with `frontend`, and if the example gets involved I'll switch over and try with `freeze` and patmatch or typematch.

@AliKhan The Matlab result for A3(3) is wrong, The evalhf result for A3(3) is wrong. But if you really want to use evalhf then try it with `add` instead of `Sum` or `sum`.

I find that people really don't like hearing it, but one thing you might reconsider is the methodology of assigning float values to your parameters at the start of your worksheet. Such values are useful for numeric evaluation, but often make it awkward to get the best symbolic benefits before doing numeric evaluations. Maple can often be a lot more easily powerful if you don't make such assignments at the start.

@AliKhan The Matlab result for A3(3) is wrong, The evalhf result for A3(3) is wrong. But if you really want to use evalhf then try it with `add` instead of `Sum` or `sum`.

I find that people really don't like hearing it, but one thing you might reconsider is the methodology of assigning float values to your parameters at the start of your worksheet. Such values are useful for numeric evaluation, but often make it awkward to get the best symbolic benefits before doing numeric evaluations. Maple can often be a lot more easily powerful if you don't make such assignments at the start.

T:=convert(expand(simplify(convert(A3(n),rational))),tan);

                             /1     \
                          tan|- Pi n|
                             \2     /

acer

T:=convert(expand(simplify(convert(A3(n),rational))),tan);

                             /1     \
                          tan|- Pi n|
                             \2     /

acer

@nerdpole Try it as,

alpha := unapply(piecewise(
    x1 < 0 or x2 < 0 or x3 < 0 or h < x1 or h < x2 or h < x3, 0,
    0.5*h  ..... )),x1,x2,x3);  

with inserting the (x1,x2,x3) -> yourself.

@nerdpole Try it as,

alpha := unapply(piecewise(
    x1 < 0 or x2 < 0 or x3 < 0 or h < x1 or h < x2 or h < x3, 0,
    0.5*h  ..... )),x1,x2,x3);  

with inserting the (x1,x2,x3) -> yourself.

@Doug Meade You could try Chapter 16 of the Maple 16 Programming Guide.

@Doug Meade You could try Chapter 16 of the Maple 16 Programming Guide.

First 388 389 390 391 392 393 394 Last Page 390 of 592