help merge two table...

 (1)

with result bc :=[result bnb and bth]

speed up fsolve ... ...

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

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

Writing overscript , subscript ,prescript ... with...

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

Inverse of the CDF of a Gamma RV...

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):
 (1)
 > f := unapply(CDF(C, t), t) assuming t > 0; plot(f(t), t=0..10);
 > # 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;
 (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));
 >

Tricks/tips to do arbitrary-contour integrals of c...

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

What not to enter in 2d math ?...

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 ?

Approximating a data cloud boundary...

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.

Getting an error when using pointplot command...

Hi,

So I'm new to MAPLE and working on plotting graphs for a car suspension system. I've had to differentiate some equations and use other formulas to calculate the peak of 7 different curves. I then need to plot these onto another graph. I've managed to calculate the values but I'm now trying to plot them on the graph using the pointplot command and I'm getting an error. The full code is shown below, any help is appreciated, thanks;

> Y(s):=100/s:
> X2(s):=(Y(s)*(1400*s+135000)*(c2*s+k2))/((49.8*s^2+(1400+c2)*s+135000+k2)*(466.5*s^2+c2*s+k2)-(c2*s+k2)^2):
> with(inttrans):
> x2(t):=unapply( expand( evalf( invlaplace(X2(s),s,t) )),t,c2,k2):

> c2_1:=simplify( x2(t)(t,1000,3000) ):
> D1:=diff( c2_1,t ):
> t_star1:=fsolve( D1,t=0.2..2 ):
> xp1:=x2(t)(t_star1,1000,3000):
> o1:=((xp1-100)/100)*100:

> c2_2:=simplify( x2(t)(t,1250,3000) ):
> D2:=diff( c2_2,t ):
> t_star2:=fsolve( D2,t=0.2..2 ):
> xp2:=x2(t)(t_star2,1250,3000):
> o2:=((xp2-100)/100)*100:

> c2_3:=simplify( x2(t)(t,1500,3000) ):
> D3:=diff( c2_3,t ):
> t_star3:=fsolve( D3,t=0.2..2 ):
> xp3:=x2(t)(t_star3,1500,3000):
> o3:=((xp3-100)/100)*100:

> c2_4:=simplify( x2(t)(t,1750,3000) ):
> D4:=diff( c2_4,t ):
> t_star4:=fsolve( D4,t=0.2..2 ):
> xp4:=x2(t)(t_star4,1750,3000):
> o4:=((xp4-100)/100)*100:

> c2_5:=simplify( x2(t)(t,2000,3000) ):
> D5:=diff( c2_5,t ):
> t_star5:=fsolve( D5,t=0.2..2 ):
> xp5:=x2(t)(t_star5,2000,3000):
> o5:=((xp5-100)/100)*100:

> c2_6:=simplify( x2(t)(t,3000,3000) ):
> D6:=diff( c2_6,t ):
> t_star6:=fsolve( D6,t=0.2..2 ):
> xp6:=x2(t)(t_star6,3000,3000):
> o6:=((xp6-100)/100)*100:

> c2_7:=simplify( x2(t)(t,4000,3000) ):
> D7:=diff( c2_7,t ):
> t_star7:=fsolve( D7,t=0.2..2 ):
> xp7:=x2(t)(t_star7,4000,3000):
> o7:=((xp7-100)/100)*100:

> with(plots):
> pointplot( {[1000,o1],[1250,o2],[1500,o3],[1750,o4],[2000,o5],[3000,o6],[4000,o7]} );
Error, (in pointplot) incorrect first argument

P.S. o1 through to o7 represent the peak of the curves and are to be plotted on the y-axis against 1000,1250,1500,1750,2000,3000 and 4000 on the x-axis. I'm using MAPLE V.

same command does not write the expression mathcon...

Thanks to the answers received by mapleprime friends, I have made 2 documents. In both documents, i want the expression to be modified and shown in mathcontainer. In my earlier question  "Slider Commands - "value" or value or both are ok" ,   the command " SetProperty (MathContainer0, value,sin(x)" it worked. In the attached doc, it does not work. The same command in updateplot procedure, works, but incorrectly.

Thanks for clarification.

Ramakrishnan V

Function: Examples:

All valid input values for the function ( i.e. for x value, function exists) is domain. This can be visualized by a point in graph (x,y)

 (1)

 (2)

 (3)

 (4)

Slider Commands - "value" or value or both are ok?...

In the attached document, I have made use of both commands as follows.

a:=GetProperty(SliderA,"value");

b:=GetProperty(SliderB,value);

Both are working alright. How is it possible? Which one is desirable?

 a: b: For sliderA, GetProperty(SliderA,"value") is used. For sliderB, GetProperty(SliderB,value) is used. Both are working alright. How? Which one is more desirable?

Ramakrishnan V

combinations on subsets...

This works fine, but I was wondering whether it could be done in a simple way.

 >
 (1)
 >
 >
 (2)

Harry

Maximum absolute error...

Can anyone tell me what is the command to calculate maximum absolute error in mapple.

a procedure which don't work...

restart;
A002487 := proc (m) local a, b, n; option remember; a := 1; b := 0; n := m; while 0 < n do if type(n, odd) then b := a+b else a := a+b end if; n := floor((1/2)*n) end do; b end proc; listeinverse := proc (L::list) local i; [seq(op(nops(L)-i, L), i = 0 .. nops(L)-1)] end proc; Brocot := proc (n) local c, i, L, M, r; L := NULL; r := 2^n; L := [seq(A002487(i), i = 0 .. r)]; M := listeinverse(L); c[0] := 0, 1/cat(0); for i to r do c[i] := L[i]/M[i] end do; c[r+1] := 1/cat(0); return [seq(c[i], i = 1 .. r+1)], r+1 end proc; for i from 0 to 4 do B || i := Brocot(i) end do;
[   1]
B0 := [0, -], 2
[   0]
[      1]
B1 := [0, 1, -], 3
[      0]
[   1        1]
B2 := [0, -, 1, 2, -], 5
[   2        0]
[   1  1  2     3        1]
B3 := [0, -, -, -, 1, -, 2, 3, -], 9
[   3  2  3     2        0]
[   1  1  2  1  3  2  3     4  3  5     5        1]
B4 := [0, -, -, -, -, -, -, -, 1, -, -, -, 2, -, 3, 4, -], 17
[   4  3  5  2  5  3  4     3  2  3     2        0]
rang := proc(M::list, a)  ...  end;;
/       1\
rang|B2[1], -|;
\       2/
/ d        \
|--- don(x)| t work;
\ dx       /

F := proc (N) local a, b, L; L := NULL; L := sort([op({seq(seq(a/b, a = 0 .. b), b = 1 .. N)})]); return L, nops(L) end proc; F(1); F(2); F(3); F(4);
[0, 1], 2
[   1   ]
[0, -, 1], 3
[   2   ]
[   1  1  2   ]
[0, -, -, -, 1], 5
[   3  2  3   ]
[   1  1  1  2  3   ]
[0, -, -, -, -, -, 1], 7
[   4  3  2  3  4   ]
rang(F(3)[1], 2/3);
/[   1  1  2   ]  2\
rang|[0, -, -, -, 1], -|
\[   3  2  3   ]  3/

Put constraint on symbolic calculation...

Hi everyone, I have some symbolic expressions as below:

restart;

local(Zeta);

Zeta := phi+(Ems+I*Eml)/(Ef-Ems-I*Eml)+(3*(1-phi))*((1-g)*alpha^2-(1/2)*g)/(alpha^2-1):

g := (1/2)*Pi*alpha:

Lambda := (1-phi)*((3*(alpha^2+.25))*g-2*alpha^2)/(alpha^2-1):

Ec := (Ems+I*Eml)/(1-(1/4)*phi*(1/Zeta+3/(Zeta+Lambda))):

a := simplify(Re(Ec)), assuming positive;

the output of the code maple gives me as 'a' is very long and boring! Therefore I want to make it shorter. Since (alpha<<1), I want to set a constraint as (alpha^(2 and more than 2)=0). How can I put that constraint on the output? thanks

How can type abs...

sort(abs(z+a+b*i),z,descending) mean type z is sign + but print -z+5i-5

 (1)

Can you help me?

Thank you very much.