Maple 2016 Questions and Posts

These are Posts and Questions associated with the product, Maple 2016

Hi there!

Basically I want to compare graphs in one coordinate system, however one of the graphs is set to 0 everywhere if the values of the y-coordinates differ too much from the values of the other graph. The procedure is below, how can I get around that?

I have already checked that all the values are calculated correctly and are displayed properly if the values of the other graph

are close enough.

Unfortunately I dont know how to send pictures.

Thanks, Daniel

 

PlottingVergleich:=proc(Unten2,Oben2,f2Nr1,G2Nr1,f2Nr2,G2Nr2,UntenN,ObenN)::plot;
local SpeichervektorX, #speichert die Stützstellen
SpeichervektorYAbs1, SpeichervektorYAbs2, #speichert die Stützwerte des späteren Splines aus den                                                 #absoluten Fehlern von f2Nr1 bzw. f2Nr2
SpeichervektorYRel1, SpeichervektorYRel2, #speichert die Stützwerte des späteren Splines aus den                                                 #relativen Fehlern von f2Nr1 bzw. f2Nr2
i2, #Laufvariable
InterpolationsfunktionAbs1,InterpolationsfunktionAbs2, #speichert den Spline aus den absoluten Fehlern                                                        #von f2Nr1 bzw. f2Nr2
InterpolationsfunktionRel1,InterpolationsfunktionRel2, #speichert den Spline aus den relativen Fehlern                                                        #von f2Nr1 bzw. f2Nr2
GraphAbs1,GraphAbs2, #speichert den Graphen aus dem Spline aus den absoluten Fehlern                                        #von f2Nr1 bzw. f2Nr2
GraphRel1,GraphRel2, #speichert den Graphen aus dem Spline aus den relativen Fehlern                                        #von f2Nr1 bzw. f2Nr2
PunkteAbs1,PunkteAbs2, #speichert den Punktgraphen aus den absoluten Fehlern                                                  #von f2Nr1 bzw. f2Nr2
PunkteRel1,PunkteRel2; #speichert den Punktgraphen aus den relativen Fehlern                                                  #von f2Nr1 bzw. f2Nr2
with(CurveFitting):
with(plots):
SpeichervektorX := Vector[row](ObenN-UntenN+1);
SpeichervektorYAbs1 := Vector[row](ObenN-UntenN+1);
SpeichervektorYRel1 := Vector[row](ObenN-UntenN+1);
for i2 from UntenN to ObenN do
  SpeichervektorX[i2-UntenN+1] := i2; #Stützstellen definieren
  SpeichervektorYAbs1[i2-UntenN+1] := GaußKronrodQuadraturKurz(Unten2, Oben2, f2Nr1, G2Nr1, i2)-(int     (f2Nr1*diff(G2Nr1,x), x = Unten2 .. Oben2)); # Bestimmen des absoluten Fehlers von f2Nr1 für n=i2
  if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then  #Bestimmen des relativen Fehlers von f2Nr1, falls dieser für beide Funktionen definiert                #ist
    SpeichervektorYRel1[i2-UntenN+1] := abs(SpeichervektorYAbs1[i2-UntenN+1]/(int(f2Nr1*diff(G2Nr1,x),     x = Unten2 ..    Oben2)))
  end if;
end do;
InterpolationsfunktionAbs1 := Spline(SpeichervektorX, SpeichervektorYAbs1, n); #Generierung des
   #  Splines aus Stützpunkten, die sich aus den absoluten Fehlern von f2Nr1 ergeben
GraphAbs1 := plot(InterpolationsfunktionAbs1, n = UntenN .. ObenN, color = green, legend = ["f1"]);
   #  Generierung des Graphen, der sich aus dem Spline aus den absoluten Fehlern von f2Nr1 ergibt
PunkteAbs1 := plot(SpeichervektorX, SpeichervektorYAbs1, style = point, color = orange);
   #  Generierung des Punktgraphen, der sich aus den absoluten Fehlern von f2Nr1 ergibt  
if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then
   # falls der relative Fehler für beide Funktionen definiert ist analoges Vorgehen für die relativen     #Fehler
  InterpolationsfunktionRel1 := Spline(SpeichervektorX, SpeichervektorYRel1, n);
  GraphRel1 := plot(InterpolationsfunktionRel1, n = UntenN .. ObenN, color = green, legend = ["f1"]);
  PunkteRel1 := plot(SpeichervektorX, SpeichervektorYRel1, style = point, color = orange);
end if;

 

SpeichervektorYAbs2:=Vector[row](ObenN-UntenN+1);
SpeichervektorYRel2:=Vector[row](ObenN-UntenN+1);
for i2 from UntenN to ObenN do
  SpeichervektorX[i2-UntenN+1]:=i2;  
  SpeichervektorYAbs2[i2-UntenN+1]:= GaußKronrodQuadraturKurz(Unten2,Oben2,f2Nr2,G2Nr2,i2)-int           (f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2); # Bestimmen des absoluten Fehlers von f2Nr2 für n=i2
  if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2)     <> 0) then  #Bestimmen des relativen Fehlers von f2, falls dieser für beide Funktionen definiert ist
    SpeichervektorYRel2[i2-UntenN+1]:= abs(SpeichervektorYAbs2[i2-UntenN+1]/
    int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2));
  end if;
end do;
InterpolationsfunktionAbs2:=Spline(SpeichervektorX,SpeichervektorYAbs2,n); #Generierung des
   #  Splines aus Stützpunkten, die sich aus den absoluten Fehlern von f2Nr2 ergeben
GraphAbs2:= plot(InterpolationsfunktionAbs2, n=UntenN..ObenN, color=red, legend = ["f2"]);
   #  Generierung des Graphen, der sich aus dem Spline aus den absoluten Fehlern von f2Nr2 ergibt
PunkteAbs2:= plot(SpeichervektorX,SpeichervektorYAbs2,style = point, color=blue);
   #  Generierung des Punktgraphen, der sich aus den absoluten Fehlern von f2Nr2 ergibt  
print(display({GraphAbs1,PunkteAbs1,GraphAbs2,PunkteAbs2}, title= "Absoluter Fehler",titlefont=["ROMAN",18])); # Ausgeben des Verleichsgraphen der absoluten Fehler
if (int(f2Nr1*diff(G2Nr1,x),x= Unten2..Oben2) <> 0) and (int(f2Nr2*diff(G2Nr2,x),x= Unten2..Oben2) <> 0) then # falls der relative Fehler definiert ist analoges Vorgehen für die relativen Fehler
  InterpolationsfunktionRel2:=Spline(SpeichervektorX,SpeichervektorYRel2,n);
  GraphRel2:= plot(InterpolationsfunktionRel2, n=UntenN..ObenN, color=red, legend = ["f2"]);
  PunkteRel2:= plot(SpeichervektorX,SpeichervektorYRel2,style = point, color=blue);
  print(display({GraphRel1,GraphRel2,PunkteRel1,PunkteRel2}, title= "Relativer Fehler", titlefont=       ["ROMAN",18])) # Ausgeben des Verleichsgraphen der relativen Fehler, falls diese definiert sind
end if;
 print(SpeichervektorYAbs1,SpeichervektorYAbs2);
 print(GraphAbs1);
 print(PunkteAbs1)
end proc

 

i want to generate grid for a C_D nozzle but i dont know ho to plot it. please help me how to plot.

restart;
alpha := 0;
beta := 2;
Imax := 11;
Jmax := 11;
L := 10;
`&Delta;&zeta;` := L/(Imax-1);

`&Delta;x` := `&Delta;&zeta;`;
`&Delta;&eta;` := 1/(Jmax-1);

printlevel := 2;
for i to Imax do for j to Jmax do x[i] := `&Delta;&zeta;`*(i-1); eta[j] := `&Delta;&eta;`*(j-1); z := (eta[j]-alpha)*ln((beta+1)/(beta-1))/(1-alpha); H[i] := 3+2*tanh(x[i]-6); H1[i] := 0; H2[i] := -H[i]; y[i, j] := -H[i]*(2*beta/(exp(z)+1)-beta-2*alpha)/(2*alpha+1); Y[i, j] := (H1[i]+(-H1[i]*x[i]+H2[i])/L)*eta[j] end do end do;

 

 

Given the 2 equations below...

-T*sin(theta(t)) = m*(diff(X(t), t, t)+L*(diff(theta(t), t, t))*cos(theta(t))-L*(diff(theta(t), t))^2*sin(theta(t)))

 T*cos(theta(t))-m*g = m*(diff(Y(t), t, t)+L*(diff(theta(t), t, t))*sin(theta(t))+L*(diff(theta(t), t))^2*cos(theta(t)))

which command(s) will eliminate T and m to give the ODE below?

 L*diff(theta(t), x, x)+(diff(X(t), x, x))*cos(theta)+(diff(Y(t), x, x)+g)*sin(theta) = 0

 

 

with ref to the following post

https://www.mapleprimes.com/questions/226211-Subscript-In-Axis-Title-Get-Messed-Up

Now I am having a problem with legends that they are not properly displayed. Dashing of the legends is not displayed in exported graph. Because the legends are too short so they are unable to reflect the dashing of the curves. Is there any way to extend the length? so that the dashing is reflected properly in the legends.

mapleprime.mw

 

Hi all,

I have some difficulties to get simple real expressions for those simple integrals with assumptions.

Download integrals.mw

NB: With mathematica, I get simple real expressions results.

Thanks

with ref to the following post
https://www.mapleprimes.com/questions/210280-Exporting--Graph-

I am trying to export a plot which contains a subscript in its axis label. The label displays correctly in the maple worksheet but when I export it to a jpg file the subscript gets replaced with square brackets. Kindly guide me how can I get rid of this problem

mprime.mw

Hey there,

I've been struggling for a few days to integrate a function using rkf45.

For some context, I wish to numerically intergrate a function K * s_R (K,a,w) dK using runge kutta over a 2D grid of (a,w) values. Essentialy, performing the same sort of K-integral many different times for slightly different combinations of a and w. For one such (a,w) combination, the function looks something like this:

and rkf45 works just fine, and returns a numeric result. On the other hand, for a different combination of (a,w), the function looks like this:

and an attempt to perform rkf45 returns the following error: "cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up."

Here is a simplified version of my maple document for reference MaplePrimePleaseHelp.mw.

I'm happy to clarify anything that may be confusing and any thoughts or suggestions would be greatly appreciated.

Thank you!

I have a physics question I need to program it by Maple , Can you help me to solve ? Its Problem 9.34 from Griffiths

Hey there,

I'm trying to numerically intergrate a function s(K,i,j) dK using runge kutta over a 2D grid of i,j values. Essentialy, performing the same sort of integral many different times for slightly different combinations of i and j. The function is more or less gaussian, and so the bulk of the result will come from the values of K around the peak of said gaussian. For some combinations of i and j, the function seems to have a singularity on the right edge of the gaussian peak, which causes my script to spit out an error, telling me the calculation cannot be performed further to the right past the singularity. Now, like i said before, the singularity is on the very edge of the gaussian and therefore I am perfectly happy to stop the integration before the singularity, because anything past it wont contribute very much to the result.

How can I use dsolve events to halt my integration just before hitting the singularity?

RK := (i, j) -> dsolve({diff(n(K), K) = K*s(K, a[i], b[j]), n(0) = 0}, numeric, method = rkf45)

 

In the uploaded worksheet a block slides up the Hill from an initial position at an initial horizontal velocity. The block's motion is subject to sliding friction.

How can the equations of the block's motion be obtained to include the effects of gravity and friction?

It may simplify the answer to end the block's upward motion when gravity and friction bring it to an instantaneous halt.

Block_sliding.mw

Hi

How can i solve this system of equations:
{c*(N-k)*(1-exp(-p)) = p, -d*((k-N)*exp(-p)-k) = N, 0 < N, 0 < p, 1 < c, 1 < d, 1 < k}

N and P are variables and the others are constant numbers.

I used "solve" function but the results are:
piecewise(And(1 < c, 1 < d, 1 < k, 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)*d/((d-1)*c), 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)), [{N = d*k*(exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1), p = c*k*(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-d-exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))+1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)}], [])

piecewise(And(1 < c, 1 < d, 1 < k, 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)*d/((d-1)*c), 0 < -RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z)), [{N = d*k*(exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1), p = c*k*(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-d-exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))+1)/(d*exp(RootOf(exp(_Z)*c*d*k+exp(_Z)*_Z*d-exp(_Z)*c*k-c*d*k+c*k-_Z))-1)}], [])

 

 

 

During running my ws I faced with memory error as below, where as my system have enough memory (120GB)

Warning, Run: unable to set assignto result due to error:  Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc

Maple's help suggests :Software limits are imposed by the -T command-line argument, the datalimit argument to kernelopts and system imposed user limits (for example shell limits).
  But I could not understand how to increase software limit.

 

how to fix that?

I unprotect the GAMMA, but still receives error:

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.


 

NULL

restart

II := 2

2

(1)

JJ := 2

2

(2)

N := 2:

unprotect(GAMMA):

q := max(II+1, JJ+1):

M := 5:

seq(seq(seq(assign(GAMMA[i, j, r], a*`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r]), i = 0 .. q), j = 0 .. q), r = 1 .. N):

a := .2:

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc:
``

`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M):

f1 := RandomArray(II+1, JJ+1):

for m to M do `&Gamma;m`[1, m] := f1; `&Gamma;m`[2, m] := f2; `&Gamma;m`[3, m] := f3; `&Gamma;m`[4, m] := f4; `&Gamma;m`[5, m] := f5; `&Gamma;m`[6, m] := f6 end do:

unprotect(`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`):

for m to M do `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Gamma;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Gamma;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Gamma;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Gamma;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Gamma;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Gamma;m`[6, m], [0 .. II, 0 .. JJ]) end do:

UP := proc (s, GAMMA, N, M, a, b, II, JJ) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

Grid:-Seq(UP(s, GAMMA, N, M, a, b, II, JJ), s = 1 .. 2)

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

UP(1, GAMMA, N, M, a, b, II, JJ), UP(2, GAMMA, N, M, a, b, II, JJ)

(3)

NULL


 

Download soal.mw

 

What is the problem?

 

Dear all,

Greeting!

I am a new user of Maple. I want to perform a simple (to me, it is very difficult) integration  defined as follows 

range from 0 to omega (frequency). alpha^2F (omega) is constant function with set of values (already calculated) for the corresponding frequency. I have calculated the frequencies ranging from 54 to 900 cm-1. Suppose I have alpha^2F(omega)=0, 0.5,0.6,0.7......0.1 for omega=58, 80, 110, 190,.....800, how can I perform this integration  in Maple? Please help me how can I cope with this problem.

Thanks a lot.

Best Regards,

 

I would like to animate the motion of a bicycle racer on a classic velodrome track i.e. one with varied vertical and horizontal curvatures along its length.

Is there a source which explains the math expressions which model the shape of such a track?

First 11 12 13 14 15 16 17 Last Page 13 of 60