## 12915 Reputation

8 years, 355 days

## The probability of having 0 branch break...

The probability of having 0 branch breakings after 40 steps is

1-(1-0.02)^40 = 0.5542995960 (> 1/2)

If you want a simulation to compute the number of branch breaking, you should run your code N times (in a loop) and compute the average number of breaks. (N = 10000 or something).

map(factor,A);

or

factor~(A);

## Replace Flux by J:=Flux(vv, Sphere(<0...

Replace Flux by

J:=Flux(vv, Sphere(<0,0,0>, r), inert);

to see the integral.

Maple cannot compute it as it is. But if you change the order of integration (theta first, then phi)
(by hand or using IntegrationTools) ==>

Maybe in the near future Maple will do this automatically.

## latex()...

Yes, the LaTeX export is hard to edit.

I use only the latex(...) command  and paste the output in the .tex file. It also must be edited because it looks worse than the Maple output.
It is also possible redirect latex(...) to a file, see ?latex

## This one works...

uu:=pds:-value(u(x,t), output=procedurelist);
vv:=pds1:-value(v(x,t), output=procedurelist);
plot( [ 'log(rhs(uu(1,t)[3]))', 'log(rhs(vv(1,t)[3]))', t=0..1]);

## Maple has commands for Sturm polynomials...

Maple has commands for Sturm polynomials.

P :=x^6-4*x^3+x-2:

ss:=sturmseq(P, x);

sturm(ss,x,-3,3); #number of roots in (-3,3]

2

You can inspect the source code, e.g.:

interface(verboseproc=3);
print(sturmseq);
print(`sturm/sturmrem`);
print(sturm);

It also has the command

realroot(P,10^(-4));

for isolating the real roots (based on Descartes' rule instead of Sturm).

## co:=coeffs(p1-p2, [ln(E),ln(K),ln(L)]);s...

co:=coeffs(p1-p2, [ln(E),ln(K),ln(L)]);

seq(u_=0, u_=[co]);

## D(F) is the derivative function of F. Fo...

D(F) is the derivative function of F. For example, for F = sin, D(F) equals cos.

If you define an explicit function such as

F := sin

or

F:= x -> x^10;

and execute again your definition, the derivatives will be computed effectively.

BTW, subs is superfluous.

for m from 0 to n do
end do;

(I would not write such formulas in 2D math, but maybe I am too old).

## This is THE ART GALLERY problem invented...

This is THE ART GALLERY problem invented by the well known mathematician Victor Klee in 1973:

Find the fewest number of (stationary) guards needed to protect a polygonal gallery.

The following theorem is known.

To cover a polygon with n vertices, floor(n/3) guards are needed for some polygons, and sufficient for all of them.

This particular configuration could be solved with some combinatorics and a series of simplex-es.
If I remember correctly, a general algorithm for the minimal number of guards does not exist for the moment.

## a patch...

[attachment deleted]

It seems that there is a bug in plottools:-`transform/object`

I have included the altered procedure [one line only] in the startup code of the attached worksheet

(Maple 2015).

Edit: it's line 20, from

outdim := nops(t);

to

if [t]<>[] then outdim := nops(t) end if;

## Why don't you use theta0(z)  ( or t...

Why don't you use theta0(z)  ( or theta[0](z) ) instead of theta(z,0) ?

ode := diff(theta0(z), z, z)+theta0(z):
ibc:=theta0(0)=beta, D[1](theta0)(0)=0:
dsolve({ode,ibc});
theta0(z) = beta cos(z)

## The result of fsolve could be NULL (if n...

The result of fsolve could be NULL (if no solution found).

You should test this first, otherwise  NULL < 0   will produce the error.

## using simplex...

pts:=[3,7],[6,5],[5,3],[1,2],[7,1]:
population:=5,2,2,1,3:

res:=seq(x-pts[i][1] <=  a||i,i=1..nops([pts])),
seq(x-pts[i][1] >= -a||i,i=1..nops([pts])),
seq(y-pts[i][2] <=  b||i,i=1..nops([pts])),
seq(y-pts[i][2] >= -b||i,i=1..nops([pts])):
s:=simplex[minimize](c,[res]):
eval(["x"=x,"y"=y,"min"=c],s);
["x" = 5, "y" = 5, "min" = 51]

## I always prefer a homemade version: plot...

I always prefer a homemade version:

plot3d([u,(u^2-1)*cos(v)+1,(u^2-1)*sin(v)],u=1..2,v=0..2*Pi,
axes=normal,view=[-1..3,-4..6,-5..5],labels=[x,y,z],axes=boxed);

## degrevlex?...

What is degrevlex?

Use e.g.

G:=Basis(K, 'tord', variables={r,u,v,w}); tord;

 First 112 113 114 115 Page 114 of 115
﻿