gulliet

241 Reputation

6 Badges

16 years, 238 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by gulliet

You can use convert() to go from one form of an expression to another form that is mathematically related to the original one. For instance, you can express the result as a product of factorials in place of the Beta() function. 97_intbetaconvertgammafactorial.jpg Regards, -- Jean-Marc
You can use convert() to go from one form of an expression to another form that is mathematically related to the original one. For instance, you can express the result as a product of factorials in place of the Beta() function. 97_intbetaconvertgammafactorial.jpg Regards, -- Jean-Marc
John, Thank you for clarifying this point. Of course you are right: the assuming clause does not change anything in my first three examples, as I could have checked by myself, 97_solveineqreabydefault.jpg or pay more attendion to the fine print of the documentation that states:
In general, variables and parameters will automatically be assumed to be real-valued in the context of one or more inequalities.
(solve/ineqs -> Description -> 2nd line) Regards, -- Jean-Marc
John, Thank you for clarifying this point. Of course you are right: the assuming clause does not change anything in my first three examples, as I could have checked by myself, 97_solveineqreabydefault.jpg or pay more attendion to the fine print of the documentation that states:
In general, variables and parameters will automatically be assumed to be real-valued in the context of one or more inequalities.
(solve/ineqs -> Description -> 2nd line) Regards, -- Jean-Marc
I use Filtered HTML, copy and past my code in < pre > and < /pre > directives and use the file manager to include some copy of the screen in jpeg format (full size, the code for medium and small seems to be broken). Regards, --Jean-Marc
I use Filtered HTML, copy and past my code in < pre > and < /pre > directives and use the file manager to include some copy of the screen in jpeg format (full size, the code for medium and small seems to be broken). Regards, --Jean-Marc
[ why is the Maple tag not working? ]
The real question might be, "Does Maplesoft care at all about the issue?" The problem (and possibly some related issues about links to images being broken) has been reported in this very forum several weeks ago and ... nothing, not a word from Maplesoft (at least to confirm whether the problem exists). Regards, --Jean-Marc
[ why is the Maple tag not working? ]
The real question might be, "Does Maplesoft care at all about the issue?" The problem (and possibly some related issues about links to images being broken) has been reported in this very forum several weeks ago and ... nothing, not a word from Maplesoft (at least to confirm whether the problem exists). Regards, --Jean-Marc
Also, you might be interested in the function time(). Below, we have added a counter for the number of iterations and we display the overall cpu time taken so far.
S := []: idx := 0: tm := time():
for alpha from 0 to 3 do 
  for beta from 0 to 2 do 
    idx := idx + 1;
    printf("Iter #%d, alpha = %d, beta = %d", idx, alpha, beta);
    S := [op(S), fsolve({eq1,eq2},{x,y})];
    printf(", %f seconds.\n", time() - tm); 
  end do; 
end do; 

Iter #1, alpha = 0, beta = 0, 0.602000 seconds.
Iter #2, alpha = 0, beta = 1, 1.120000 seconds.
Iter #3, alpha = 0, beta = 2, 1.648000 seconds.
Iter #4, alpha = 1, beta = 0, 2.283000 seconds.
Iter #5, alpha = 1, beta = 1, 2.925000 seconds.
Iter #6, alpha = 1, beta = 2, 3.523000 seconds.
Regards, --Jean-Marc
Also, you might be interested in the function time(). Below, we have added a counter for the number of iterations and we display the overall cpu time taken so far.
S := []: idx := 0: tm := time():
for alpha from 0 to 3 do 
  for beta from 0 to 2 do 
    idx := idx + 1;
    printf("Iter #%d, alpha = %d, beta = %d", idx, alpha, beta);
    S := [op(S), fsolve({eq1,eq2},{x,y})];
    printf(", %f seconds.\n", time() - tm); 
  end do; 
end do; 

Iter #1, alpha = 0, beta = 0, 0.602000 seconds.
Iter #2, alpha = 0, beta = 1, 1.120000 seconds.
Iter #3, alpha = 0, beta = 2, 1.648000 seconds.
Iter #4, alpha = 1, beta = 0, 2.283000 seconds.
Iter #5, alpha = 1, beta = 1, 2.925000 seconds.
Iter #6, alpha = 1, beta = 2, 3.523000 seconds.
Regards, --Jean-Marc
Writing the main sequence as follows should help you to het an idea of what the program is doing and how much computations (loops) have been done.
restart:with(plots):
mu:=0.1:
rs:=((x+mu)^2+y^2)^0.5:
re:=((x+mu-1)^2+y^2)^0.5:
Q:=beta/10*(1-mu)*(cos(alpha/100))^2:
S:=(x+mu)*cos(alpha/100)+y*sin(alpha/100):
T:=-(x+mu)*sin(alpha/100)+y*cos(alpha/100):
eq1:=(1-mu)*(x+mu)/rs^3+mu*(x-mu+1)/re^3-x=Q*S/rs^3:
eq2:=(1-mu)*y/rs^3+mu*y/re^3-y=Q*T/rs^3:
S := []: 
for alpha from 0 to 9 do 
  for beta from 0 to 2 do 
    printf("Computing alpha = %d and beta = %d\n", alpha, beta);
    S := [op(S), fsolve({eq1,eq2},{x,y})]; 
  end do; 
end do; 
pts:=seq(subs(i, [x,y]), i=S):
P:=pointplot({pts},axes=boxed,symbol=circle, color=black):
P;

Computing alpha = 0 and beta = 0
Computing alpha = 0 and beta = 1
Computing alpha = 0 and beta = 2
Computing alpha = 1 and beta = 0
Computing alpha = 1 and beta = 1
Computing alpha = 1 and beta = 2
Computing alpha = 2 and beta = 0

[.... deleted rest of the the output and the resulting plot ....]

Regards, --Jean-Marc
Writing the main sequence as follows should help you to het an idea of what the program is doing and how much computations (loops) have been done.
restart:with(plots):
mu:=0.1:
rs:=((x+mu)^2+y^2)^0.5:
re:=((x+mu-1)^2+y^2)^0.5:
Q:=beta/10*(1-mu)*(cos(alpha/100))^2:
S:=(x+mu)*cos(alpha/100)+y*sin(alpha/100):
T:=-(x+mu)*sin(alpha/100)+y*cos(alpha/100):
eq1:=(1-mu)*(x+mu)/rs^3+mu*(x-mu+1)/re^3-x=Q*S/rs^3:
eq2:=(1-mu)*y/rs^3+mu*y/re^3-y=Q*T/rs^3:
S := []: 
for alpha from 0 to 9 do 
  for beta from 0 to 2 do 
    printf("Computing alpha = %d and beta = %d\n", alpha, beta);
    S := [op(S), fsolve({eq1,eq2},{x,y})]; 
  end do; 
end do; 
pts:=seq(subs(i, [x,y]), i=S):
P:=pointplot({pts},axes=boxed,symbol=circle, color=black):
P;

Computing alpha = 0 and beta = 0
Computing alpha = 0 and beta = 1
Computing alpha = 0 and beta = 2
Computing alpha = 1 and beta = 0
Computing alpha = 1 and beta = 1
Computing alpha = 1 and beta = 2
Computing alpha = 2 and beta = 0

[.... deleted rest of the the output and the resulting plot ....]

Regards, --Jean-Marc
Not sure whether this is what you are looking for:
plots:-implicitplot((x^2-y^2)/(x^2+y^2), x = -.5 .. .5, 
y = -.5 .. .5, grid = [30, 30]);
97_rationalinplicitplot.jpeg Regards, --Jean-Marc
Not sure whether this is what you are looking for:
plots:-implicitplot((x^2-y^2)/(x^2+y^2), x = -.5 .. .5, 
y = -.5 .. .5, grid = [30, 30]);
97_rationalinplicitplot.jpeg Regards, --Jean-Marc
To factorize a polynomial, you can use the function factor() and specify the field extension over which to factor in its second argument. For instance,
> factor(x^2+36, complex);

> factor(x^2+36, I);

> help("factor");
Regards, --Jean-Marc
2 3 4 5 6 7 8 Last Page 4 of 15