vv

14027 Reputation

20 Badges

10 years, 44 days

MaplePrimes Activity


These are replies submitted by vv

@acer 

It is interesting to see how/when simplify/size is able to shrink an expression (polynomial here):

restart;
n:=75:
E1 := add(i*x[i],i=1..n)*add(i^2*x[i],i=1..n)+add(x[i]^2,i=1..n):
E2:=(x^2-x+2)^30+x+1:
E3:=(x^2-x+2-y)^25+x+1+y:
E:=[E1,E2,E3]:
                          
for e0 in E do
e1:=expand(e0):
e2:=simplify(e1,size):
print(length~([e0,e1,e2]));
od:

                      [3009, 84700, 44505]
                        [34, 1287, 1287]
                       [42, 15924, 6938]

 

@TomM 

Such a phenomenon is normal when working with floats.
If you convert the foats to exact rationals (i.e. 0.333 becomes 333/1000), then the coefficient of x^9 happens to be exactly 0
(btw, why didn't you rename your vars for us?, a search & replace is so simple ...).

Using floats, the coeff of x^9 may of course be a (usually) small nonzero (due to cancelations, catastrophic or not).
But in practice when a float such as -53417.4875669262 appears as input, it usually means that the actual quantity could have been -53417.48756692623... or -53417.48756692618... and in such a case the coefficient of x^9 could be of course <> 0. It is very simple!

@Kitonum 

An unpleasant fact is that the plot3d routine is not able to draw this cylinder properly
when z is given explicitely.

expr:=(x-y)^2+(y-z)^2+(z-x)^2 = 3:
z1,z2:=solve(expr,z):
plot3d([z1,z2],x=-3..3,y=-3..3,grid=[100,100], scaling=constrained);

plot3d([z1,z2],x=-3..3,y=x-sqrt(2)..x+sqrt(2),grid=[100,100], scaling=constrained);






@Bachatero 

Unfortunately this is theoretically impossible due to Richardson's_theorem.

Note that even now Maple is not useless here:

E:=-n*mu+ln(product(mu^x[i]/factorial(x[i]), i = 1 .. n)):
E4:=eval(E,n=4):
extrema( E4,{},mu,'sol'):sol;


It remains to extrapolate ...


For other curves, use Path(...) instead of Line(...). Type
?PathInt
for examples.

The integrals of P dx + Q dy ...   are line integrals. See
?LineInt

@1valdis 

As I understand (not being a specialist or working in string theory) the link refers to a projection of a higher dimensional manifold into R^3.
Before asking such a question you should provide the wanted projection, i.e. the parametric surface, preferable in Maple notation.

 

@acer 

Yes, I forgot about it. So, no need to return unevaluated by hand as I did.

@Bachatero 

Maple is not intended (prepared?) for such manipulations.
Just consider:

restart;
fn:=sum(x[i]^2,i=1..n);
f5:=eval(fn,n=5);

diff(fn, x[1]) assuming n::posint;
                               0
diff(f5, x[1]);
                             2 x[1]

[You can't use Maple e.g. in Functional Analysis. Here one needs pen+paper+brain for the moment].

@WilburC 

If f is a procedure (such as f:=sin) then

evalf(Int(f, x=0..1))

is incorrect because actually f has nothing to do with x.
(even if Maple could have been less strict and accept it).

Executing
evalf(Int(f, 0..1))
Maple will call f only with numeric arguments
which is not the case for
evalf(Int(f(x), x=0..1))
where f(x) is evaluated first, x being a symbol, not a numeric.
Your initial g called with a nonnumeric argument will produce an error, that's why it must be "unevaluated".
My previous version returns unevaluated when the argument is nonnumeric, so it needs not being unevaluated..

 

 

@WilburC 

Probably you have an older version of Maple.
Search for "premature evaluation" to understand the role of the quotes here.

Here is a version of g which does not need quotes.

g:=proc(a)
local y;

if type(a,numeric) then fsolve(a*y^2-sin(y),y=2)
else 'g'(a) end if;
end proc:

evalf( Int(g(x),x=1..2));

 

 

@Bendesarts 

This is certainly possible using directly components (instead of Explore which uses such components internally).
Of course using Explore is easier but a little limited in this case; I would switch to components only if the present simple solution is definitely inacceptable.

@Carl Love 
You mean of course
evalf(Int(x-> h(g(x)), 1..2));

 

@Bachatero 

It would not be difficult to write a procedure `combine/product`  to transform e.g.

product(a^p[i]*b[i],i=1..n);
into
a^sum(p[i],i=1..n)*product(b[i],i=1..n);
but I am not sure whether it's worth it. Note that actually the second expression is longer.

 

 

What has to do ec1 with your question?

@Markiyan Hirnyk 

First 138 139 140 141 142 143 144 Last Page 140 of 177