MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

 

Maple returns the wrong answer to the following very simple double sum:

T:=(x,m)->sum( sum(binomial(m,k+p),k=1..m-p)*x^p,p=0..m-1);

Maple gives zero for all m>0.  However, the correct answer is a non-zero polynomial in x. 

For example, with Maple:

T(x, 3);
                               0

The correct answer is  x^2+4*x+7.

It would be helpful if others can check this double sum in their version of Maple and report results.

 

Does Maple have any tool or package that computes the Fourier & Fourier-Bessel series expansions of a given funtion "f(x)" over a specified interval "[a,b]"?

what are the examples of calculating devices and packages?

I set a physical model for my reseach,

equ1 := x^4-5*x

equ2 := 1/x+x^2+3

x is a function of time t and it meets diff(x(t), t) = equi-equ2.

I want to plot the curve of x(t) varying with time

When I use the following command

DEplot({x(0) = 0, diff(x(t), t) = equi-equ2},x(t), t = 0 .. 20)   it shows: Error, (in DEtools/DEplot) called with too few arguments

Who can tell me what is wrong with my calculation? Thanks

Hi I am working on the following problem (See below the line) from the text A Introduction to the Mathematics of Biology (Ch 2 pgs.21-23). I am working in Maple 18 and the code for this problem is from Maple 11 I think. If you look at the last line of code, I ran into a snag. Can anyone help????? We are in a study Gourp and alll are stumped.

_______________________________________________________________________________________________________

Problem # 2 - Find a fit for the cumulative US AIDS data as a polynomial function. Alsoo find an exponential fit for the data. (assume the Data I have inputed is correct if you don't have the book).

AIDS := [97, 206, 406, 700, 1289, 1654, 2576, 3392, 4922, 6343, 8359, 9968, 12990, 14397, 16604, 17124, 19585, 19707, 21392, 20846, 23690, 24610, 26228, 22768];
print(`output redirected...`); # input placeholder
[97, 206, 406, 700, 1289, 1654, 2576, 3392, 4922, 6343, 8359,

9968, 12990, 14397, 16604, 17124, 19585, 19707, 21392, 20846,

23690, 24610, 26228, 22768]

CAC := [seq(sum(AIDS[j]/(1000.0), j = 1 .. i), i = 1 .. 24)];
print(`output redirected...`); # input placeholder
[0.09700000000, 0.3030000000, 0.7090000000, 1.409000000,

2.698000000, 4.352000000, 6.928000000, 10.32000000,

15.24200000, 21.58500000, 29.94400000, 39.91200000,

52.90200000, 67.29900000, 83.90300000, 101.0270000,

120.6120000, 140.3190000, 161.7110000, 182.5570000,

206.2470000, 230.8570000, 257.0850000, 279.8530000]


Time := [seq(1981+(i-1)*(1/2), i = 1 .. 24)];
ln(CAC)=k*lnt+A
LnCAC := map(ln, CAC);
print(`output redirected...`); # input placeholder
[-2.333044300, -1.194022473, -0.3438997525, 0.3428802329,

0.9925107578, 1.470635510, 1.935571171, 2.334083760,

2.724054775, 3.071998629, 3.399328971, 3.686677031,

3.968441145, 4.209145378, 4.429661370, 4.615387808,

4.792578782, 4.943918402, 5.085810791, 5.207062453,

5.329074480, 5.441798471, 5.549406770, 5.634264465]
LnTime := map(ln, [seq((i+1)/(2*(1/10)), i = 1 .. 24)]);
print(`output redirected...`); # input placeholder
[ln(10), ln(15), ln(20), 2 ln(5), ln(30), ln(35), ln(40), ln(45),

ln(50), ln(55), ln(60), ln(65), ln(70), ln(75), ln(80), ln(85),

ln(90), ln(95), 2 ln(10), ln(105), ln(110), ln(115), ln(120),

3 ln(5)]
with(stats);
fit[leastsquare[[x, y], y = k*x+lnA]]([LnTime, LnCAC]);
print(`output redirected...`); # input placeholder
y = 3.293411005 x - 10.12289000
k := op(1, op(1, rhs(%))); LnA := op(2, rhs(`%%`)); A := exp(LnA);
print(`output redirected...`); # input placeholder
Error, invalid input: rhs received exp(LnA), which is not valid for its 1st argument, expr
Error, invalid input: rhs received exp(LnA), which is not valid for its 1st argument, expr
exp(LnA)

Hi,

 

So, I have the following problem. In my research, I am trying to prove that something is impossible. I do that by encoding it as a set of equations, and asking Maple to solve them, and if it finds that the system has no solutions, I got what I wanted. However, I really wanted to see Maple output this fact explictly, more or less like Mathematica (where I either get an error message, or I get "False" if I use the Reduce command). The reason for this is that I will embed this procedure in a loop that varies some of my starting assumptions, and I want Maple to output that the system has no solutions at each iteration. This is useful since each iteration takes more than half an hour to run, and there are dozens of them, so I want the program to provide me some intermediate feedback, rather than waiting for everything to finish to get an answer.

 

Is the question clear?

 

Thanks a lot for the help!

Solve, using 4000 miles for the radius of the earth.                                                                                              

 

A space shuttle is in circular orbit 150 miles above the surface of the earth. Approximate                                                                             

  1. the speed
  2. the time required for one revolution.

Error Invalid If Statement...

Yesterday at 12:59 PM lsw187 10

I keep getting an error about the while. It is calling it an invalid if statement.  It may relate to semi colons, but I cannot find any errors myself. Please help.

InterpolIDW2:=proc(n,rwin,mink,p,R,IR)       

local ix,iy,i,j,i0,i1,j0,j1,k;      

local count,wgt,top,bot,hp;      

print(`n=`,n,`rwin=`,rwin,`mink=`,mink,`p=`,p);      

hp:=p/2;        

for iy from 1 to n do      

for ix from 1 to n do           

if (IR(ix,iy)=0) then                

i0:=max(1,ix-rwin);  i1:=min(n,ix+rwin);                

j0:=max(1,iy-rwin);  j1:=min(n,iy+rwin);                 

k:=add(add(IR(i,j),i=i0..i1),j=j0..j1)                                                                

while (k<mink )do                              

if(i0>1) then                                       

i0:= i0-1;                                       

k:= k+ add(IR(i0,j),j=j0..j1)                              

end if;                              

if(i0<1) then                                        

i0:=i0+1;                                        

k:= k+ add(IR(i0,j),j=j0..j1)                              

end if;                              

if(j0>1) then                                        

  j0:=j0-1;                                       

  k:= k+ add(IR(i,j0),i=i0..i1)                         

  end if;                           

 if(j0<1) then                                

 j0:= j0+1;                                         

k:= k+ add(IR(i,j0),i=i0..i1)                             

end if;                         

end do;                  

top:=0;  bot:=0;                

for j from j0 to j1 do                

for i from i0 to i1 do                      

if (IR(i,j)<>0) then                           

wgt:=1/evalf[14](((ix-i)^(2)+(iy-j)^(2))^(hp));                           

top:=top+wgt*R(i,j);                           

bot:=bot+wgt;                      

end if;                

end do;                

end do;                

R(ix,iy):=top/bot;           

end if;      

end do;      

end do;  

end proc:

I'm trying to solve a series of equations and then graph them. I'm trying to solve for the variables involved:

values := solve({eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9,

eq10, eq11, eq12, eq13, eq14, eq15, eq16}, {a, b, b, c, d, e, f,

g, h, i, j, k, l, m, n, o, p});

 

. . . but it gives me this:

Warning, solving for expressions other than names or functions is not recommended. 

values := 

int(int(y, 0 <= y, x^2+y^2+z^2 <= 1));

Error, (in int) integration range or variable must be specified in the second argument, got 0 <= y

int(int(y, y = 0, x^2+y^2+z^2 = 1));

Error, (in int) integration range or variable must be specified in the second argument, got y = 0

Animation of Garage door opening...

Yesterday at 6:28 AM das1404 5
1 1

Am trying to create a gif file of  a cantilevered door opening with the aid of a coil spring.  The program is given below in text format.  At the end is a for/do loop which gives a series of pictures of the side view of the door opening.  I'd like to animate these and be able to create a gif file. The use of animate seems to require a function F(x,t) of two variables - one being time. My calculations do not involve time.  Any help gratefully received.

 

restart;
> with(plots): with(plottools):
> #Problems:
> #gif file???  Use of animate
> # - - - - - - -
> printlevel:=0:
> #h=doorheight;  h1=dist from floor to pivot point; base=dist of cantilever #connection to end of garage door
> h:=206:h1:=115:
> doorheight:=h:
> base:=24:
> #Spring data
> sbase:=0.4*base:  #sbase is height of base of spring connection point
> #Lower & upper proportions of spring length as ratio of spring length
> propn1:=0.2: propn2:=0.95:  #propn2 > propn1
> #alpha is inclination angle of coils in the spring
> alpha:=Pi/6:
> #nc is Number of Coils in Spring
> nc:=24:   #92 in my actual spring
> #Garage door (closed position lightly shown)
> gdupright:=line([0,0],[0,h], linestyle=2, color=grey):
> #cr is Cantilever Radius
> cr:=h1-base:
> #Counter-balance extension length is cr_ext
> cr_ext:=12:  # 62
> doorwidth:=0.05*h:
> guidewidth:=doorwidth*1.015:
> #macro(skyblue = COLOR(RGB, 0.1960, 0.6000, 0.8000));
> macro(palegreen=COLOR(RGB, .5607, .7372, .5607)):
> #g1 (top) & g2 are guides for door support
> #g_ext is guide extension proportion of guides above the door
> g_ext:=0:  
> g1:=line([-doorwidth/2,doorheight*(1+g_ext)+guidewidth],[doorheight*(1+g_ext),doorheight*(1+g_ext)+guidewidth], color=palegreen):
> g2:=line([-doorwidth/2,doorheight*(1+g_ext)],[doorheight*(1+g_ext),doorheight*(1+g_ext)], color=palegreen):
> garagefloor:=line([-h*.65,0],[doorheight,0], color=black):
> rooflevel:=line([-h*.65,(1.05+g_ext)*h+guidewidth],[doorheight,(1.05+g_ext)*h+guidewidth], linestyle=2,color=grey):
> #Pivot point - pivpoint
> pivp_x:=0.019*h:   #doorwidth:
> #printf("pivp_x= %8.2f doorwidth= %7.1f\n",pivp_x,doorwidth):
> pivpoint:=circle([pivp_x,h1],doorwidth/2, color=red): #doorwidth/2 for radius - #use cr to check
> #mpp is mid point of rotation
> mpp := point([pivp_x,h1], color=black):
> #connect_point[j]:=circle([pivp_x+cr_ext*sin(theta),h1+cr_ext*sin(theta)],doorwidth/2, color=red):
> lastj:=4:    #Number of angle diplays -1 (for 0)
> #printf("Rotation Angle of cantilever (degrees) & distance along the guide arm (cm)  hc   kc"):
> # - - - - - - - - - - - - - -
>
> for j from 0 to lastj do
>
> theta:=j*Pi/lastj:
> # hc was changed from cr*sin(theta)
> hc:=pivp_x-cr*sin(theta):kc:=h1-cr*cos(theta):
> x:=pivp_x-cr*sin(theta)+sqrt((h-base)^2-(h-kc)^2):
> #printf("%8.2f %7.1f    %5.2f   %5.2f\n",theta*180/Pi,x,hc,kc);
> if j=lastj then phi:=Pi/2:
>  else
> phi:=arctan((cr*sin(theta)+x-pivp_x)/(cr*(1+cos(theta))));
> end if:
> #Sides of door, starting at NW corner & going anti-clockwise
> door1 := line([x-doorwidth*cos(phi),h+doorwidth*sin(phi)],[x,h] , color=black):
> door2 := line([x,h],[x-h*sin(phi),h-h*cos(phi)] , color=black):
> door3 := line([x-h*sin(phi),h-h*cos(phi)],[x-h*sin(phi)-doorwidth*cos(phi),h-h*cos(phi)+doorwidth*sin(phi)], color=black):
> door4 := line([x-h*sin(phi)-doorwidth*cos(phi),h-h*cos(phi)+doorwidth*sin(phi)],[x-doorwidth*cos(phi),h+doorwidth*sin(phi)], color=black):
> #Counter balance arm
> cba:=line([x-(h-base)*sin(phi),h-(h-base)*cos(phi)],[pivp_x+cr_ext*sin(theta),h1+cr_ext*cos(theta)],color=blue):
> #Spring calcs # ???
> spring:=line([pivp_x,sbase],[pivp_x+cr_ext*sin(theta),h1+cr_ext*cos(theta)], linestyle=2, color=grey):
> #Turnbuckle
> tbuck1:=line([pivp_x,sbase],[pivp_x+cr_ext*propn1*sin(theta),sbase+propn1*(h1-sbase+cr_ext*cos(theta))], color=black):
> #for tbuck2 see below - it requires angle chi
> chi:=arctan(cr_ext*sin(theta)/(h1-sbase+cr_ext*cos(theta))):
> tbuck2:=arc([pivp_x,sbase],doorwidth/6,Pi/2-chi..3*Pi/2+.2, color=blue):
> #sl is spring length (l is the letter L lower case)
> sl:=sqrt(cr_ext^2+(h1-sbase)*((h1-sbase)+2*cr_ext*cos(theta))):
> for i from 0 to nc do
> x1[i]:=pivp_x+(propn1+(propn2-propn1)*i/nc)*sl*sin(chi):
> y1[i]:=sbase+(propn1+(propn2-propn1)*i/nc)*sl*cos(chi):
> connect_point:=circle([pivp_x+cr_ext*sin(theta),h1+cr_ext*cos(theta)],doorwidth/4, color=blue):
> printlevel:=1:
> #printf("x[%g] = %8.2f  y[%g] = %8.2f theta = %8.2f chi = %8.2f\n", i,x[i],i,y[i],theta*180/Pi,chi*180/Pi);
> #####---PRINT STATEMENT  (NB 2 #)
> #printf("i=%g x = %4.2f  y = %5.2f theta = %6.3f chi = %7.3f  Sp len=%5.3f\n",
> #i, x1[i],y1[i],theta*180/Pi,chi*180/Pi,sl);
>
> s_coil[i]:=line([x1[i]-doorwidth/2,y1[i]-doorwidth/2*tan(alpha-chi)], [x1[i]+doorwidth/2,y1[i]+doorwidth/2*tan(alpha-chi)], color=blue):
> end do:
> #Coords of end of spring (& counter-balance arm) are #[pivp_x+cr_ext*sin(theta),h1+cr_ext*cos(theta)]
> #Line from top of spring to kicker bolt
>
> #connectline[j]:=line([pivp_x+cr_ext*sin(theta),h1+cr_ext*cos(theta)], #[x1[nc]+doorwidth/2,y1[nc]+doorwidth/2*tan(alpha-chi)], color=green):
>
> printlevel:=-1:
> frame[j]:=plots[display](door1,door2,door3,door4,garagefloor,rooflevel,g1,g2,gdupright,pivpoint,cba,mpp,connect_point,seq(s_coil[i],i=0..nc), tbuck1,tbuck2, scaling=constrained, axes=none):
> end do;
> # - - - - - - - - - - - - - -
> printlevel:=1:
> for j from 0 to lastj do
> frame[j];
> end do;
> # - - - - - - - - -
> animate( frame[j],j=0..lastj,t=1..2,frames=50);

A major-league pitcher releases a ball at a point 6 feet above the ground and 58 feet from home plate at a speed of 100 mi/hr ,  

If gravity had no effect, the ball would travel along a line and cross home plate 4 feet off the ground. Find the drop D caused by gravity.                                                                                                                                                      

 

NB: in this problem the angle alpha is the angle between the horizontal and the direction of the released ball. Since the ball is dropping, alpha will be negative.

Hi every body:

i have a second order ode and will convert to two ode of first order with maple,how do this work???

eq := diff(y(x), x, x)+2*y(x)+y(x)^2 = 0

wrong taylor expansion result...

Yesterday at 3:45 AM _zgj 60

taylor(1/(1+z^2), z = 1, 4)

The result is 

1/2-(1/2)*z-1+(1/4)*(z-1)^2+O((z-1)^4)

but in fact the result is 

1/2-(1/2)*(z-1)+(1/4)*(z-1)^2+O((z-1)^4)

my Maple is Maple 16,How to solve this problem?

Hi there,

is it possible to have the legend of a pointplot accepting arguments?

Say I have an array of 3 values (e.g. p:=[1.5,2,2.5]) representing a given parameter for a function. When representing this function by means of a plot, I would like the legend (legend="Parameter " + value in array; legend=["Parameter", "Parameter", "Parameter") to accept the contents of the array, without entering the values manually:

Parameter 1.5

Parameter 2

Parameter 2.5

 

How can this be achieved?

 

Thanks,

jon

1 2 3 4 5 6 7 Last Page 1 of 1070