smith_alpha

155 Reputation

6 Badges

12 years, 150 days

MaplePrimes Activity


These are questions asked by smith_alpha

Hi,

 

  I tried to obtain power of a series. I have the following input

 

***

assume(c<-10);
eq1:=2*x^a*y^b*(x+y)^c+3*x^(a+1)*y^(b+1)*(x+y)^(c+1);


f1:=map(t -> `if`(match(t = d*x^e*y^f*(x+y)^g, x, 's'), subs(s,e), NULL),
convert(eq1, list));


f2:=map(t -> `if`(match(t = d*x^e*y^f*(x+y)^g, y, 's'), subs(s,f), NULL),
convert(eq1, list));


f3:=map(t -> `if`(match(t = d*x^e*y^f*(x+y)^g, x+y, 's'), subs(s,g), NULL),
convert(eq1, list));

print(f1);

 ****

 

The output is

****

a b c (a + 1) (b + 1) (c + 1)
2 x y (x + y) + 3 x y (x + y)
[]
[]
Error, (in unknown) invalid input: match expects its 2nd argument, vv, to be of type {name, set(name)}, but received x+y
[]

***

 

  How to get the correct powers of x, y, and (x+y)? Since the power of x+y is negative, it cannot be absorbed into x and y.

 

Thank you!

Hi,

  I have an expression as p in the following. I would like to extract the coeffient with x^n*y^m and x^(n+2)*y^(m+2), however, coeff comand does not work...

 

***

p:=3*x^n*y^m+4*x^(n+2)*y^(m+2)+k*x^(n+2)*y^(m+2);
coeff(p,x,n);

***  

gives me

***

n m (n + 2) (m + 2) (n + 2) (m + 2)
3 x y + 4 x y + k x y
/ n m (n + 2) (m + 2) (n + 2) (m + 2) \
coeff\3 x y + 4 x y + k x y , x, n/

***

 

What is the correct command to get the coefficients? Thank you very much

Hello,

 

  I have a question. Consider

 

fsolve(x^2+3*x+1=3, x);

 

  I want to save the two roots into two variables. What kind of commend shall I use? 

 

P.S. My further aim comes from solving an equation without analytical solution. Therefore I cannot plug in the solution formula. 

 

 

I have 20 datapoints in two groups. I may name them as f[1],...,f[10];g[1],...,g[10]. f[1]:=[1.2,3.5] etc

I would like to plot these 20 points

(1) in one plot

(2) f[1]~f[10] in one color; g[1]~g[10] in another color.

 

I checked http://www.maplesoft.com/support/help/Maple/view.aspx?path=plots%2fpointplot

and did not get the point :(

 

Do you any suggestion what can I do to realize the aims (1) and (2)?

 

Thank you very much in advance!

Hi, 

 

  I tried to use generated random as following

*** 

for j from 1 to 5 do
    c:=rand(0..1):
    d:=c();
    print(`random number`,c(),d);

    if c()=1 then

       print(`Y`)
    else
     print(`N`);
    end if;
  end do:

***

 

  The output is

 

****

                      random number, 1, 0

                               Y

                      random number, 1, 1

                               Y

                      random number, 1, 1

                               N

                      random number, 1, 1

                               N

                      random number, 0, 0

                               N

****

  Why the output numbers in one line are different? And Using "if" sentence seems do not correspond to the printed "c()" value..

 

Thank you very much in advance!

 

5 6 7 8 9 10 Page 7 of 10