MaplePrimes Questions

Hi Dear,

I hope everyone is fine here. In the attached file, I have generated a square matrix "Q" using two-dimensional polynomials. The dimension of the square matrix "Q" depends on M1 and M2 parameters. In my simulation, sometimes I need this matrix of 1000 by 1000 dimensions. Using the attached method, it took a lot of time to compute two-dimensional polynomials and then to compute the general square matrix "Q." I wanted to write this matrix using proc (procedures). Maybe by using this way, I don't need to compute the polynomials, and it took less time to compute the square matrix "Q." I know how to generate a matrix using proc when its dimension depends on one parameter. However, here, the dimension of matrix "Q" depends on two parameters, M1 and M2. So, I am a little bit confused about how to adjust them in proc. Please see the attached file and share your useful ideas. 

help.mw

Thanks in advance

In the attachment is an attempt with undesireable rendering artefacts

I did not use color functions because I intend to export the black fields of the ball to stl format to use them for a better visualisation of spinning spheres in MapleSim.

A related question: The generating function for the chessboard looks complicated to me. Maybe there is a more elegant way to do it.

Chessboard_sphere.mw

i did all the time like that and don't have any issue but i don't know why not take derivative by x and t have a problem when i remove t is ok but when i take duble derivative by x and t not run and did't give me error too what is problem with this?

restart

with(PDEtools)

with(LinearAlgebra)

with(Physics)

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

tr := {t = tau, x = xi+delta*(tau+1), u(x, t) = U(xi)*exp(I*(-kx+w*(t+1)))}

{t = tau, x = xi+delta*(tau+1), u(x, t) = U(xi)*exp(I*(-kx+w*(t+1)))}

(2)

pde := I*(diff(u(x, t), t))+alpha*(diff(u(x, t), `$`(x, 2)))+beta*(diff(u(x, t), x, t))+gamma*u(x, t)*V(xi) = 0

 

NULL

Download non_sense.mw

As by title, is it possible to check intermediate results found by nodes when using Grid:Map, and stop the execution according to these?

Is there a way to license a Maple package? Protect it from copying?

Thanks

When i am solving for delta...its taking so much time? And the simplyfying command not working showing error
Attaching sheet: Q_simplify_solv.mw

every time i have a small problem 2  why not cancel number 2 in denominator , i don't want see a number with fraction like 1/3  3/4 how i fix this

restart

K := (1/2)*sqrt(2*sqrt(2)*sqrt(lambda*a[5]/a[4])+2*sqrt(-2*a[5]/a[4])*(B[1]*sqrt(-lambda)*sinh(sigma)+B[2]*sqrt(-lambda)*cosh(sigma))/(B[1]*cosh(sigma)+B[2]*sinh(sigma)+mu/lambda)+2*sqrt(-(2*(lambda^2*B[1]^2*a[5]-lambda^2*B[2]^2*a[5]-mu^2*a[5]))/(lambda*a[4]))/(B[1]*cosh(sigma)+B[2]*sinh(sigma)+mu/lambda))*e^(i*psi(x, t))

Warning, if e is meant to be the exponential e, use command/symbol completion or palettes to enter this special symbol, or use the exp function

 

(1/2)*(2*2^(1/2)*(lambda*a[5]/a[4])^(1/2)+2*(-2*a[5]/a[4])^(1/2)*(B[1]*(-lambda)^(1/2)*sinh(sigma)+B[2]*(-lambda)^(1/2)*cosh(sigma))/(B[1]*cosh(sigma)+B[2]*sinh(sigma)+mu/lambda)+2*(-2*(lambda^2*B[1]^2*a[5]-lambda^2*B[2]^2*a[5]-mu^2*a[5])/(lambda*a[4]))^(1/2)/(B[1]*cosh(sigma)+B[2]*sinh(sigma)+mu/lambda))^(1/2)*e^(i*psi(x, t))

(1)

B[1] := 0; mu := 0

0

 

0

(2)

simplify(eval(K))

(1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t))

(3)

simplify((1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t)), 'trig')

(1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t))

(4)

simplify((1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t)))

(1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t))

(5)

simplify((1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t)), 'constant')

(1/2)*2^(3/4)*(((coth(sigma)*(-lambda)^(1/2)*(-a[5]/a[4])^(1/2)+(lambda*a[5]/a[4])^(1/2))*B[2]+csch(sigma)*(lambda*a[5]*B[2]^2/a[4])^(1/2))/B[2])^(1/2)*e^(i*psi(x, t))

(6)
 

 

 

NULL

Download cancelation.mw

Recently a new configuration of a computer, with a better cpu - AMD Ryzen 7 8700G w/ Radeon 780M Graphics, but maple computation is particularly slow, cpu call special less computation is particularly slow, is there any way to improve?

How we can change identity like 1/sin(x)=csc(x) or 1/cos(x)=sec(x) sometime our function is beger than this and radical come in how i can do thus simplification?

restart

M := sin(x)/cos(x)

sin(x)/cos(x)

(1)

convert(M, trig)

sin(x)/cos(x)

(2)

tan(x)

tan(x)

(3)

simplify(M)

sin(x)/cos(x)

(4)

K := 1/sinh(x)

1/sinh(x)

(5)

simplify(convert(K, trig))

1/sinh(x)

(6)

csch(x)

csch(x)

(7)

Q := sqrt(beta[0]/(B[1]*cosh(xi*sqrt(-lambda))))

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

(8)

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

(9)

simplify((beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2), 'trig')

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

(10)
 

NULL

Download identity_change.mw

Since my problem involving a 2d heat equation was answered so well,

(hats off to nm !!) I thought I would try another PDE question.

 

Question: can pdsolve handle a combination of the function and its derivative for

the boundary conditions, i.e., Robin boundary conditions?

 

I looked through the document example, pdsolve_boundaryconditions, which was

beautifully written. However, I saw no example with Robin BCs.

 

"restart; interface(imaginaryunit = i):      StartTemp(x):= `T__0`*(e)^(-`alpha__0` )*cos(Pi*(x)/(`L__0`));   `L__0` := 10: #` Length of rod` `T__0` := 100: #` max temperature` `alpha__0` := 6/(100): #`  Dampening factor` plot(StartTemp(x) , x = 0 .. `L__0`,  thickness = 5,             view = [0..`L__0`, -100..100],  labels = ["Position on rod", "Temperature"], labelfont = [Times, 14],             labeldirections = [horizontal, vertical], title = "Temperature in rod at t = 0" , titlefont = [Times, 16],             size = [500, 225]);"

proc (x) options operator, arrow, function_assign; T__0*exp(-alpha__0)*cos(Pi*x/L__0) end proc

 

 

The equation and the initial condition:

heat_equation := diff(T(x, t), t) = k*(diff(T(x, t), x, x)); initial_condition := T(x, 0) = T__i(x)

Using a linear combination of the function and its derivative, i.e., Robin BCs.

boundary_conditions := `α__r`*T(0, t)+`β__r`*(D[1](T))(0, t) = f(t), `α__r`*T(L__0, t)+`β__r`*(D[1](T))(L__0, t) = g(t)

 

Setting the constants

"  `alpha__r` := 1:  #` Constant for boundary condition`  `beta__r` := 2: #` Constant for boundary condition`     `T__s`:= 10:  #` Time interval`  k:=9/(10):  #` Heat-conductivity of material`    f(t) :=-1/(10) t:                  g(t):=1/(10) t:  "

Solving using nm's technique of not defining the function before calling pdsolve

sols := pdsolve({heat_equation, boundary_conditions, initial_condition}, T(x, t))

 

Now include the initial temperature function

"`T__i`(x) := StartTemp(x):  "

Extracting the solution, and using 20 terms

sol := eval(rhs(sols), infinity = 20)

-134/135+(1/270)*x^3-(7/90)*x^2+(67/135)*x+Sum(exp(-(9/1000)*Pi^2*n^2*t)*(Pi*n*cos((1/10)*n*Pi*x)-5*sin((1/10)*n*Pi*x))*(Int(-(x^3-21*x^2+134*x-27000*exp(-3/50)*cos((1/10)*Pi*x)-268)*(Pi*n*cos((1/10)*n*Pi*x)-5*sin((1/10)*n*Pi*x)), x = 0 .. 10))/(1350*Pi^2*n^2+33750), n = 1 .. 20)+(1/50)*t*x-(7/50)*t

(1)

Evaluate the integrals and build the solution to the temperature as a function of position and time

T__sol := MakeFunction(value(sol), x, t)

 

Here is the problem:

in plotting the solution at t = 0, we do NOT reproduce the initial temperature function.

 

plot(T__sol(x, 0), x = 0 .. L__0, -120 .. 120, thickness = 5, size = [500, 225])

 

If I use boundary conditions for either Dirichlet or Neumann, i.e., T(0, t) & T(L__0, t) 

or "`T__x`(0,t) & `T__x`(`L__0`,t)", the initial function is reproduced at t = 0.

 

Is this example one of those situations that was addressed in the notes?

Given a problem with PDEs and some BCs, note the following:

• 

Depending on how you write a general PDE solution, it becomes
possible or nearly impossible to adjust it to match the BCs.

 

NULL

Download Heat_Equation_1D_Robin_Conditions.mw

Using Maple to prove one of the axioms in mathematics.

The idea is to prove that (-1)*(-1)= 1.  The mere fact that 0's are involved in the proof makes it harder.  So it's easy enough on paper to solve, as I will show in the steps below.

It is known 0*x=0 for all values of x,
and 1-1=0,
If we let x=-1, then 0*(-1)=0,
sub in for zero   (1-1)(-1)=0,
expand (1)*(-1) + (-1)*(-1)=0, also we agree that 1*y=y for all values of y,
so ......  (-1) + (-1)*(-1)=0,
and therefore (-1)*(-1) = 1

Does anyone have an elegant way of showing that in Maple?

OneFrame := proc(k)
local Courbe, T, a, b, c, t, P, Q, NormM, F, Ell, sol, N1, N2, dr, tx;
a := 11; b := 7; c := sqrt(a^2 - b^2); t := 1/3*Pi;
Ell := x^2/a^2 + y^2/b^2 = 1;
geometry:-point(T, (a^2 - b^2)*cos(t)^3/a, -(a^2 - b^2)*sin(t)^3/b);
Courbe := plots:-implicitplot(Ell, x = -a - 10 .. a + 10, y = -b - 10 .. b + 10, scaling = constrained, color = blue);
NormM := plots:-implicitplot(y - b*sin(t) = a*sin(t)*(x - a*cos(t))/(b*cos(t)), x = -a - 5 .. a + 10, y = -b - 10 .. b + 10, color = orange); geometry:-line(Per, y - b*sin(t) = a*sin(t)*(x - a*cos(t))/(b*cos(t)), [x, y]);
geometry:-point(P, subs(y = 0
, geometry:-Equation(Per), 0));
geometry:-point(Q, 0, subs(x = 0, geometry:-Equation(Per)));
geometry:-point(M, a*cos(t), b*sin(t));
geometry:-point(N1, a*cos(k), b*sin(k));
geometry:-point(F, 2.329411765, -2.567510609);
geometry:-line(L, N1, F);
sol := solve({geometry:-Equation(L), Ell}, {x, y},explicit);
geometry:-point(N2, subs(sol[2], x), subs(sol[2], y));
geometry:-segment(sg, N1, N2);
tx := plots:-textplot([[geometry:-coordinates(M)[], "M"],
[geometry:-coordinates(N1)[], "N1"], [geometry:-coordinates(N2)[], "N2"],
[geometry:-coordinates(P)[], "P"],
[geometry:-coordinates(Q)[], "Q"],
[geometry:-coordinates(F)[], "F point de Frégier"],
[geometry:-coordinates(T)[], "T"]], font = [times, bold, 16], align = [above, left]);
dr := geometry:-draw([sg(color = magenta, linestyle = dash),
Per(color = black), P(color = red, symbol = solidcircle, symbolsize = 12),
Q(color = red, symbol = solidcircle, symbolsize = 12),
M(color = black, symbol = solidcircle, symbolsize = 12),
F(color = red, symbol = solidcircle, symbolsize = 12),
N1(color = black, symbol = solidcircle, symbolsize = 8),
N2(color = black, symbol = solidcircle, symbolsize = 8),
T(color = black, symbol = solidcircle, symbolsize = 8)]);
plots:-display(Courbe, tx, dr, scaling = constrained, axes = none); end proc;

plots:-animate(OneFrame, [k], k = Pi/3 .. Pi, frames = 50);
Error, (in plots/animate) wrong type of arguments
Why this animation does't work ? Thank you very much.
 

Dear Maple users

I am defining various geometrical items in the plottools package and finally plot them using the display command. Let's say I have defined:

Circle1:=circle(...):

Circle2:=circle(...):

Line1:=line(...):

etc.

and finally want to plot them with the display command:

display(Circle1,Circle2,Line1,...)

It works, however sometimes I only want some of these items to be plotted. Certain variables at the beginning of the document do control if those items should be plotted or not. Let's say a variable CircleOrNot can be set to have the values "no" or "yes", and if I set it to "yes", it should plot it and if the value is "no", it should not plot it. I know that I can make a conditional statement in the end when dealing with the display command, but it can be quite a mess (condition after condition ...).

What I would like is making a conditional assignment like the following:

If CircleOrNot="yes" then Circle1:=circle(...) else Circle1:=null end if

or something like that, and afterwards use the full display command including all objects:

display(Circle1,Circle2,Line1,...)

But it does not work. I receive an error. There doesn't seem to be an empty statement, which will just be ignored by the display command. How can I do it? Probably someone has a good way to handle this situation.

Best regards,

Erik

First 60 61 62 63 64 65 66 Last Page 62 of 2426