Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

with(plots); R1 := .1; R0 := .1; m := .1; a := .1; Ha := .1; Nt := .1; Nb := .1; Pr := 6.2; Le := .6; Bi := 1; Ec := .1; k := 1; r := .1; A := 1; fcns := {C(y), T(y), U(y), W(y)}; sys := diff(U(y), `$`(y, 2))+(R1*(diff(U(y), y))-2*R0*W(y))*exp(a*T(y))-a*(diff(U(y), y))*(diff(T(y), y))-Ha*(U(y)+m*W(y))*exp(a*T(y))/(m^2+1)-U(y)/k+A*exp(a*T(y)) = 0, diff(W(y), `$`(y, 2))+(R1*(diff(W(y), y))+2*R0*U(y))*exp(a*T(y))-a*(diff(W(y), y))*(diff(T(y), y))-Ha*(W(y)-m*U(y))*exp(a*T(y))/(m^2+1)-W(y)/k = 0, diff(T(y), `$`(y, 2))+R1*Pr*(diff(T(y), y))+Pr*Ec*exp(-a*T(y))*((diff(U(y), y))*(diff(U(y), y))+(diff(W(y), y))*(diff(W(y), y)))+Nt*(diff(T(y), y))*(diff(T(y), y))+Pr*Ec*(U(y)*U(y)+W(y)*W(y))*exp(-a*T(y))/k = 0, diff(C(y), `$`(y, 2))+Pr*Le*R1*(diff(C(y), y))+Nt*(diff(C(y), `$`(y, 2)))/Nb-r*C(y) = 0; bc := U(0) = 0, W(0) = 0, C(0) = 0, (D(T))(0) = Bi*(T(0)-1), U(1) = 0, W(1) = 0, C(1) = 1, T(1) = 0; L := [.5, 1.0, 1.5, 2.0]; AP := NULL; for k to 4 do R := dsolve(eval({bc, sys}, Ha = L[k]), fcns, type = numeric, method = bvp[midrich], AP); AP := approxsoln = R; p1u[k] := odeplot(R, [y, U(y)], 0 .. 1, numpoints = 100, labels = ["y", "U"], linestyle = dash, color = black) end do; display({p1u[1], p1u[2], p1u[3], p1u[4]})

for small value of k no change show in plot... the resulted value is so small and the system consider it zero and show no change in plot.. then how to get the change in plot to change in k... ??? plz suggest 


 

restart; Digits := 5; with(plots); with(LinearAlgebra)

a := 0:

0.11976e-3*k

(1)

for i from 0 while i <= N do u[i, 0] := h*i+1 end do:

for j from 0 while j <= N+1 do u[0, j] := .1; u[N+1, j] := .5 end do:

printlevel := 2:

NULL

NULL

sys := ([seq])(seq(eq[i, j], j = 0 .. N), i = 1 .. N):

nops(sys);

vars:=indets(sys) minus {k}:

nn := Matrix(N+1, N+1,(i, j)-> u[i-1, j-1]):

##

p:=proc(kk) local u_res,A;

  u_res:=solve(eval(sys,k=kk),vars);

  A:=eval(nn,u_res);

  plots:-matrixplot(A)

end proc;

## Testing p for k=0.001:

p(0.001);

## Animating the plot for k=0.0001..0.001:

plots:-animate(p,[k],k=0.0001..0.001);

 

90

 

proc (kk) local u_res, A; u_res := solve(eval(sys, k = kk), vars); A := eval(nn, u_res); plots:-matrixplot(A) end proc

 

 

 

 

``


 

Download Crank_scheme_4.mw
 

restart; Digits := 5; with(plots); with(LinearAlgebra)

a := 0:

0.11976e-3*k

(1)

for i from 0 while i <= N do u[i, 0] := h*i+1 end do:

for j from 0 while j <= N+1 do u[0, j] := .1; u[N+1, j] := .5 end do:

printlevel := 2:

NULL

NULL

sys := ([seq])(seq(eq[i, j], j = 0 .. N), i = 1 .. N):

nops(sys);

vars:=indets(sys) minus {k}:

nn := Matrix(N+1, N+1,(i, j)-> u[i-1, j-1]):

##

p:=proc(kk) local u_res,A;

  u_res:=solve(eval(sys,k=kk),vars);

  A:=eval(nn,u_res);

  plots:-matrixplot(A)

end proc;

## Testing p for k=0.001:

p(0.001);

## Animating the plot for k=0.0001..0.001:

plots:-animate(p,[k],k=0.0001..0.001);

 

90

 

proc (kk) local u_res, A; u_res := solve(eval(sys, k = kk), vars); A := eval(nn, u_res); plots:-matrixplot(A) end proc

 

 

 

 

``


 

Download Crank_scheme_4.mw

 

Dear all, I had a challenge of using maple to obtain numerical solution of a volterra-integral equation using the method of reproducing kernel space, however I converted the integral equation to an ode and try to solve it numerically but obtatined an error message. Please how do I overcome it? the problem is as follows:

dsn := dsolve({diff(u(x), x) = e^x*ln(e)+(2/9)*e^3-1/9+int(y*u(y)^3, y = 0 .. 1), u(0) = 1}, numeric)

Here in my code I am trying to differentiate a finite summation and the command Sum is giving me a simpler evaluation than the command sum.

But I have a problem, the command Sum doesn't work under signal processing tool. Is there away to make it work?

 

 

For some unknown reason, the code below does not work in Maple 2018.1, but works in Maple 2015 and Maple 2017 (the idea is taken from here

restart; 
with(plottools): with(plots):
V1,V2,V3,V4,V5,V6,V7,V8:=[0,-1,0],[0,0,0],[1,0,0],[1,-1,0],[0,-1,1],[0,0,1],[1,0,1],[1,-1,1]:  # The vertices of the cube
Faces:=[[V1,V4,V8,V5],[V5,V6,V7,V8],[V2,V3,V7,V6],[V1,V2,V3,V4],[V3,V4,V8,V7],[V1,V2,V6,V5]]: # The list of the faces
Colors:=[green, red,RGB(1, 0, 4),blue,grey,gold]: # The list of the colors
Cube[0]:=display([seq(polygon(Faces[i],color=Colors[i]),i=1..6)]):

for n from 1 to 7 do
F[n]:=t->rotate(Cube[n-1],t, [[0,n-1,0],[1,n-1,0]]):
Cube[n]:=rotate(Cube[n-1],-Pi/2, [[0,n-1,0],[1,n-1,0]]):
A[n]:=animate(display,[F[n](t)], t=0..-Pi/2,paraminfo=false);
od:

for m from 6 to 0 by -1 do
G[m]:=t->rotate(Cube[m+1],t, [[0,m,0],[1,m,0]]):
B[m]:=animate(display,[G[m](t)], t=0..Pi/2,paraminfo=false);
od:

C1:=display([seq(A[k], k=1..7)], insequence):
C2:=display([seq(B[k], k=6..0, -1)], insequence):
display([C1,C2], insequence, scaling=constrained, axes=normal);

 

I currently have a procedure that runs a fairly complicated formula involving non-commutative variables. The procedure is Vu(a, b, c) where a, b, and c are any integers. I have to run this formula whenever vacub appears in my expression. I'm currently replacing each variable of this type with the procedure Vu(a, b, c). I'm wanted to automate that process if possible. One thought I had was to assign the value of Vu(a, b, c) to the variable vacub for any value of a, b, and c from 1 to 5. Then use the eval command to replace the variables with the proper values. Is there any way to automate this process? Let me give you an example:

v0u0 = u0v0 + 2w0

So u0v0u0 = u0(u0v0+2w0) = u02v0+2u0w0

I have a procedure to truncate algebraic equations. Found the basic answer hrere. I would like to make it handle equations and functions i.e f:=a x^2 +b y... and f(x,y):=c x y^2.... I can make it handle the first type but not the second.

restart

``

NULL

NULL

Trunc := proc (eq, odr := 2, v::list := [x, y, z]) local a, b, q; description " Truncates an algebraic equation to required degree"; a := eq; b := v; map(select, proc (q) options operator, arrow; evalb(degree(q, b) <= odr) end proc, a) end proc

proc (eq, odr := 2, v::list := [x, y, z]) local a, b, q; description " Truncates an algebraic equation to required degree"; a := eq; b := v; map(select, proc (q) options operator, arrow; evalb(degree(q, b) <= odr) end proc, a) end proc

(1)

"E1(x,y,z):=2+3 x-y+5 x^(2)y+4 x y+x y^(3)+3 a^(2)+z+z^(2)"

proc (x, y, z) options operator, arrow, function_assign; 2+3*x-y+5*x^2*y+4*y*x+x*y^3+3*a^2+z+z^2 end proc

(2)

Trunc(E1, 2, [x, y, z])

E1

(3)

``

E2 := E1(x, y, z)

x*y^3+5*x^2*y+3*a^2+4*x*y+z^2+3*x-y+z+2

(4)

Trunc(E2, 1, [x, y])

3*a^2+z^2+3*x-y+z+2

(5)

Trunc(E2, 1, [x, y, z])

3*a^2+3*x-y+z+2

(6)

``whattype(E1(x, y, z))

`+`

(7)

whattype(E2)

`+`

(8)

``


 

Download Truncate.mw

Could anyone tell me why Maple changes the sign of some expressions? For example...

I would like the outputs to be that way.

sqrt(r/(r-b))

How to prevent this changes?

Thanks in advance,

 

Denis

How to linearize this complex dynamical system around x1(t)=0, x2(t)=0, x3(t)=0. Basically i want to keep nonlinear part up to fifth order on the right hand side and later want to drop it. How can i do it. The maplesheet Dyn_system.mw is attached.

Many thanks in advance.

How can I generate a sequence of random numbers Xi and Yi in [-1,1] ?

 

Why I couln't receive the value of Wn[0, 0, 1] in the following loop?

Download sual.mw

 

> restart;

>for n from 1 to 3 do

Wn[0 .. 1, 0 .. 1, n] := n*ArrayTools:-Alias(Matrix(2, 2, [[3, 1], [1, 3]]), [0 .. 1, 0 .. 1])

end do:
>Wn[0, 0, 1];

Wn[0, 0, 1]

 

We produce only one rotation of the cube by the angle Pi/2, and then repeat it at the following points, changing the colors of the faces in turn. And so the illusion is created that the cube is rolling along a straight line without slipping.
(Just a picture without any sense.) cube_without_slipping.mw

Hello

I want to compute integral with Maple,but returns unevaluated for me.

int((-5*ln(x)^4*Pi^4-20*ln(x)^2*Pi^4-8*Pi^4+120*MeijerG([[0, 0], [1, 1, 1]], [[0, 0, 0, 0, 0], []], x^Pi))/(120*Pi^4*(-1+x)^2), x = 4/10 .. 6/10, numeric);

# ???

Thanks.

Hi Primes Users,

We’re back with another tech support challenge that we wanted to share with you!

A customer had been having issues launching Maplets using the standard double-clicking method. This is a known issue that rarely occurs, but is being addressed for a future release. In the meantime, we were able to provide this person with a command-prompt-based way of opening the Maplet, and we thought it would be great to share in case you run into the same kind of problem.

After suggesting a few workarounds, our Team Lead was able to offer a command-prompt based way of solving the problem. Since command prompts are the target of batch scripts, which we had already used as a workaround for another issue, we just needed a way of programmatically creating scripts based on the command prompt code for each file.

Using various commands from the FileTools package (including a technique suggested by our Team Lead), we were able to put together code that takes all files in a particular folder (namely, a folder named “Maplets” on the Desktop), and creates a new batch script from a template that is based on the command prompt code (provided that the template is saved in the same Maplets folder under the file name “Maplet script”):

restart; with(FileTools): username := kernelopts(username):

directory := cat("C:\\Users\\", username, "\\Desktop\\Maplets"):

dir := ListDirectory(directory): dir := Basename~(dir):

main := cat(directory, "\\Maplet script.txt"): body := Import(main):


n := numelems(dir):

for i to n do

script := cat(directory, "\\launch ", dir[i], ".txt");

batch := cat(directory, "\\launch ", dir[i], ".bat");

newbody := StringTools:-Substitute(body, "name", dir[i]);

Export(script, newbody);

Rename(script, batch);

end do:


Script template:


if not "%minimized%"=="" goto :minimized

set minimized=true

start /min cmd /C "%~dpnx0"

goto :EOF

:minimized


"C:\Program Files\Maple 2018\bin.X86_64_WINDOWS\mapletviewer.exe" "C:\Users\%USERNAME%\Desktop\Maplets\name.maplet"

Before using the Maplet script:

After using the Maplet script:

If the appropriate executable is referenced, and the relevant file paths are adjusted accordingly, one should be able to adapt this process to other programs and their corresponding files.  In fact, any batch script that needs to be modified programmatically can be modified using these techniques.  Does anyone have other useful batch scripts that they’ve modified programmatically in Maple using similar techniques?

*(including dragging the files to the executable directly, which only seemed to work when the executable was in its original directory)

First 651 652 653 654 655 656 657 Last Page 653 of 2097