John May

Dr. John May

3026 Reputation

18 Badges

17 years, 320 days
Maplesoft
Pasadena, California, United States

Social Networks and Content at Maplesoft.com

Maple Application Center
I have been a part of the Mathematical Software Group at Maplesoft since 2007. I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997. I currently work on symbolic solvers and visualization as well as other subsystems of Maple.

MaplePrimes Activity


These are answers submitted by John May

A nice limited way to avoid the message is to wrap solve in a proc.

wrapsolve := proc () return solve(args) end proc;
solve(sin(x*y) < 0);
#Warning, solutions may have been lost
wrapsolve(sin(x*y) < 0);
#No warning

(solve checks if it is being called directly from the top level before issuing the warning - this is an easy way to trick it into not issuing the message)

There are a lot of problems with the code you have posted.  This is my attempt to fix it.

psi_0 := proc(n,x) # not used
	(1/sqrt(sqrt(pi)*2^n*factorial(n))*exp(-x^2/2)*HermiteH(n,x));
end proc;

psi := proc(n, x)
	exp(-1/2*x^2)*HermiteH(n, x)/sqrt(sqrt(Pi)*2^n*n!);
end proc;

psi2_0 := proc(a,x) # not used
	(1/sqrt(sqrt(Pi)*2^a*factorial(a))*exp(-x^2/2)*HermiteH(a,x));
end proc;

psi2 := proc(a, x)
    exp(-1/2*x^2)*HermiteH(a, x)/sqrt(sqrt(Pi)*2^a*a!);
end proc;

 result := proc(n,a)
    psi(n,x)*psi2(a,x);
 end proc;

for n from 0 to 2 do
	for a from 0 to 2 do
		print(evalf(int(result(n,a),x=0..infinity)));
	end do;
end do;

 

The GlobalOptimization toolbox is a seperately purchased addon to Maple.  It doesn't look like you have it installed.

I generally avoid the "File > Export as > LaTeX"  menu since by design it is trying to reproduce the exact formatting of a Maple worksheet in LaTeX. (and, apparently, it appears to have other issues)

If you have mathematical expressions in Maple and you want to export them you can use the latex command and then paste the result of that into your latex document.

latex({solve(a*x^2+b*x+c, x)});

If you are exporting actually code, I would first cut and paste it into a "Code Edit Region" and then paste that code into a preformated (verbatim) region in your latex document.

A key first step is to correct the input: there is a x(3-2*x) that needs to be changed to x*(3-2*x). Then you can solve for T in terms of x and plot:

eq := (1/4)*x*(3-2*x)^2/(1-x)^3 = 18325.73901+exp(36.58420421-10902.09286/T);
expr := rhs(isolate(eq, T));
a := fsolve(expr = 300, x = 0 .. 1);
b := fsolve(expr = 800, x = .9 .. 1.1);
plot(expr, x = a .. b);

SpatterPlot requires a list of colors and you've provided just a single color.  The error message does a poor job formatting things, so it's a more cryptic than necessary, unfortunately.

SpatterPlot( [barvy], symbol="box");

will work

John

The best tool for this sort of polynomial system is probably ?SolveTools:-SemiAlgebraic  it symbolically finds the real solutions to a set of equations and inequalities.

sols := SolveTools:-SemiAlgebraic({eq1,eq2,r>0,x>0}); # large
evalf[25](sols);

 

John

If A is going to be between 0 and 1, you can get a better formula for the integral with:

E := int(1/(1+A*cos(2*Pi*x))^3, x = 0 .. 1, allsolutions) assuming A>0, A

Then you can generate the values with the ?seq command:

F := [seq(E, A = 0.1e-2.. 1, .1)];

 

John

Edit your file to be in the form:

edges := {{1,2},{1,3},...,{99999,99987},{99999,100000}};

then since it is now in Maple syntax, you just need to read it in with the ?read command.

read("C://Desktop//list.dat");

 

John

Check the help page: ?Groebner,Basis to see you aren't calling the Basis command exatly right.  The 'tord' argument directs to command to choose its own basis and then assign it to the variable 'tord' after it returns:

G1 := Basis({expand(w*I2[1]),expand(w*I2[2]), expand((1-w)*J2[1])}, 'tord'):
tord;
                         plex(y, x, w)

The last argument is actually ignored in that case.  I suspect that you want the following:

G2 := Basis({expand(w*I2[1]),expand(w*I2[2]), expand((1-w)*J2[1])}, lexdeg([w],[x,y]));

 

John

A RootOf() represents a generic/unspecified root of its argument.  So it does satisfy the expression in its argument.  For example:

p:=x^6+randpoly(x,degree=5,terms=3)+1;
r := RootOf(p,x);
eval(p, x=r);
evala(Normal(%)); #=0

Various other commands under ?evala allow you to compute with generic polynomial RootOfs: i.e. calculations that would be valid for any specific root of the equation.   You only need to use ?allvalues if/when you need specific values of the roots (for example, when you want to find all the positive roots).

John

Sometimes Optimization is able to do something with overconstrained systems. One way to try this is:

   read("Cvector_with_a.m"):
   infolevel[Optimization]:=4;
   Optimization:-Minimize(1,{seq(C[i]=0, i=1..9), c1>=1,c<=900,c2>=1,c2<=900,
c3>=1,c3<=900,c4>=1,c4<=900,c5>=1,c5<=900,c6>=1,c6<=900,c7>=1,
c7<=900,hb>=0.01,hb<=900, a1>=1.5, a1<=1.6, a2>=5,a2<=5.1},
feasibilitytolerance=10^(-3), iterationlimit=1000, initialpoint=[a1=1.52, a2=5.04,
c=1,hb=0.012,c1=46.9, c2=9.60, c3=7.15,c4=56.1,c5=18.9,c6=2.65,c7=7.74]);

Unfortunately, that does not appear to converge on a solution. You could play around with the various ?Optimization,Minimize options, the linear constraints on the variables, and the precision of the initial point.  You can also move the C[i]=0 constraints to the objective function and try that instead.  One of these might work for you.

Good Luck,

John

Use the ?seq command or a ?for loop.  I like seq() personally:

with(geom3d):
L:=[[-5, -5, 8], [-5, -1, 10], [-5, 3, 10], [-5, 7, 8], [-5, 8, -5], [-5, 8, 7], [-5, 10, -1], [-5, 10, 3], [-1, -5, 10], [-1, 7, 10], [-1, 10, -5],
[-1, 10, 7], [3, -5, 10], [3, 7, 10], [3, 10, -5], [3, 10, 7], [7, -5, 8], [7, -1, 10], [7, 3, 10], [7, 7, 8], [7, 8, -5], [7, 8, 7], [7, 10, -1],
[7, 10, 3], [8, -5, -5], [8, -5, 7], [8, 7, -5], [8, 7, 7], [10, -5, -1], [10, -5, 3], [10, -1, -5], [10, -1, 7],
[10, 3, -5], [10, 3, 7], [10, 7, -1], [10, 7, 3]]; seq(point(cat(`A_`,i),op(L[i])),i=1..nops(L)); eqS:=Equation(sphere(S,(x-1)^2 + (y-1)^2 +(z-1)^2 -121=0,[x,y,z],'centername'=T)); seq(TangentPlane(cat(`P_`,i),S,cat(`A_`,i)),i=1..nops(L)); seq(sort(Equation(cat(`P_`,i),[x,y,z])),i=1..nops(L));

 

John

Unfortutately, due to subtleties in how Maple represents symbolic products and quotients internally (see ?ProgrammingGuide,Chapter03 ), it is hard to refer to just part of a product using subs.  By using the whole product on the left hand side of the substitution, you can get the desired result:

f:=cos(sqrt(g)*sqrt(m+M)/(M^(3/2)*sqrt(l))*t);
subs(sqrt(g)*sqrt(m+M)/(M^(3/2)*sqrt(l))*t=omega*t,f); 

 

John

You can take a look at exactly what it is doing by using ?showstat

showstat(LinearAlgebra:-MinimalPolynomial);

It appears to be directly computing the linear dependencies on the powers of the matrix A by flattening A and its powers into rows of a larger n by n^2 matrix (systab in the code).

I actually wonder whether recent (ish) improvments in ?LinearAlgebra:-CharacteristicPolynomial would make it faster just call that and then ?PolynomialTools:-SquareFreePart

2 3 4 5 6 7 8 Page 4 of 11