vv

13837 Reputation

20 Badges

9 years, 318 days

MaplePrimes Activity


These are answers submitted by vv

You probably mean

Int((sin(theta)/cos(theta))^(2*p-1) * 2, theta=0..Pi/2) = Pi/sin(p*Pi); # 0 < p < 1
value(%);

Maple V should do it. If not, try a change of variables tan(theta) = t;  or sin(theta)=sqrt(t).

restart;
pde := 
[-(diff(u(x, t), t, t))-(diff(u(x, t), x, x))+u(x, t) = 2*exp(-t)*(x-(1/2)*x^2+(1/2)*t-1), 
u(x, 0) = x^2-2*x, 
u(x, 1) = u(x, 1/2)+((1/2)*x^2-x)*exp(-1)-((3/4)*x^2-(3/2)*x)*exp(-1/2), 
u(0, t) = 0
, D[1](u)(1,t) = 0
]:
pdsolve(pde);

It is strange that the (same) solution is obtained if the last condition is removed.

 

The result of the solve command is a Cylindrical Algebraic Decomposition (CAD) (google for this).
Actually solve calls SolveTools:-SemiAlgebraic (for polynomial inequalities & equalities over Q).
The order of the variables [x,y] or [y,x] is used for the type of the resulting cells. For two variables they are

{a <= x< =b, f(x) <= y <= g(x)}
or
{a <= y <= b, f(y) <= x <= g(y)}.  (or any <= replaced by < or =).

This is explained at ?SemiAlgebraic. See also ?RegularChains.

P.S. SolveTools:-Semialgebraic  is a very powerful command. Unfortunately it may be very slow. In your example it can solve the problem for a=parameter, resulting a large piecewise expression.

 

For the intersection of two lines geom3d tests whether the determinant of the system is 0.
In the case of floats, due to roundoff errors, a small real such as 1e-10  could appear instead of 0.

In principle, one cannot decide whether two lines in space intersect if the lines are known only approximatively; the distance between them could be e.g. 10^(-15).

restart;
f:=exp(-sec(t))*cos(t)/(-1/4+sin(t)^2):
g:=convert(series(f,t=Pi/6,3), polynom):
int(f-g, t = 0 .. Pi/2, numeric) + evalf(int(g, t = 0 .. Pi/2, CPV));

                         -0.6159737938

In my opinion Maple cannot be strictly separated from maths, so math questions should be OK (provided that Maple can/will be used for a solution).

First note that there is not such thing as "global inverse" of f, unless f (supposed to be C^1) is strictly monotonic.
If we know that f is strictly monotonic in [a,b], then its inverse will be
RootOf(f(x)-y, x, a..b),  where y is in the interval [min(f(a),f(b)), max(f(a),f(b))].

To find the intervals of monotonicity we need the real roots of f'(x). If solve is able to find all of them, we are done.
Of course the set of the roots could be infinite (even in a bounded interval). If a,b are two consecutive roots of f' then f is invertible (<==> strictly monotonic) in [a,b] as above.
 

 

 

f is continuous in R (provided that f(0) = 0), differentiable in R \ {0}, so, f ' (0) does not exist [and you must use the definition for this].

Please note that the inexistence of the limit of f ' (x) at x=0 is not the same with the non-differentiability of f at 0.

 

restart;

nor:=LinearAlgebra:-Norm:

c := t  -> (1 - cos(Pi*t))/2:

c1 := u -> solve(c(t_)-u,t_):

g:= (d,m,t) -> <t, seq(c(m^k*t),k=1..d-1)>;

proc (d, m, t) options operator, arrow; `<,>`(t, seq(c(m^k*t), k = 1 .. d-1)) end proc

(1)

plot(c, 0..5);

 

g(3,10,t);
plots:-spacecurve(g(3,10,t),t=0..1, numpoints=10000,color=red);

Vector(3, {(1) = t, (2) = 1/2-(1/2)*cos(10*Pi*t), (3) = 1/2-(1/2)*cos(100*Pi*t)})

 

 

T := proc(x::{list,Vector},m::posint)
local d:=numelems(x), t:=Vector(d),td,N,i,j;
t[1]:=floor(m*x[1]);
for i from 2 to d do
  N:= add(t[j]*m^(i-1-j), j=1..i-1);
  td:=c1( (-1)^N*(x[i]-1/2)+1/2 );
  t[i]:=floor( td * m );
od;
t[d]:=td*m;
evalf(add(t[i]/m^i,i=1..d));
end:  
 

Digits:=20:
d:=5: m:=100:   # check
to 50 do
  x:=LinearAlgebra:-RandomVector(d,generator=rand(0.0..1.0) ):
  tx:=T(x, m):
  gt:=g(d,m,tx):
  nor(x-gt,2)<sqrt(d-1)/m: evalf[10](%); print(Vector[row](x-gt),%,evalb(%));
od:

Vector[row](5, {(1) = 0.2245175949597057137e-2, (2) = 0.178700890374408893e-2, (3) = 0.502818085808100077e-2, (4) = 0.316188321077255800e-2, (5) = -0.6998708000e-15}), 0.6596538793e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.614205816283349693e-2, (2) = 0.58272696109815946e-3, (3) = 0.495928784131864040e-2, (4) = 0.381567203511813577e-2, (5) = 0.9414680500e-12}), 0.8787396552e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.586928409452430485e-2, (2) = 0.185056101232407102e-2, (3) = -0.1082881038373104706e-1, (4) = -0.3942168588339884894e-2, (5) = -0.4083914300e-12}), 0.1306433693e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.319600571683232791e-2, (2) = 0.1940509658645814175e-2, (3) = -0.653193795808389261e-2, (4) = -0.371827178092912454e-2, (5) = 0.2294257300e-11}), 0.8394747691e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.403959205986585828e-2, (2) = -0.1079273520512657950e-1, (3) = 0.355004577119255623e-2, (4) = -0.552511049641019727e-2, (5) = -0.9044114000e-13}), 0.1326390245e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.1243254335959312306e-2, (2) = -0.135800350252244505e-2, (3) = 0.473531960625732755e-2, (4) = 0.190711504155047987e-2, (5) = -0.4099288000e-13}), 0.5426803333e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.261962070266442793e-2, (2) = 0.171242859980398808e-2, (3) = 0.472919563680099705e-3, (4) = 0.4077468707718304194e-2, (5) = 0.1172276170e-11}), 0.5161804753e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.70425142720743796e-3, (2) = 0.371442276276967716e-2, (3) = 0.3207496584664778946e-2, (4) = 0.327778569310831046e-2, (5) = -0.8894589100e-12}), 0.5943468678e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.619845830097949042e-2, (2) = -0.3816343176658510635e-2, (3) = 0.255797091847471485e-2, (4) = 0.754622514135589480e-2, (5) = 0.4083021500e-12}), 0.1079231623e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.275882001720814820e-2, (2) = -0.113703586090948656e-2, (3) = -0.314753579794591941e-2, (4) = -0.670461269520757691e-2, (5) = -0.1070629390e-11}), 0.7985158197e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.310748361632089640e-2, (2) = 0.957346041346005009e-2, (3) = 0.296568346652236863e-3, (4) = 0.13644158538005765e-3, (5) = 0.2925298400e-12}), 0.1007046016e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.511755200815169579e-2, (2) = -0.231197153602198405e-2, (3) = 0.122532239719994439e-2, (4) = 0.1042815589001761737e-1, (5) = 0.1504406490e-12}), 0.1190724154e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.9399143835186173e-4, (2) = -0.183745957326462722e-2, (3) = -0.427579604196086895e-2, (4) = 0.589628853634182031e-2, (5) = 0.1389082070e-11}), 0.7512239504e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.451747602775906765e-2, (2) = -0.18087631646913584e-3, (3) = -0.441753325942565300e-2, (4) = -0.483896941010406977e-2, (5) = 0.3939638200e-12}), 0.7960560970e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.296209474675120431e-2, (2) = 0.642782211537201029e-2, (3) = -0.499917399430419126e-2, (4) = 0.239882013789489116e-2, (5) = 0.1268748590e-11}), 0.8990938834e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.268336241605795273e-2, (2) = 0.247738254723468146e-2, (3) = -0.311760622046606805e-2, (4) = -0.1103602126608338809e-1, (5) = 0.1577367720e-11}), 0.1203540993e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.60591631531697656e-3, (2) = 0.973038432364687423e-3, (3) = 0.241205747973921853e-2, (4) = 0.891126284059033480e-2, (5) = -0.2088726900e-12}), 0.9302825650e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.320902998616073463e-2, (2) = -0.100163300251327827e-2, (3) = 0.83748952784675779e-3, (4) = -0.258877667797425055e-2, (5) = -0.1425632680e-11}), 0.4324846300e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.479767050784526983e-2, (2) = -0.641702791126071034e-2, (3) = -0.209589326829079752e-2, (4) = 0.516914285221134588e-2, (5) = -0.1013133900e-12}), 0.9762617269e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.470543115375124229e-2, (2) = -0.438760161362192393e-2, (3) = 0.251639916895022527e-2, (4) = -0.124394006337165176e-2, (5) = -0.5434022500e-12}), 0.7019386150e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.235804118185165489e-2, (2) = 0.607772219611439259e-2, (3) = -0.359359187776981942e-2, (4) = -0.362090024481772109e-2, (5) = -0.2549344700e-12}), 0.8277915588e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.222007002543814218e-2, (2) = -0.19266088126927887e-3, (3) = 0.1838329070756913547e-2, (4) = -0.16227993312995806e-3, (5) = -0.3340775030e-11}), 0.2893374791e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.422005134521964257e-2, (2) = -0.194584250992639647e-2, (3) = -0.92984029266901054e-3, (4) = -0.38046948905607169e-3, (5) = 0.1621784000e-12}), 0.4754418622e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.72923453878922316e-3, (2) = -0.139804634320469602e-2, (3) = -0.29718662794632406e-3, (4) = -0.560421045991363441e-2, (5) = -0.5399395000e-13}), 0.5829392023e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.368685977669783485e-2, (2) = -0.373956751827731446e-2, (3) = -0.639498151574874456e-2, (4) = 0.1340857540050587714e-1, (5) = -0.4525906100e-12}), 0.1575636326e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.3078985582025345382e-2, (2) = 0.71049171296069372e-3, (3) = 0.542269145667356283e-2, (4) = -0.31978153021381634e-3, (5) = -0.1669304400e-12}), 0.6284329204e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.125321801628151357e-2, (2) = 0.688496424534676266e-3, (3) = -0.1590834201e-5, (4) = -0.28561582084002077e-3, (5) = 0.7879995500e-12}), 0.1458136362e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.187235009111001751e-2, (2) = 0.1393850477571501164e-2, (3) = 0.366115015658015357e-2, (4) = 0.361009340740225135e-2, (5) = -0.6332305600e-12}), 0.5646707793e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.156828627027680846e-2, (2) = -0.130132327224703670e-2, (3) = -0.104340521870953124e-2, (4) = 0.67928102725709501e-3, (5) = -0.3627550000e-14}), 0.2388112487e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.74353786025047025e-3, (2) = 0.317101011389826762e-2, (3) = 0.180693705013200166e-2, (4) = -0.2894566065450748756e-2, (5) = -0.4520790200e-12}), 0.4717169480e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.224321675021188086e-2, (2) = -0.166030766538155720e-2, (3) = 0.530173489916569672e-2, (4) = 0.261555980367242049e-2, (5) = 0.6999531000e-13}), 0.6537445140e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.177489617880375083e-2, (2) = 0.112559822704104403e-2, (3) = 0.155856332083461695e-2, (4) = 0.3523428502787770390e-2, (5) = 0.1577433130e-11}), 0.4388723716e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.142248928200009240e-2, (2) = -0.366317043660385106e-2, (3) = -0.275863834767106840e-2, (4) = 0.266928572960701061e-2, (5) = -0.7193998600e-12}), 0.5493401974e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.903253218527791813e-3, (2) = 0.760425612883232736e-2, (3) = -0.809816385216884054e-2, (4) = 0.200233217527449387e-2, (5) = 0.1313319900e-12}), 0.1132387608e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.269912109790725060e-2, (2) = 0.683589706601734925e-2, (3) = 0.750749259310287591e-2, (4) = -0.776618315016855834e-2, (5) = 0.9435919300e-12}), 0.1306486851e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.418256226678040169e-2, (2) = -0.550978964770481340e-2, (3) = -0.47706898189747461e-3, (4) = 0.1048590566434820137e-1, (5) = 0.1794301100e-12}), 0.1257113446e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.367774623133392882e-2, (2) = 0.338290688229710182e-2, (3) = -0.14497184375394752e-3, (4) = -0.231018536402677748e-2, (5) = -0.5805422100e-12}), 0.5507072686e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.308025432076038944e-2, (2) = 0.453505174176875314e-2, (3) = 0.333904919004368431e-2, (4) = 0.7255898944310806e-4, (5) = -0.7694659500e-12}), 0.6419437303e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.485697503452520250e-2, (2) = 0.686391456316770274e-2, (3) = 0.6784068578533270851e-3, (4) = 0.408053528967211488e-2, (5) = -0.8724029300e-12}), 0.9370940920e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.473633837121329318e-2, (2) = -0.1045583377707223185e-1, (3) = -0.3228661437095516013e-2, (4) = -0.2685323647052749672e-2, (5) = 0.1515649540e-12}), 0.1222262570e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.377933027792209362e-2, (2) = -0.551129857571372329e-2, (3) = -0.26092730504601421e-3, (4) = 0.95950207365360741e-3, (5) = 0.1770566570e-11}), 0.6756217627e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.76145764706622248e-3, (2) = -0.2390831790194682196e-2, (3) = -0.497098638379546841e-2, (4) = 0.58261853861024700e-3, (5) = -0.2536705870e-11}), 0.5598753824e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.30312958994790132e-3, (2) = 0.30543629043494512e-3, (3) = 0.577377433296877592e-2, (4) = 0.33606623697169290e-3, (5) = 0.2461563000e-12}), 0.5799533554e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.154052538043282555e-2, (2) = 0.337000037279360873e-2, (3) = 0.32661409377263359e-3, (4) = -0.560879683824746114e-2, (5) = 0.3804276500e-12}), 0.6730185711e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.392761758034173186e-2, (2) = -0.217276325877687460e-2, (3) = -0.935392453205133960e-2, (4) = -0.460279671189654340e-2, (5) = -0.3172334940e-11}), 0.1135027408e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.144432976285397077e-2, (2) = 0.108651745255581567e-2, (3) = 0.86678974009380951e-3, (4) = -0.569753959951737504e-2, (5) = -0.2314541300e-11}), 0.6039858490e-2 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.128131422607133849e-2, (2) = 0.680749855560426033e-2, (3) = 0.416695032117804010e-2, (4) = 0.6912351285026329273e-2, (5) = 0.2371383200e-12}), 0.1063615899e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = 0.193745529333707771e-3, (2) = 0.283962100082164068e-2, (3) = 0.201340260013797986e-2, (4) = 0.991047039966587666e-2, (5) = 0.2539255400e-13}), 0.1050581736e-1 < 0.2000000000e-1, true

 

Vector[row](5, {(1) = -0.105796763334716159e-2, (2) = -0.300733439200737383e-2, (3) = 0.561062685289715871e-2, (4) = 0.911453541107139415e-2, (5) = -0.1589016430e-11}), 0.1116768754e-1 < 0.2000000000e-1, true

 

Vector[row](%id = 18446744074331819414), 0.7833455316e-2 < 0.2000000000e-1, true

(2)

 


Download space-fill-quasi-sent.mw

F := k -> sum(i^k, i=1..n);

seems to be faster.

 

The exact solution (just for fun).

restart;

h:=1: g:=1:  r:=1/2:

v0:=sqrt(2*g*h):

T:= n -> v0/g*(1+r-2*r^n)/(1-r):

Too := v0/g*(1+r)/(1-r): # = T(infinity)

Y:=proc(t)
local n := floor( ln(-t*sqrt(2)*g*(1-r)/(4*sqrt(g*h))+1/2+(1/2)*r)/ln(r) ),
      tau:= t - T(n);
piecewise(t<Too, v0*r^n*tau - g/2*tau^2, 0)
end:

plot(Y(t), t=0..Too, size=[1200,800]);

 

Y(t);

piecewise(t < 3*sqrt(2), sqrt(2)*(1/2)^floor(-ln(-(1/8)*t*sqrt(2)+3/4)/ln(2))*(t-2*sqrt(2)*(3/2-2*(1/2)^floor(-ln(-(1/8)*t*sqrt(2)+3/4)/ln(2))))-(1/2)*(t-2*sqrt(2)*(3/2-2*(1/2)^floor(-ln(-(1/8)*t*sqrt(2)+3/4)/ln(2))))^2, 0)

(1)

Too;

3*2^(1/2)

(2)

 

Probably the designers considered that the color, linestyle, thickness are enough for the legend (which I also do).

Anyway, the symbols seem to be useless here because their exact position is not known.

You have the Physics package loaded. It redefines many things, including diff.
The conversion works as expected if you don't use the package (which is not needed in the worksheet).

First 71 72 73 74 75 76 77 Last Page 73 of 120