Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

While using the Physics package in Maple 2018, I am facing a few hurdles. In the file tov.mw ,

1. I have defined a dual-vector with components $u_a$ in step 12, but when I am trying to compute $g(u,u)$ using SumOverRepeatedIndices  in step 15, it is not evaluating the sum.

2. I want to define a tensor $B_{ab}=\nabla_a u_b$. Do I just write Define(B{a,b}=D_[a] u[b]) ?

3. Is there any command to find the symmetric and antisymmetric components and trace of the tensor B or do we evaluate them by writing out the expressions?

Thank you.

Dear, 

Please, may I ask your help with the following problem? 

I have to print something like this: 

Days 4,5,6 is closed. 

4,5,6 is the content of a list.  I enter: 

d:=[4,5,6];

printf("Days %a is closed\n", d[]);

but Maple returns:

Days 4 is closed

Of course, if I enter  printf("Days %a, %a, %a is closed\n", d[]);

I get the correct result: Days 4,5,6 is closed. 

However, the numer of elements the list will have vary from case to case and according to the procedure I'm running so I cannot enter the command with the exact number of %a. How could I overcome this problem?

Many thanks for your help. 

 

Hi all,

I have the following function (with parameters/constants a, b, and p2A ):

 

I want to calculate its partial derivative with resprect to p1A. I entered the following code to do this:

But this returns a result that was (at least, for me) unexpected:

My problem is, I don't really get what the expressions 'D(...)' mean in this equation and why they are even there. a and p2A are supposed to be constant and thus their derivative should be zero (wtih respect to p1A ).

I think this should be an easy problem to solve for someone more familiar with Maple, but I am new to it and have been spending the last few hours trying to figure out how to solve this problem. Any help would be highly appriciated.

 

Thank you in advance,

JTamas

restart; with(plots); _EnvHorizontalName := 'x'; _EnvVerticalName := 'y'; para := -2*p*x+y^2 = 0; para1 := -2*p1*x+y^2 = 0; t := y-m*x-p/(2*m) = 0; t1 := y+x/m+(1/2)*p1*m = 0; sol := op(solve([t, t1], [x, y])); eliminate({rhs(sol[1]), rhs(sol[2])}, m); for example : m := 2; p := 1; p1 := -2; PARA := implicitplot(para, x = -3 .. 3, y = -3 .. 3, color = blue); PARA1 := implicitplot(para1, x = -3 .. 3, y = -3 .. 3, color = green); Tang := implicitplot(t, x = -3 .. 3, y = -3 .. 3, color = brown); Tang1 := implicitplot(t1, x = -3 .. 3, y = -3 .. 3, color = aquamarine); NULL; #m is not constant display([PARA, PARA1, Tang, Tang1], view = [-3 .. 3, -3 .. 3], scaling = constrained);#on what curve is the vertex of the angle of 2 tangents ? Thank you.

i have a function which contains Ln and arctan fanctions in which the output function is complex.
how can i implicitplot this complex function? tnx for the help
 

restart

with(plots, implicitplot)

ode := diff(y(w), w)+(sqrt((12*Pi)(y(w)^2+m^2*w^2))*y(w)+m^2*w)/y(w) = 0

diff(y(w), w)+(2*3^(1/2)*Pi(y(w)^2+m^2*w^2)^(1/2)*y(w)+m^2*w)/y(w) = 0

(1)

Ans := dsolve([ode])

[{ln(w)+(1/4)*ln(-m^4-2*m^2*y(w)^2/w^2-y(w)^4/w^4+12*y(w)^2*Pi/w^2)-(3/2)*arctan((1/4)*(-2*m^2-2*y(w)^2/w^2+12*Pi)/(3*Pi*m^2-9*Pi^2)^(1/2))*Pi/(3*Pi*m^2-9*Pi^2)^(1/2)+(1/4)*ln(2*Pi^(1/2)*3^(1/2)*y(w)/w-y(w)^2/w^2-m^2)-(3/2)*arctan((1/2)*(2*Pi^(1/2)*3^(1/2)-2*y(w)/w)/(m^2-3*Pi)^(1/2))/((3*m^2-9*Pi)/Pi)^(1/2)-(1/4)*ln(2*Pi^(1/2)*3^(1/2)*y(w)/w+m^2+y(w)^2/w^2)+(3/2)*arctan((1/2)*(2*y(w)/w+2*Pi^(1/2)*3^(1/2))/(m^2-3*Pi)^(1/2))/((3*m^2-9*Pi)/Pi)^(1/2)-_C1 = 0}]

(2)

P:=subs(y(w)=Y,eval(lhs(Ans[1, 1]), [_C1 = 0, m = 1]))

ln(w)+(1/4)*ln(-1-2*Y^2/w^2-Y^4/w^4+12*Y^2*Pi/w^2)-(3/2)*arctan((1/4)*(-2-2*Y^2/w^2+12*Pi)/(-9*Pi^2+3*Pi)^(1/2))*Pi/(-9*Pi^2+3*Pi)^(1/2)+(1/4)*ln(2*Pi^(1/2)*3^(1/2)*Y/w-Y^2/w^2-1)-(3/2)*arctan((1/2)*(2*Pi^(1/2)*3^(1/2)-2*Y/w)/(1-3*Pi)^(1/2))/((-9*Pi+3)/Pi)^(1/2)-(1/4)*ln(2*Pi^(1/2)*3^(1/2)*Y/w+1+Y^2/w^2)+(3/2)*arctan((1/2)*(2*Y/w+2*Pi^(1/2)*3^(1/2))/(1-3*Pi)^(1/2))/((-9*Pi+3)/Pi)^(1/2)

(3)

implicitplot(P,w=-10..0,Y=0..10)

 

evalf((eval(P,[w=1,Y=1])))

1.655474573+.8307038310*I

(4)

 

 


 

Download P2.mw

The sphere with radius 0.5 whose center has y coordinate = 0.5 and z coordinate = 0.5 is tangent internally to the ellipsoid centered on the origin with principal semi axes of 5, 3 and 2.

How can the x coordinate of the sphere's center be determined?

The time taken for thread is comparitively higher in following case. how to decrease time in threads

 

thread_time.mw

I have recently received a doc from my friend in privete group in maple cloud, the table showed both eye(view) icon and download icon).When I downloaded and run, the document does not run (maple 2019). 

When I sign in maple cloud and see the doc (only view button is ahow), the same document works fine. What could be the error?

I attach  a document extract showing the errors (unable to delimt   .../  identifiers).

Can any one help us please?

Thanks. Ramki.
 

``

"Refraction Demonstration          restart:with(plots):  RefractionDemo:=proc(theta1, n2)  local theta2,ainput,ainside,aoutput,box,line1,line2,H,n2text,theta1text,theta2text;   if(theta1<0)or(theta1>Pi/(2.0001)) then return end if;   #theta1:=theta01*Pi180.;   theta2:=arcsin(1/(n2)*sin(theta1));   ainput:=arrow(?&ndash;cos(theta1),&ndash;sin(theta1)?,?cos(theta1),sin(theta1)?,color="Red"):   ainside:=arrow(?0,0?,?1,tan(theta2)?,color="DarkBlue",width=[0.05,relative=false]):   aoutput:=arrow(?1,tan(theta2)?,?cos(theta1),sin(theta1)?,color="Red"):   line1:=plot(0,x=&ndash;1..0,thickness=4,color=black);   line2:=plot(tan(theta2),x=1..2,thickness=4,color=black);   H:=1.8:   box:=plottools:&ndash;rectangle([0,&ndash;H],[1,H],color="LightBlue"):   n2text:=textplot([0.5,1.5,sprintf("n_2=%1.3 g",n2)]);   theta1text:=textplot([&ndash;0.5,0.4,sprintf("theta_1=%4.3 g",theta1)]);   theta2text:=textplot([0.5,&ndash;0.4,sprintf("theta_2=%4.3 g",theta2)]);   display([ainput,ainside,aoutput,box,line1,line2,n2text,theta1text,theta2text],scaling=constrained,view=[&ndash;1..2,&ndash;1..H]);   endproc:        Light enters from the air into a medium at an angle of theta1 relative to the normal. It is refracted to an angle of theta2and travels through the medium, returning back to the air.      You can vary two parameters:       theta1the angle of incidence       n2the index of refraction of the medium*(assuming the index of refraction of the air is essentially 1.0).     To do: Let it execute and start manipulating the sliders.     >Explore(RefractionDemo(theta1,n2),parameters=[theta1=0..Pi2.0015,n2=1..3.]);6""

Error, unable to delimit strings/identifiers

"Refraction Demonstration          restart:with(plots):  RefractionDemo:=proc(theta1, n2)  local theta2,ainput,ainside,aoutput,box,line1,line2,H,n2text,theta1text,theta2text;   if(theta1<0)or(theta1>Pi/2.0001) then return end if;   #theta1:=theta01*Pi180.;   theta2:=arcsin(1/n2*sin(theta1));   ainput:=arrow(&acirc;ï¿&frac12;&uml;&ndash;cos(theta1),&ndash;sin(theta1)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):   ainside:=arrow(&acirc;ï¿&frac12;&uml;0,0&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,color="DarkBlue",width=[0.05,relative=false]):   aoutput:=arrow(&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):   line1:=plot(0,x=&ndash;1..0,thickness=4,color=black);   line2:=plot(tan(theta2),x=1..2,thickness=4,color=black);   H:=1.8:   box:=plottools:&ndash;rectangle([0,&ndash;H],[1,H],color="LightBlue"):   n2text:=textplot([0.5,1.5,sprintf("n_2=%1.3 g",n2)]);   theta1text:=textplot([&ndash;0.5,0.4,sprintf("theta_1=%4.3 g",theta1)]);   theta2text:=textplot([0.5,&ndash;0.4,sprintf("theta_2=%4.3 g",theta2)]);   display([ainput,ainside,aoutput,box,line1,line2,n2text,theta1text,theta2text],scaling=constrained,view=[&ndash;1..2,&ndash;1..H]);   endproc:        Light enters from the air into a medium at an angle of theta1 relative to the normal. It is refracted to an angle of theta2and travels through the medium, returning back to the air.      You can vary two parameters:       theta1the angle of incidence       n2the index of refraction of the medium*(assuming the index of refraction of the air is essentially 1.0).     To do: Let it execute and start manipulating the sliders.     >Explore(RefractionDemo(theta1,n2),parameters=[theta1=0..Pi2.0015,n2=1..3.]);"

 

``

``

``

``Dear Prof.

The following code seems not copying properly (my communication error be allowed please)

 

"ainput:=arrow(?&"

Error, unable to delimit strings/identifiers

"ainput:=arrow(&acirc;ï¿&frac12;&uml;&ndash;cos(theta1),&ndash;sin(theta1)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):ainside:=arrow(&acirc;ï¿&frac12;&uml;0,0&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,color="DarkBlue",width=[0.05,relative=false]):aoutput:=arrow(&acirc;ï¿&frac12;&uml;1,tan(theta2)&acirc;ï¿&frac12;&copy;,&acirc;ï¿&frac12;&uml;cos(theta1),sin(theta1)&acirc;ï¿&frac12;&copy;,color="Red"):"

 

``

``

"I checked by typing separately. It works as below."

``

``

a1 := arrow([-cos(theta1), -sin(theta1)], color = "LightBlue")

 

``ainput := arrow([-1, 0], color = "Red")

 

"But the copied from your code does not work."

"ainput:=arrow([-1, 0],color= "`Red"`)"

Error, unable to delimit strings/identifiers

"ainput:=arrow([-1, 0],color= "`Red"`)"

 

``


 

Download forScotgould_Error_arrow.mw

Hi,

 

I have two functions that I took the inetgral of their product (1.3 and 1). Then i multiplied the resulting naswer with the variable and integrates again however the inetgral did not evaluate (3,4, and 5). 

I was able to calculate both inegrals using tables of integrals, MATLAB & Mathematica were able to evaluate.

any insights on why this may happening?

Integrals_Sheet2.mw

Hi,

 

I am trying to use Maple to evaluate the recursion series as below, but I am getting an error when I try to call c: Error, (in depends) too many levels of recursion

Recursion.mw

 


 

 

b := proc (k) options operator, arrow; (-1)^k*GAMMA(1+(1/2)*k)^2/factorial(k) end proc

proc (k) options operator, arrow; (-1)^k*GAMMA(1+(1/2)*k)^2/factorial(k) end proc

(1)

c := proc (k) options operator, arrow; piecewise(k = 0, b(0)^N, 1 <= k, (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0))) end proc

proc (k) options operator, arrow; piecewise(k = 0, b(0)^N, 1 <= k, (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0))) end proc

(2)

b(2)^N

(1/2)^N

(3)

c(1)

Error, (in depends) too many levels of recursion

 

 

F := proc (s, kmax, N) options operator, arrow; sum(c(k)*s^k, k = 0 .. kmax) end proc

proc (s, kmax, N) options operator, arrow; sum(c(k)*s^k, k = 0 .. kmax) end proc

(4)

powcreate(c(k) = (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0)), c(0) = b(0)^N)

Error, (in depends) too many levels of recursion

 

c := rsolve({c(0) = b(0)^N, c(k) = (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0))}, c(k), makeproc)

Error, (in depends) too many levels of recursion

 

c := proc (k) if k = 0 then return b(0)^N else return (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0)) end if end proc

proc (k) if k = 0 then return b(0)^N else return (sum((q*(N+1)-k)*b(q)*c(k-q), q = 1 .. k))/(k*b(0)) end if end proc

(5)

c(1)

Error, (in _factorial) too many levels of recursion

 

F := proc (s, kmax, N) options operator, arrow; sum(c(k)*s^k, k = 0 .. kmax) end proc

proc (s, kmax, N) options operator, arrow; sum(c(k)*s^k, k = 0 .. kmax) end proc

(6)

F(1, 2, 2)

Error, (in unknown) too many levels of recursion

 

NULL


 

Download Recursion.mw

I have this equation 

 

x3l := -(1/2)*g*(f[3]*m[3]+f[2]*(m[2]+m[3])+f[1]*(m[1]+m[2]+m[3]))*tau^2/(m[1]+m[2]+m[3])+x30

 

f_i are Heaviside function of x3l, so I get  recrusive error

how can i avoid it ? 

A fouth order system is described by the differential equation

          (d^4 y)/(dt)^4 + a_3  (d^3 y)/(dt)^3 + a_2  (d^2 y)/(dt)^2 + a_1  dy/dt+ a_0 y(t)=u(t)      

Where y(t) is the output and u(t) is any input

  • Determine the matrix A.
  • Using the condition det[A – λI ]

Determine the eigen values λ.

  • Compute the state transition matrix using maple.

I'm plotting some simple plots such as

plot(frac(x^2/3)*3,x=-5..5, discont=true);

 

Some discontinuities are connected. Using numpoints, resolution, and Digits doesn't help. Sometimes it will produce a plot with no connections but then other times it does. I need a general solution that is simple. Is there any way to refine the quality of discont?

 

discont=[usefdiscont=[bins=35]],

 

I have tried that and it seems to work but I haven't put it through the ringer. Is that all I have?

 

I'm using MAPLE 2019 and I'm sometimes surprised by its behaviour.  For example, I appear to have an example where it evaluates the integral of each of two terms but not their sum...  What's going on?  Please see the attached.

restart

g0 := exp(r*cos(theta))/Pi

exp(r*cos(theta))/Pi

(1)

G0 := `assuming`([int(g0, theta = 0 .. Pi)], [r > 0])

BesselI(0, r)

(2)

g1 := exp(r*cos(theta))*cos(theta)/Pi

exp(r*cos(theta))*cos(theta)/Pi

(3)

G1 := `assuming`([int(g1, theta = 0 .. Pi)], [r > 0])

BesselI(1, r)

(4)

g := g0+g1

exp(r*cos(theta))/Pi+exp(r*cos(theta))*cos(theta)/Pi

(5)

G := `assuming`([int(g, theta = 0 .. Pi)], [r > 0])

int(exp(r*cos(theta))/Pi+exp(r*cos(theta))*cos(theta)/Pi, theta = 0 .. Pi)

(6)

``


 

Download Maplesumint.mw

Hello, I'm using free 15 day trial Maple 2019.2 on my Macbook (Macos 10.15.3).

I can't work Maple. I enter some inputs (2+3) and press enter. It works. But when I write plot, version(), f, sin.. or something else it didn't works. And no response. When I click enter, nothind happen. What is the problem? Please help me.. 

First 464 465 466 467 468 469 470 Last Page 466 of 2097