Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

is possible to solvethis equation via maple?

hank you

EQUATION2.mw
 

restartNULL

alpha := 1.2*10^(-4); Betaa := 4.0*log(2); J := 13.4; delta := 15.3*10^(-9); tp := 10^(-13); tq := 8.5*10^(-12); tu := 90.0*10^(-12); kapa := 315; r0 := 2.0*10^(-7); Lx := 5.0*10^(-7); Ly := 5.0*10^(-7); Lz := 1.0*10^(-7); a := 0.7e-1*(Betaa/Pi)^.5*J/(15.3*10^(-22)); bb := exp(-((10^(-7)*x-(1/2)*Lx)^2+(10^(-7)*y-(1/2)*Ly)^2)/(2*r0^2)); print(aa = a); Q := a*exp(-z*10^(-7)/delta)*exp(-1.88*abs(t-2*tp)/tp)*bb

0.1200000000e-3

 

4.0*ln(2)

 

13.4

 

0.1530000000e-7

 

1/10000000000000

 

0.8500000000e-11

 

0.9000000000e-10

 

315

 

0.2000000000e-6

 

0.5000000000e-6

 

0.5000000000e-6

 

0.1000000000e-6

 

0.6917775548e21*ln(2)^.5

 

exp(-0.1250000000e14*((1/10000000)*x-0.2500000000e-6)^2-0.1250000000e14*((1/10000000)*y-0.2500000000e-6)^2)

 

aa = 0.6917775548e21*ln(2)^.5

 

0.6917775548e21*ln(2)^.5*exp(-6.535947712*z)*exp(-0.1880000000e14*abs(t-1/5000000000000))*exp(-0.1250000000e14*((1/10000000)*x-0.2500000000e-6)^2-0.1250000000e14*((1/10000000)*y-0.2500000000e-6)^2)

(1)

(diff(U(x, y, z, t), t)+tq*(diff(U(x, y, z, t), t, t)))/alpha = diff(U(x, y, z, t), x, x)+diff(U(x, y, z, t), y, y)+tu*(diff(U(x, y, z, t), x, x, t)+diff(U(x, y, z, t), y, y, t))+tu*(diff(U(x, y, z, t), z, z, t))+(Q+tq*(diff(Q, t)))/kapa

8333.333333*(diff(U(x, y, z, t), t))+0.7083333333e-7*(diff(diff(U(x, y, z, t), t), t)) = diff(diff(U(x, y, z, t), x), x)+diff(diff(U(x, y, z, t), y), y)+0.9000000000e-10*(diff(diff(diff(U(x, y, z, t), t), x), x))+0.9000000000e-10*(diff(diff(diff(U(x, y, z, t), t), y), y))+0.9000000000e-10*(diff(diff(diff(U(x, y, z, t), t), z), z))+0.2196119222e19*ln(2)^.5*exp(-6.535947712*z)*exp(-0.1880000000e14*abs(t-1/5000000000000))*exp(-0.1250000000e14*((1/10000000)*x-0.2500000000e-6)^2-0.1250000000e14*((1/10000000)*y-0.2500000000e-6)^2)-0.3509398517e21*ln(2)^.5*exp(-6.535947712*z)*abs(1, t-1/5000000000000)*exp(-0.1880000000e14*abs(t-1/5000000000000))*exp(-0.1250000000e14*((1/10000000)*x-0.2500000000e-6)^2-0.1250000000e14*((1/10000000)*y-0.2500000000e-6)^2)

(2)

``

 

Boundary condition:

U(0, y, z, t) = 300; U(Lx, y, z, t) = 300; U(x, 0, z, t) = 300; U(x, Ly, z, t) = 300; U(x, y, 0, t) = 300; U(x, y, Lz, t) = 300

#####################################

INITIAL CONDITIONS:

 

U(x, y, z, 0) = 300; (D[1](U))(x, y, z, 0) = 0

(D[1](U))(x, y, z, 0) = 0

(3)

NULL

 

``


 

Download EQUATION2.mw

 

 

help pls how to convert a data surface into a region:

surfdata([[1, 1, .69], [1, 2, .48], [2, 1, .37], [2, 2, .44]], axes = frame, labels = [x, y, z], filled = true)

I've tried to fill the volume below using the option "filled " without any results. I will appreciate any suggestion

how to find back the system which solution is maxwell equations?

as maxwell equations is an invariant, 

if solution is maxwell which is invariant, how to find back the system which solve it, the solution is maxwell?

will there a multiple systems which solution is maxwell equations?

if can not find, how to enumerate all combinations of systems to search maxwell equations?

Hi, 

Recently a few questions concerning the sampling of the Cauchy distribution and the sampling of a truncated Normal distribution have been posted (mainly by  @jalale).
This post is concerned by the sampling of a truncated (standard) Cauchy distribution.

In a first part the efficiency fo two methods is adressed in the case of a non-truncated Cauchy distribution:

  • The "standard" Maple's command Statistics:-Sample(Cauchy(0, 1), N)
  • And a general method a priori very efficient if one knows the ICDF (Inverse Cumulative Function Distribution). It happens that this ICDF is just cot(U*Pi)  where U is a Uniform RV over [0, 1].
     

The second part adresses the sampling of a truncatedCauchy distribution with two methods:

  • The "standard" Maple's command Statistics:-Sample(Cauchy(0, 1), N, method=[envelope, range=...])
  • The method based on the use of the ICDF

 

Results:

Test1 (non-truncated Cauchy distribution) 

  • "Standard" Maples sampling outperforms the ICDF based method in terms of :
    • memory occupation: ICDF is twice more demanding
    • cpu time: ICDF is ten times slower
       

Test2 (truncated Cauchy distribution) 

  • ICDF based method i outperforms "Standard" Maples sampling oin terms of :
    • memory occupation: Maples "envelope sampling" method is twice more demanding
    • cpu time: Maples "envelope sampling" method is two times slower


But, beyond these simple observations, a disturbing problem is: the "envelope sampling" method seems to not return the correct distribution (at least when used this waymethod=[envelope, range=a..b]  with a < b)
This is confirmed by the two last plot where histogram and PDF are uperimposed.

Do you think this problem can be avoided by another parameterization of the "envelope sampling" method or that it reveals some underlying problem with it?

PS: I did not investigate further for other distributions .

 


 

 

Sampling the Cauchy distribution

Maple's default sampling method outperformes the adhoc method

restart

with(Statistics):

C := RandomVariable(Cauchy(0, 1))

_R

(1)

f := unapply(CDF(C, t), t);

proc (t) options operator, arrow; 1/2+arctan(t)/Pi end proc

(2)

finv := unapply(-solve(f(t)=u, t), u)

proc (u) options operator, arrow; cot(u*Pi) end proc

(3)

# "natural" way to proceed

N  := 10^6:

S1 := CodeTools:-Usage(Sample(C, N)):

memory used=7.71MiB, alloc change=39.63MiB, cpu time=69.00ms, real time=69.00ms, gc time=8.72ms

 

# Let's try the sampling strategy based on the inverse of the CDF
# Usually it starts from sampling a Uniform RV on [0, 1] and
# next applies finv to the result.
#
# Smart but inefficient

U  := RandomVariable(Uniform(0., 1)):
S2 := CodeTools:-Usage(finv~(Sample(U, N))):

memory used=145.02MiB, alloc change=7.63MiB, cpu time=4.94s, real time=3.04s, gc time=2.61s

 

# Much more efficient
#
# Given the special form of finv it's simpler to sample a Unirorm RV
# on [0, Pi] and apply "cot" to the result

pi := evalf(Pi):
U  := RandomVariable(Uniform(0., pi)):
S2 := CodeTools:-Usage(cot~(Sample(U, N))):

memory used=15.28MiB, alloc change=0 bytes, cpu time=652.00ms, real time=237.00ms, gc time=577.78ms

 

Sampling a truncated Cauchy distribution

Example 1:
with(Statistics) + method=[envelope, range=-10..10]

The adhoc method outperforms Maple's default sampling method

S1 := CodeTools:-Usage(Sample(C, N, method=[envelope, range=-10..10])):

Histogram(S1);

memory used=8.88MiB, alloc change=-7.63MiB, cpu time=322.00ms, real time=260.00ms, gc time=93.77ms

 

 

p  := Probability(C < -10, numeric);
q  := 1-Probability(C > +10, numeric);
U  := RandomVariable(Uniform(p*pi, q*pi)):
S2 := CodeTools:-Usage(cot~(Sample(U, N))):

Histogram(S2);

HFloat(0.03172551743055352)

 

HFloat(0.9682744825694465)

 

memory used=15.28MiB, alloc change=7.63MiB, cpu time=170.00ms, real time=113.00ms, gc time=92.11ms

 

 

Sampling a truncated Cauchy distribution

Example 2:
with(Statistics) + method=[envelope, range=-1..1]

The adhoc method outperformes Maple's default sampling method

S1 := CodeTools:-Usage(Sample(C, N, method=[envelope, range=-1..1])):


scaling := Probability(C < +1, numeric) - Probability(C < -1, numeric);
plots:-display( Histogram(S1), plot(PDF(C, t)/scaling, t=-1..1, thickness=3, color=red) );

memory used=8.08MiB, alloc change=0 bytes, cpu time=246.00ms, real time=215.00ms, gc time=46.62ms

 

HFloat(0.5)

 

 

p  := Probability(C < -1, numeric);
q  := 1-Probability(C > +1, numeric);
U  := RandomVariable(Uniform(p*pi, q*pi)):
S2 := CodeTools:-Usage(cot~(Sample(U, N))):

plots:-display( Histogram(S2), plot(PDF(C, t)/scaling, t=-1..1, thickness=3, color=red) );

HFloat(0.25)

 

HFloat(0.75)

 

memory used=15.28MiB, alloc change=7.63MiB, cpu time=163.00ms, real time=106.00ms, gc time=85.93ms

 

 

 


 

Download CAUCHY_adhoc-sampling.mw

Hi

Please download the attachment.

 

I try to find a relation between EL and Lap(EL) in polar coordinate for one variable function w(r), where Lap is laplacian and EL is Euler Lagrange equation. Please check the Maple code and help me to do some manipulations to find a general relation (if any relation exists!).

In fact I need the inverse of Euler Lagrange equation to obtain f(r) for an arbitrary function g(r) in equation below

EL(f) = Lap(EL(g))

Or f=inverseEL(Lap(EL(g)))

Thank you for taking your time

 

 

 

restart; s := proc (f) subs(d[0] = w(r), seq(d[n] = diff(w(r), `$`(r, n)), n = 1 .. 10), f) end proc; ss := proc (f) subs(seq(diff(w(r), `$`(r, 11-n)) = d[11-n], n = 1 .. 10), w(r) = d[0], f) end proc; EL := proc (eq) s(diff(ss(eq), d[0]))+add((diff(s(diff(ss(eq), d[n])), `$`(r, n)))*(-1)^n, n = 1 .. 10) end proc

f := (diff(w(r), r, r))^2*r^4+4*r^6*(diff(w(r), r, r, r))^2:

a1 := EL(F):

a2 := VectorCalculus:-Laplacian(EL(f), 'polar[r, t]'):

simplify(a1-a2)

8*r^6*(diff(diff(diff(diff(diff(diff(diff(diff(w(r), r), r), r), r), r), r), r), r))+248*r^5*(diff(diff(diff(diff(diff(diff(diff(w(r), r), r), r), r), r), r), r))+2582*r^4*(diff(diff(diff(diff(diff(diff(w(r), r), r), r), r), r), r))+10910*r^3*(diff(diff(diff(diff(diff(w(r), r), r), r), r), r))+17786*r^2*(diff(diff(diff(diff(w(r), r), r), r), r))+8192*r*(diff(diff(diff(w(r), r), r), r))-92*(diff(diff(w(r), r), r))

(1)

``


 

Download EL.mw

Is possible to solve this differential equation by maple?

thaks...

Hi,

I'm using the eBookTools package to convert a .mw file as a chapter into a PDF file. However, a problem arises when I convert a document with a few repeated plotting commands (such as plot(x^2)). The issue is that in the final PDF the images of the various plots overlap, and that the individual plots can't be clearly seen. Is there a resolution to this?

Thanks,
Bart

Is package SumTools supposed to be a superset of the sum command in Maple? Or is it supposed to be a complementary to it? When should one use SumTools vs. sum?

The help on SumTools says

The SumTools package contains commands that help find closed forms of definite and indefinite sums. The package consists of three commands and three subpackages.
 

But does not make it clear when to use it vs. sum or what is its relation to sum command.

I am asking because on one example, sum is able to give an answer, while SumTools can't. I have expected the other way, where if sum failed, then one will try SumTools.

restart;
sum(1/n*sin(n*x),n=1..infinity) assuming 0<x,x<Pi

SumTools:-IndefiniteSummation(1/n*sin(n*x),n=1..infinity) assuming 0<x, x<Pi

 

 

Hello,

I am trying to solve CVRPSD by integer L shape method. I have some problems.

d=(0, 20,20,25,15,10): Demand
p=(1,1,1/3,1/2,1/4): the probability demand

K=50
1) How to write properly Recourse Policy (Q) in maple (I attached my problem) ? Recourse (Penalty cost) is applied when the demand exceed the vehicle capacity. We know that in CVRPSD, we don't know the demand until vehicle arrive at the node(customer).
(Look at my program)

Hopefully anybody could help me to solve this.

Thank you any way.
Exact_CVRPSD.mw


for example, there is an expression exp1=(a+b)*(a+c),  I want to find all the position in DAG of a specific operand, such as 'a' ; also I want to find the position in the DAG of  sub-expression which type is '+' .
 is there any function in maple which can return the  integers indicating position of an operand or type in an expression? i.e. with this function, assume its name is 'find',then
find(exp1, a) will return  [1,1],[2,1];
find(exp1,'+') will return  [1,0],[2,0];

hi

i got a problem to solve 2 nonlinear  pde equation that are not coupled but there is 8 coupled boundary condition. i can use pdsolve in maple.anyone can help me in numerical solving of these pdes?

This is using Maple 2018.2.1 and using Physics version MapleCloud 289 on windows 10, 64 bit with lots of RAM (64 GB). The call to timelimit hangs. Is there a workaround?

restart;

#and in new execution cell

pde :=  diff(w(x,y),x)-((k+1)*x^k*y^2- a*x^(k+1)*tan(x)^m*y + a*tan(x)^m )*diff(w(x,y),y) = 0;
cpu_time := timelimit(180,CodeTools[Usage](assign('sol',pdsolve(pde,w(x,y))),output='realtime'))

 

 

 

 

Hello,

I'm a long-time Maple user and have used the CodeGeneration package in the past, but with a recent download of Maple 2018, I'm now getting an error I have never gotten before. Even when I do something simple (see below, for example), I get an error that reads "Error, (in clear) argument `` is incorrect or out of order". And I get this error no matter which language I choose. Any help would be much appreciated.

> with(CodeGeneration)

> R(exp(x))

Thanks!

 

 

Suppose that A is an nxn matrix over the finite field Z:=GF(2,q) for some q. I wan to get the smitform of A over Z. First I used the package  

with(LinearAlgebra[Generic]) 

and after that I applied the command 

S := SmithForm[Z](A)

but the mentioned command made some errors. In fact, I do not how to define commands igcdex, iquo, irem, sign and abs for SmithForm over finite fields.

Thanks for any suggestions 

how I can find solutions for non linear equations.

I want to find non zero solution.

thank you

ZAH.mw



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/ZAH.mw .
 

Download ZAH.mw

3 4 5 6 7 8 9 Last Page 5 of 1541