## Text output via label: How combine variable and te...

Hello,

I would like to combine and output different text modules that are saved in variables as strings but cannot get rid off the brackets and quotation marks

use DocumentTools in textOne:="Hello"; textTwo:="How are you?"; SetProperty(Label0, caption,[textOne, textTwo]); end use;

I alway get  ["Hello", "How are you?"] istead of Hello How are you?

If i remove the brackets [ ] after caption, the output is fine but only the first element appears. Hello

If I try the printf command, which apparently should remove the marks, the label won't output anything at all.

use DocumentTools in textOne:="Hello"; textTwo:="How are you?"; SetProperty(Label0, caption,[printf(textOne), printf(textTwo)]);

end use;

How ist it done? Help would be much appreciated.

Thanks a lot!

Regards, Ben

## Generating Random Unitary Matrices...

I am working on a physics problem where I will need to generate random unitaries of size N x N.

As I understand it this would require me to sample uniformly from U(N), where 'uniform' is in the sense of the Haar measure.  I believe this construction in Mathematica is called 'circular unitary ensemble' and was wondering if there was a similar routine in Maple or some simple code that would allow me to generate random unitaries of particular size.

## plotting contours and labelling...

I have the following two equations:

u=1-(8*(10.3968*t^2-5.8368*t*f-.229376*f^2-5.1984))/(4.56*t^2-2.56*t*f+.8192*f^2+2.28)^2;

x = f+t-(8*(-2.28*t+.64*f))/(2.28+2*(-t+.64*f)^2+2.56*t^2);

How can I plot the contours of u in the x-t plane (with its elevation value labelled in the line of each contour)?

Thank you a lot for your help!

## How can I generate samples from a discrete distrib...

Hi,

As in title: How can I generate random numbers sampled from, say, the logarithmic distribution (with a given value of the parameter)?

Thank you very much.

## How to convert a function expressed by the hyperge...

Anyone can help me to convert the following maple solution expressed by the hypergeom function to the LegendreP(n,b,x) or Q function?

 >
 >
 >
 >
 (1)
 >
 (2)
 >

https://math.stackexchange.com/questions/3254765/how-to-convert-a-hypergeom-function-to-the-legendre-function

I just want y(x) to be expressed in the form of LegendreP(n,b,x).

## output file to solution of PDE...

wave2.mw

Hellow!

I'm use Maple 13 (Linux)

I want save the value of u(x,t) at output file. This function is solution of PDE.

Can I get one file to each time value??

Ths

## How do I use simplification correctly?...

Hello!

I am truing to simplify kretchmann variable in the following worksheet:

 M > # Obtaining Ricci and Kretchmann; with(DifferentialGeometry):with(Tensor):
 > DGsetup([t, r, theta, phi], M); g := evalDG(-(1-2*M*mu/r)^(1/mu)*dt &t dt+(1-2*M*mu/r)^(-1/mu)*&t(dr, dr)+r^2*(1-2*M*mu/r)^(1-1/mu)*(&t(dtheta, dtheta)+sin(theta)^2*&t(dphi, dphi))); C := Christoffel(g):
 (1.1)

Rie := CurvatureTensor(C):
R := RicciScalar(g,Rie);
h := InverseMetric(g):
kretchmann := ContractIndices(RaiseLowerIndices(g, Rie, [1]), RaiseLowerIndices(h, Rie, [2, 3, 4]), [[1, 1], [2, 2], [3, 3], [4, 4]]);

 (1.2)
 M > # simplification
 M > simplify(normal(R),symbolic)
 (1.3)
 M > simplify(kretchmann,size,symbolic)
 (1.4)
 M >

The problem is that I cannot obtain a good form of it. With Mathematica FullSimplify[] function I got the following form (LaTeX code incoming): $K =& 4 M^2 \Bigl(A-B r+C r^2\Bigr)(r-2 M \mu)^{\frac{2}{\mu}-4}r^{-\frac{2}{\mu}-4},\ A =&M^2 (\mu (3 \mu+2)+7) (\mu+1)^2,\,B = 8 M (\mu+2) (\mu+1),\, C = 12$, i.e. terms $(r-2 M \mu)$ and $r$ got fully factorized. However, I could never achieve the same form in Maple. Any help?

I am sorry if this is a silly and many-times-answered question, but I tried consulting with Maple help and googling solutions without any success.

Regards,
Nick

## Maple command for drawing a symbol s...

Is there anyway, i can using maple software command to create a symbol for either math or nursing.Math sumbol or nursing symbol..if there is a way, can u please let me kw the way, i need it urgently.Thanks

## vertical lines ...

Hi Maple experts and others,

We want to make a graph with 6 vertical lines.  One end of every vertical line will be on the x axis.  The other end of the vertical lines will be on integers of data points.

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 >

Regards,

Matt

## how to choose the colors of the "filled" option...

I'm trying to do something very simple, but I can not do it. I would like to fill the chart with colors of my choice.

restart: with (plots):
plots [animate] (plot, [[sqrt (x), sqrt (x) -1], x = 0..t, filled = true, view = [0..20, 0..5]], t = 0..20);

The filled = true option fills the graph with random colors.
I tried to use filled = ["Blue", "Red"], but that does not work.

Any tips?

Thank you

## How to make solution of this PDE a function in ord...

I got this solution from a PDE. I normally use unapply on the RHS of the solution to make it a function.

But in this, the PDE solution contain some extra stuff at the end. Which  "Where { .....}"

So the only way for me, was to manually copy the initial part of the solution shown on the screen in order to use it later.

I could not find a way to program this part.

Here is an example

restart;

f:=(r,z)->(r-a)*sin(z/H*Pi);
lap:=VectorCalculus:-Laplacian(u(r, z, t), cylindrical[r, theta,z]);
bc:=u(r,0,t)=0,u(r,H,t)=0, u(a,z,t)=0;
ic:=u(r,z,0) = f(r,z);
sol:=pdsolve([diff(u(r,z,t),t) = k*lap,bc,ic],u(r,z,t)) assuming a>0,k>0;


THis gives

Which I verified to be correct.

In case you are not able to get this solution (it needs Maple 2019.1 and Physics 368), here is the lprint

lprint(sol)

u(r,z,t) = casesplit/ans(Sum(-BesselJ(0,lambda[n]/a*r)*sin(z/H*Pi)*exp(-k*t*(
H^2*lambda[n]^2+Pi^2*a^2)/a^2/H^2)*a/lambda[n]^2*Pi*BesselJ(1,lambda[n])*
StruveH(0,lambda[n])/hypergeom([1/2],[1, 2],-lambda[n]^2),n = 1 .. infinity),{
And(lambda[n] = BesselJZeros(0,n),0 < lambda[n])})



Next to use it (plot., evaluate, etc...) changed the sum go to 15 terms (more than enough) and also replaced a->1,H->3,k->1/100 and  also replaced lambda[n] with BesselJ zeros as follows

sol:=subs({infinity=15,a=1,H=3,k=1/100,lambda[n]=BesselJZeros(0, n)},sol);

Before I use unapply, I had to extract the part of the solution up to where it says "where..." since I do not need the rest any more, since I allready replaced lambda[n] with BesselJZeros calls.

This I did by hand using copy/paste from the screen. Now I am able to finish the task:

solFiltered:=Sum(-BesselJ(0, BesselJZeros(0, n)*r)*sin(z*Pi/3)*
exp(-t*(9*BesselJZeros(0, n)^2 + Pi^2)/900)*Pi*
BesselJ(1, BesselJZeros(0, n))*
StruveH(0, BesselJZeros(0, n))/(BesselJZeros(0, n)^2*
hypergeom([1/2], [1, 2], -BesselJZeros(0, n)^2)), n = 1 .. 15):

mapleSol:=unapply(solFiltered,r,z,t);

value(mapleSol(.5,2,1));


Which prints -0.4107565091 which is the correct value. It matches my hand solution and also match numerical solution.

What would a better way to do the above than what I did? i.e. to obtain the solFitered above using code only?

## Simulation on perturbations...

Consider a wave y=f(x,t) with amplitude modulation such that it becomes

y_new=(1+A)*f(x,t), where A=A(t) is a small perturbation.

How can I do the simulation to test the robustness of the system to see if the wave is stable / unstable under perturbation? As the time t goes to infinity, I want to see if the original wave is distorted or not under either random or prescribed perturbation.

P.S. For example,  f(x,t) = (sech(0.5*x-0.1*t))^2.