Kitonum

21500 Reputation

26 Badges

17 years, 61 days

MaplePrimes Activity


These are answers submitted by Kitonum

Perhaps this is a bug. As a workaround use  CurveFitting:-LeastSquares  instead:

CurveFitting:-LeastSquares(pts1, pts2, x, curve = 3*x+a);
                                   
 -61/3+3*x

restart;

Ec := (Ems+I*Eml)*(1+((Ems+I*Eml)/Ef-1)*Zeta*phi/((Ems+I*Eml)/Ef+Zeta))/(1-((Ems+I*Eml)/Ef-1)*phi/((Ems+I*Eml)/Ef+Zeta));

a:=simplify(Re(Ec)) assuming positive;
b:=simplify(Im(Ec)) assuming positive;

a  and  b  are the real and imaginary parts of  Ec .


 

restart

A := binomial(n, k)

`assuming`([limit(A*(lambda/n)^k*(1-lambda/n)^(n-k), n = infinity)], [lambda > 0, lambda < n, k::posint])

lambda^k/(GAMMA(k)*k*exp(lambda))

(1)

simplify(convert(%, factorial))

lambda^k*exp(-lambda)/factorial(k)

(2)

`assuming`([limit(eval(A*(lambda/n)^k*(1-lambda/n)^(n-k), k = 0), n = infinity)], [lambda > 0, lambda < n])

exp(-lambda)

(3)

``


 

Download Poisson.mw

Edit.


 

restart

A := binomial(n, k); assume(p >= 0, p <= 1)

binomial(n, k)

(1)

E := sum(A*p^k*(1-p)^(n-k)*k, k = 0 .. n)

(p/(1-p)+1)^n*p*n*(1-p)^n/((1-p)*(p/(1-p)+1))

(2)

E := simplify(E)

p*n

(3)

simplify(sum(A*p^k*(1-p)^(n-k)*(k-E)^2, k = 0 .. n))

-p*n*(-1+p)

(4)

subs(-1+p = -q, %)

p*n*q

(5)

NULL


 

Download simpl_new.mw


Edit.

You can easily get the explicit formula for this sequence:

rsolve({y(0)=(-sqrt(5)+5)*(1/8), y(n)= 4*y(n-1)*(1-y(n-1))}, y(n));


 

restart;
A[0] := 0;                      
A[1] := sqrt(2*(k[1]^2-w[1]^2))/n;
A[2] := sqrt(2*(k[2]^2-w[2]^2))/n;
c[1] := 1;
c[2] := 1;
c[3] := 1;
c[4] := 1;
c[5] := 1;
c[6] := 1;
k[1] := 10.5;
k[2] := 3.5;
w[1] := 5.05;
w[2] := .5;
m := 1.9;
n := 1.75;
xi[1] := -t*w[1]+x*k[1];
xi[2] := -t*w[2]+x*k[2];
a := m/sqrt(2*(k[1]^2-w[1]^2));
b := m/sqrt(k[2]^2-w[2]^2);
g := a*(c[2]*exp(a*xi[1])+c[3]*exp(-a*xi[1]));
h := c[1]+c[2]*exp(a*xi[1])+c[3]*exp(-a*xi[1]);
G := b*(c[5]*exp(b*xi[2])+c[6]*exp(-b*xi[2]));
H := c[4]+c[5]*exp(b*xi[2])+c[6]*exp(-b*xi[2]);
u := A[0]+A[1]*g/h+A[2]*G/H;

0

 

(2*k[1]^2-2*w[1]^2)^(1/2)/n

 

(2*k[2]^2-2*w[2]^2)^(1/2)/n

 

1

 

1

 

1

 

1

 

1

 

1

 

10.5

 

3.5

 

5.05

 

.5

 

1.9

 

1.75

 

-5.05*t+10.5*x

 

-.5*t+3.5*x

 

.1459402733

 

.5484827558

 

.1459402733*exp(-.7369983802*t+1.532372870*x)+.1459402733*exp(.7369983802*t-1.532372870*x)

 

1+exp(-.7369983802*t+1.532372870*x)+exp(.7369983802*t-1.532372870*x)

 

.5484827558*exp(-.2742413779*t+1.919689645*x)+.5484827558*exp(.2742413779*t-1.919689645*x)

 

1+exp(-.2742413779*t+1.919689645*x)+exp(.2742413779*t-1.919689645*x)

 

7.439442594*(.1459402733*exp(-.7369983802*t+1.532372870*x)+.1459402733*exp(.7369983802*t-1.532372870*x))/(1+exp(-.7369983802*t+1.532372870*x)+exp(.7369983802*t-1.532372870*x))+2.799416849*(.5484827558*exp(-.2742413779*t+1.919689645*x)+.5484827558*exp(.2742413779*t-1.919689645*x))/(1+exp(-.2742413779*t+1.919689645*x)+exp(.2742413779*t-1.919689645*x))

(1)

plot3d(u, x = -20 .. .20, t = -20 .. .20);
t := 0;
plot(u, x = -15 .. 15);
 

 

0

 

 

 


 

Download plots.mw

And what if you just write a single line of code that does the same thing without any packages and plot components :

Explore(plot(sin(a*x)+cos(b*x^2), x=0..10, -3..3), a=0..1., b=0..1.);
                    

 

I removed the square brackets that you use to group expressions. To do this, Maple should use only parentheses. Brackets are used to create lists. Some corrections were also made to improve the quality of the graphs:


 

restart;
A[0] := 0;                           
A[1] := sqrt(2*(k[1]^2-w[1]^2))/sqrt(lambda);                             
A[2] := sqrt(2*(k[2]^2-w[2]^2))/sqrt(lambda);                             
c[1] := 1;
c[2] := 1;
c[3] := 1;
c[4] := 1;
c[5] := 1;
c[6] := 1;
k[1] := 10.5;
k[2] := 3.5;
w[1] := 5.05;
w[2] := .5;
m := 1.9;
lambda := 1.75;
xi[1] := -t*w[1]+x*k[1];
xi[2] := -t*w[2]+x*k[2];
a := m/sqrt(k[1]^2-w[1]^2);
b := m/sqrt(k[2]^2-w[2]^2);
g := a*(c[2]*cos(a*xi[1])-c[3]*sin(a*xi[1]));
h := c[1]+c[2]*sin(a*xi[1])+c[3]*cos(a*xi[1]);
G := b*(c[5]*cos(b*xi[2])-c[6]*sin(b*xi[2]));
H := c[4]+c[5]*sin(b*xi[2])+c[6]*cos(b*xi[2]);
u := A[0]+A[1]*g/h+A[2]*G/H;
  

0

 

(2*k[1]^2-2*w[1]^2)^(1/2)/lambda^(1/2)

 

(2*k[2]^2-2*w[2]^2)^(1/2)/lambda^(1/2)

 

1

 

1

 

1

 

1

 

1

 

1

 

10.5

 

3.5

 

5.05

 

.5

 

1.9

 

1.75

 

-5.05*t+10.5*x

 

-.5*t+3.5*x

 

.2063907138

 

.5484827558

 

.2063907138*cos(1.042273105*t-2.167102495*x)+.2063907138*sin(1.042273105*t-2.167102495*x)

 

1-sin(1.042273105*t-2.167102495*x)+cos(1.042273105*t-2.167102495*x)

 

.5484827558*cos(.2742413779*t-1.919689645*x)+.5484827558*sin(.2742413779*t-1.919689645*x)

 

1-sin(.2742413779*t-1.919689645*x)+cos(.2742413779*t-1.919689645*x)

 

9.841457496*(.2063907138*cos(1.042273105*t-2.167102495*x)+.2063907138*sin(1.042273105*t-2.167102495*x))/(1-sin(1.042273105*t-2.167102495*x)+cos(1.042273105*t-2.167102495*x))+3.703280398*(.5484827558*cos(.2742413779*t-1.919689645*x)+.5484827558*sin(.2742413779*t-1.919689645*x))/(1-sin(.2742413779*t-1.919689645*x)+cos(.2742413779*t-1.919689645*x))

(1)

plot3d(u, x = -10 ..0.2, t = -10 .. 0.2, view=-50..50, grid=[200,200]);
 

 

plot(eval(u,t=0), x = -15 .. 15, -50..50, numpoints=5000, discont, size=[800,400]);

 

 


 

Download 2plots.mw

is(expand(B*exp(I*Pi/3))=expand(A));
                                                                   
 true

# Or

factor(expand(A/B));
polar(%);


Edit.
 

sum(2^k, k=0..n);
                                               
2^(n+1)-1

# Check for n=5
sum(`2`^k, k=0..5)=sum(2^k, k=0..5);
                             
2^5+2^4+2^3+2^2+2+1 = 63

We see that  63=2^6-1

This result  2^(n+1)-1  is the same as your answer, because  2*2^n-1 2^(n+1)-1

The imaginary unit in Maple should be coded as  I  (not as i). i is just a symbol in Maple.

Re((1+I)^2); 
Im((1+I)^2);

                                           0
                                           2

You can use  plots:-inequal  command:

restart;
A:=plot(sin(x), x=-3*Pi/4-0.3..9*Pi/4+0.3, color=red, thickness=3):
B:=plot(cos(x), x=-3*Pi/4-0.3..9*Pi/4+0.3, color=blue, thickness=3):
C:=plots:-inequal((y-cos(x))*(y-sin(x))<0, x=-3*Pi/4..9*Pi/4, y=-1.2..1.2, color=yellow):
plots:-display(A,B,C, scaling=constrained, size=[1000,300]);
         


Addition. The  plots:-inequal  command especially useful when a plane region is given by inequalities of the form  F(x,y)<0  or  F(x,y)>0 . Here is an example of painting over the regions obtained by different intersections of three circles:

with(plots):
C1:= (x+sqrt(7))^2+y^2-16: 
C2 := x^2+(y-3)^2-9: 
C3 := (x-4)^2+y^2-25:
Range:=x=-7..9.5, y=-5.5..6.5:
P:=implicitplot([C1,C2,C3], Range, color=black, thickness=2):
R1:=inequal({C1<0,C2<0,C3<0},  Range, color=blue, nolines):
R2:=inequal({{C1<0,C2<0},{C1<0,C3<0},{C2<0,C3<0}},  Range, color=yellow, nolines):
R3:=inequal({{C1<0,C2>0,C3>0},{C1>0,C2<0,C3>0},{C1>0,C2>0,C3<0}}, Range, color=green, nolines):
display(P,R1,R2,R3, scaling=constrained, size=[600,500]);
                 


 

restart

"P(t):=(r*Q[inf])/(2+2 cosh(b-r*t));"

proc (t) options operator, arrow, function_assign; r*Q[inf]/(2+2*cosh(b-r*t)) end proc

(1)

"Q(t):=(&int;)[0]^(t)P(t) &DifferentialD;t assuming real;"

proc (t) options operator, arrow, function_assign; `assuming`([int(P(t), t = 0 .. t)], [real]) end proc

(2)

value(Q(t))

(1/2)*Q[inf]*tanh((1/2)*b)-(1/2)*Q[inf]*tanh(-(1/2)*t*r+(1/2)*b)

(3)

 


 

Download Hubbert-new.mw

Maybe the following is what you want:


 

restart;
v := 145000;
thetavn := (1/6)*Pi;
omegac := .1;
x:=omegac*t;
s := cos(2*thetabn)*x+2*sin(thetabn)^2*sin(x);
plots:-implicitplot(s = 0, t = -200 .. 200, thetabn = 43*Pi*(1/180) .. 88*Pi*(1/180), tickmarks = ["decimalticks","piticks"], gridrefine = 4, size = [800, 600]);

145000

 

(1/6)*Pi

 

.1

 

.1*t

 

.1*cos(2*thetabn)*t+2*sin(thetabn)^2*sin(.1*t)

 

 

 


 

Download plot.mw

Edit.

I fixed only 1 line:

GAUSSIAN_new.mw

First 95 96 97 98 99 100 101 Last Page 97 of 290