MaplePrimes Questions

What's going wrong here?

The Matrix is created by using the Matrix Palette. 

It seems that in a matix it is not possible to use division by a noninteger. Is that right?

(I use Maple 2018.2 and this is tested on both Windows and MacOS.)

Kind regards,

Mikkel


 

with*PDE(tools):

`∂`(v[1])/`∂`(t) = v[1]*[-x*v[1]-x*`θv`[2]-v[1]-v[2]+1]

 

`∂`(v[2])/`∂`(t) = gamma*v[2]*[lambda-v[1]-v[2]-eta*(x*v[1]+x*`θv`[2])]

(1)

``


 

Download DTM_TO_SOlve.mw

Hello, for an assignment I was given the task of iteratively calculating the water depth of a flow using Newton's method. For this I tried to create a procedure wich uses a number of input values. The code is listed below;

 

restart;
Newton := proc (n, y0, Q, b, m, k, S0) local A, P, Sf, y, F, dAdy, dPdy, Fdiff, i; global ylist; y[0] := y0; for i from 0 to n do A[i] := (b+m*y[i])*y[i]; P[i] := b+2*y[i]*sqrt(1+m^2); Sf[i] := Q*abs(Q)*P[i]^(4/3)/(k^2*A[i]^(10/3)); F[i] := S0/Sf[i]-1; dAdy[i] := b+2*m*y[1]; dPdy[i] := 2*sqrt(1+m^2); Fdiff := (2/3)*(F[i]-1)(5*dAdy[i]/A[i]-2*dPdy[i]/P[i]); y[i] := procname(evalf(y[i]-F[i](y[i])/Fdiff[i](y[i]))) end do; ylist := [seq(y[i], i = 0 .. n)]; return ylist end proc;

Newton(10, 1, 5, 12, 1, 30, 0.1e-4);
Error, (in Newton) invalid input: Newton uses a 2nd argument, y0, which is missing

 

As you can see, I get an error referring to the second argument y0, which is the starting value of the calculation. The error says the argument is missing, however it is right there in the brackets of the Newton procedure (along with the values of all other parameters). I have tried explicitly stating that y0:=1, and changing the name of the parameter, however that didn't help.

Am I missing something really simple, or is there something wrong with my code?

Thanks in advance.

Hi everybody

I try to save an array of equations in a "mpl file", and then read file and array by command read mpl file. But system error "bad id" occurs. Previously I saved this mpl file by "save" and read array by "read" command. I ran this code several times without any problem, suddenly error "bad id" occurred. When I save mpl file by the code edit region and then read it by "read" in the same or  a new worksheet, the error doesn't happen!
 What is wrong?
"Id" refers to the array index?

Thanks.
Maple 18 and Windows 10

Hi,

In order to improve the rendering of the table returned by DocumentTools:-Tabulate, I would have like it to contain the mathematical sign for infinity instead of the word infinity itself.
Example

a := infinity:
print(a);                      # what I would like to obtain
DocumentTools:-Tabulate([a]);  # contains the word "infinity"


Is it possible to fix this?
TIA

PS: Avoid spending too much time on it because it's only cosmetics

Fract := proc (P::posint, Q::posint) local p, q; for p to P-1 do for q to Q-1 do if is((P-p)*q-p*(Q-q) = 1) then return p/q, P/Q, (P-p)/(Q-q) end if end do end do end proc:#this procedure works Fract1 := proc (P::posint, Q::posint) local p, q; `~`[`~`[`/`@op]](select(type, map2(eval, [[p, q], [P-p, Q-q]], [isolve((P-p)*q-P*(Q-q) = 1)]), [[posint$2]$2]))[] end proc:#this procedure don't work Fract(7, 81);Fract1(7,81); Fract(39, 97);Fract1(39,97); Fract(101, 143);Fract1(101,143); Fract(11, 80);Fract1(11,80); Fract(15, 37);Fract1(15,37); Fract(22, 39);Fract1(22,39); Fract(25, 37);Fract1(25,37); Fract(21, 91);Fract1(21,91); Fract(13, 19);Fract1(13,91);

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

 

 

when a variable has a value of 0.0 it seems to lose its units.

with(Units:-Standard):

temp := 0.*Unit('degC');
                           temp := 0.
convert(temp, temperature, kelvin);
Error, (in convert/temperature) insufficient information for a temperature conversion
 
temp := 0.1e-1*Unit('degC');
                   temp := 0.01 Unit(°C)
 
Is this true?  How are you supposed to do calculations for example at 0.0 C?
 
convert(temp, temperature, kelvin);
                      273.1600000 Unit(K)


 

socau := proc (sc) local sccl, sccl2, sccl3, nhanbiet, n, td, ii, t, nhanbiet1, kk, bnb, thonghieu, n2, thonghieu2, bth, vandung, n3, vandung3, bvd, bang1; sccl := round((2/5)*sc); sccl2 := round((2/5)*sc); sccl3 := round((1/5)*sc); nhanbiet := [1, 2, 3, 4, 5]; n := nops(nhanbiet); td := rand(0. .. 1.00); for ii to n do t := trunc(n*td()+1); nhanbiet1[ii] := nhanbiet[t]; nhanbiet[t] := nhanbiet[n]; n := n-1 end do; for kk to sccl do bnb[kk] := nhanbiet1[kk] end do; print(nhanbiet1); print(bnb); thonghieu := [6, 7, 8, 9, 10, 11]; n2 := nops(thonghieu); td := rand(0. .. 1.00); for ii to n2 do t := trunc(n2*td()+1); thonghieu2[ii] := thonghieu[t]; thonghieu[t] := thonghieu[n2]; n2 := n2-1 end do; for kk to sccl2 do bth[kk] := thonghieu2[kk] end do; print(thonghieu2); print(bth) end proc:

socau(11)

bth

(1)

Parse:-ConvertTo1D, "invalid left hand side of multiple assignment"


with result bc :=[result bnb and bth]

Download help_table.mw

please help me

 

 

Hi all, my maple will crash when calculating this sheet.. Any help here?
 

``

``

restart

``

Digits := 15

15

(1)

NULL

NULL

``

c := .95

.95

(2)

``

theta := .9

.9

(3)

k := 1

1

(4)

p_l := 10^(-15)

1/1000000000000000``

(5)

n := 10^10

10000000000

(6)

``

fsolve(c = p_l^k*(1-p_l)^(n-k)*theta/(p_l^k*(1-p_l)^(n-k)*theta+p^k*(1-p)^n*(1-theta)), p = 10^(-6), 1.09*10^(-10) .. .1)

``

``

``

NULL

``

``

``

``

``

``

``

``

``

``

``

``


 

Download test.mw

Hello 

Sometimes It is cumbersome to put over script ,subscript  by using a mouse and get calculation error.

 

Is there any way to write over script or subscript by using some command as we do in Latex? 

 

Thank you

 

 

 

 

Hi, 

The CDF of a continuous random variable of support S is a bijective function f : S --> [0, 1].
So I expected that Maple would return only one solution when the command solve(f(t)=u, t) assuming u >=0, u <=1

When f(t) is the CDF of a Gamma random variable withparameters (2, 2), Maple returns two different solutions.

Could you explain me where the "spurious" solution (red curve) comes from?


 

restart

with(Statistics):

C := RandomVariable(GammaDistribution(2, 2))

_R

(1)

f := unapply(CDF(C, t), t) assuming t > 0;

plot(f(t), t=0..10);

proc (t) options operator, arrow; 1-(1/2)*t*exp(-(1/2)*t)-exp(-(1/2)*t) end proc

 

 

# f being a bijection from [0, +infinity) to [0, 1], its inverce does exist

s := solve({f(t)=u, t >=0}, t) assuming u >= 0, u <= 1;

{t = -2*LambertW((-1+u)*exp(-1))-2}, {t = -2*LambertW(-1, (-1+u)*exp(-1))-2}

(2)

pc := plot(CDF(C, t), t=0..10, color=blue):
T  := plottools:-transform((x, y) -> [y, x]):
plots:-display(T(pc), plot(rhs(op(s[1])), u=0..0.95, color=red), plot(rhs(op(s[2])), u=0..0.95, color=cyan, transparency=0.5, thickness=5));

 

 


 

Download ICDF_of_GammDistribution.mw

I have started to use Maple to test my calculations for a complex variable course.

The example is a complex integrand, and integration about an ellipse centered at origin.
Integrand has function 

f(z) = z*exp(a*z) / (z2+1)2

C:  z(t) = cos(t) + i*2*sin(t)

where a is a real constant. My idea is shown in the attatched workbook, i.e. 

dz = -sin(t) + i*2*cos(t) dt
g(t) = (-sin(t) + i*2*sin(t)) * f(cos(t) + i*sin(t))
int(g(t), t = 0..2*Pi)

PS, I've done similar code previously, but only for circle contours at center (see attachement)

The analytical answer is pi*a*sin(a), and Maple gives this correct for circular contours, but not for the ellipse.

So, what I'm asking is not how to solve the problem, but how to perform (arbitrary) contour integrals in Maple.

attachForMaplePrime.mw

I find the 2D math input in Maple to somewhat cumbersome for various expressions.
Specifically, I have a function f(z) = z^2, with w = f(I x + y) where I is the imaginary number.

I typed the line in 2D math

plots[implicitplot]({Im(w) = 2, Re(w) = 2}, x = -5 .. 5, y = -5 .. 5, colour = {"Blue", "Red"})
Error, (in plot/color) invalid color specification: {"Blue", "Red"}

For some reason this does not work in 2D math, but in Maple-input it works as expected.

I recall from past use of Maple, that there were other problems as well with the 2D math input.
I know you need to be particular with the use of space. 

Are there other common pitfalls or "bugs" related to use of 2D math input ?

Dear colleagues,

I need to determine a linear boundary of a data cloud. More specifically:

I have a set of experimental points y(x). On the plane x-y, the data points form a cloud of a triangular shape, with the legs coinciding with the x and y axes.  I need to best-fit the outer (upper-right), boundary of the data cloud, i.e. the hypotenuse of the "triangle",    with a linear function. It is not necessary for the line to go through the boundary points exactly, I need a best-fitting approximation (actually, the gradient of the line). Could someone give me any idea how to do it? (Or, at least, advice how I can google it, as my searches like "approximate boundary data cloud" return loads of irrelevant stuff.

Thanks in advance!

First 599 600 601 602 603 604 605 Last Page 601 of 2308