vv

14187 Reputation

20 Badges

10 years, 280 days

MaplePrimes Activity


These are answers submitted by vv

f must be monotonic and unbounded.
Computing diff(f,x) it follows that   k∈(-∞,0)∪[3/2,+∞)

 

No need for a "real" algorithm; a double loop is enough.
(unless you are looking for best speed, but the gain would be small).

restart;
# 1 < h < k <= n
n:=30:
a:=1/1000:
X:=sort(LinearAlgebra:-RandomVector(n, generator=rand(0..10^3)));

t:= (h,k) -> min(X[k]-X[k-1], (X[h+1]-X[h])/(n+1-k)) * (n+1-k)*(n+k-2*h):
A := Matrix(n, (h,k)->`if`(h<k and h>1, t(h,k), -infinity)):
h,k:=max[index](A):
`if`( a*n*add(X) <= A[h,k], ['h'=h,'k'=k], FAIL);

 

The first two (iterated) limits do not exist, because the inner limits do not exist.
Maple answers correctly:
f:=(x+y)*sin(1/x)*sin(1/y);
limit( f, x=0); # ==> an interval

The last limit is 0 (provided that x,y are real; the limit does not exist in C);

limit(f, {x=0, y=0});  # ==> 0

Yes, it's a bug.

A := <"11",12,13;21,"22",23>:
DocumentTools[Tabulate](A, width=40, fillcolor=((x,i,j)->`if`(irem(j,2)=1,cyan,red)) ):  #ok

DocumentTools[Tabulate](A, width=40,      color=((x,i,j)->`if`(irem(j,2)=1,cyan,red)) ):  # only the strings are colored

 

 

Here is the direct approach, i.e. defining the procedures.

P := proc(t) option remember; a*ED(t - 1) + P(t - 1)   end;
ED := proc(t) option remember; DC(t) + DF(t) end;
DC := proc(t) option remember; c*(P(t) - P(t - 1)) end;
DF := proc(t) option remember; b*(F - P(t)) end;
a := 1;
c := 0.75;
b := 0.2;
F := 100;
P(0) := F;
P(1) := F + 1;

P(10), DF(10);

     99.38828842, 0.122342316

plot( [seq([t,P(t)],t=0..100)]);  # you may want to add style=point

In principle, Student:-Precalculus:-CompleteSquare should work but in this case it complicates things.
I prefer to use my generalized version:

SQR:=proc(P::polynom(anything,x), x::name)
local n:=degree(P,x)/2, q,r,Q,R,k;
if not(type(n,posint)) then error "degree(P) must be even" fi;
Q:=add(q[k]*x^k,k=0..n-1) + sqrt(lcoeff(P,x))*x^n;
R:=add(r[k]*x^k,k=0..n-1); 
solve({coeffs(expand(P-Q^2-R),x)}, {seq(q[k],k=0..n-1),seq(r[k],k=0..n-1)});
eval(Q,%)^2+eval(R,%)
end:

expr1:=-lambda-(1/2)*kappa__c-gamma__p-(1/2)*sqrt(-16*N*g^2+4*lambda^2-8*lambda*gamma__p+4*lambda*kappa__c+4*gamma__p^2-4*gamma__p*kappa__c+kappa__c^2):

evalindets(expr1, sqrt, t -> SQR( op(1,t), lambda)^op(2,t));

 

{seq(msolve({a = k, a*b = 2391}, 10000), k = 1 .. 9999)};

 

with(ImageTools): 
img0:=Read("smile.jpg"):   str:="Just a test!":
img1:=Scale(img0,1..50):
img:=Create(400,400,channels=3,background=white):
simg:=(x,y) -> SetSubImage(img,img1, min(max(floor(400-400*y-25),1),350), min(max(floor(400*x-25),1),350)):
Explore( plot(x^2,x=0..1, background=simg(a,a^2), axes=none, title=str[1..floor(15*a)]), a=0..1., animate,loop,autorun);

(The file "smile.jpg"  must be in the current directory).

Your system has a sigularity at t=0.
Just replace in ICS:  S(0) = 30 with say S(0.001) = 30  etc. It will work.
 

It was answered recently here.

You cannot use the operator * as a name. So, use  beta[`*`], or even better `beta__*`.

Also, remove the last comma in params.
 

In Maple there are many options for numerical integration (including compiled external libraries) which usually can increase considerably the speed. You should choose the proper ones for your case. Read the help pages:

?evalf,int

and also the provided links.

# The coordonates for the center of B is (x, r+d).
x^2 + (d+r)^2 = (R+r)^2;
solve(%,x);
u := factor(%[1]);

# The coordinates of the contact are:
R/(R+r) * <u, d+r>;

 

 

a:=1; b:=2; c:=3;  # semi axes
plot3d([a*cos(theta)*sin(phi),b*sin(theta)*sin(phi),c*cos(phi)],
theta=0..2*Pi,phi=0..Pi,scaling=constrained,axes=boxed);

For a=b=c=1 (as in your code) you have a sphere.

restart;   # Continuous roots w1(k)..w5(k) of a polynomial (wrt parameter k in 0..1)
with(plots):
f := -135/4*w^5+369/16*w^3*k^2+47/4*I*w^4-93/16*I*w^2*k^2+w^3-2/3*w^3*k*B-27/16*k^4*w+3/16*I*k^4-1/3*w*k^2+2/9*k^3*w*B:
B0:=1:
ini:=fsolve(eval(f,[B=B0,k=1/2]),w):
ode:=diff(eval(f,[w=W(k),B=B0]),k):
solode:=seq(dsolve({ode,W(1/2)=ii},numeric),ii=[ini]):
display(Matrix(2,5,
        [ [seq( odeplot(solode[i], [k,Re(W(k))], k=0..1,title=w[i]), i=1..5)],
          [seq( odeplot(solode[i], [k,Im(W(k))], k=0..1), i=1..5)] ]
),thickness=3);

 

First 55 56 57 58 59 60 61 Last Page 57 of 122