13728 Reputation

24 Badges

11 years, 147 days

MaplePrimes Activity

These are replies submitted by Kitonum

@Wavish  Since you do not have a clear criterion for obtaining the wished line, then the solution "by eye" is likely to be the easiest and best solution to the problem.

An example of the creation of a specific matrix function:

F:=unapply(<t, t^2; sin(t), cos(t)>, t):

@vv  In fact, as a formal symbolic result, we get the same thing. But if we try to assign some numeric constants to the symbols, then of course we get an error:

Ec := (Ems+I*Eml)*(1+((Ems+I*Eml)/Ef-1)*Zeta*phi/((Ems+I*Eml)/Ef+Zeta))/(1-((Ems+I*Eml)/Ef-1)*phi/((Ems+I*Eml)/Ef+Zeta)):
a:=simplify(Re(Ec)) assuming positive;
b:=simplify(Im(Ec)) assuming positive;
eval(%, ZETA=Zeta);
is(a=%[1] and b=%[2]);


@bsoudmand  This is the output of my code (in Maple 2018.2):

In the text form:




SymFun(ln((x-1)/(x+1)), x);
plot(ln((x-1)/(x+1)), x=-4..4, -4..4);

SymFun(sqrt(x^2), x);
plot(sqrt(x^2), x=-2..2);

SymFun(abs(x)^(1/2), x);
plot(abs(x)^(1/2), x=-1..1);


@emendes  You can use  makeproc  option. See help on  rsolve  command for this.

@Lali_miani  If you enter in 2d math mode any of  i, j, I  from the Comman Symbols palette, it will work as the imaginary unit. But from the keyboard you have to enter the imaginary unit as  I . I almost never use palettes and only work from the keyboard in 1d math mode (Maple input). 

@minhthien2016  You can make arrows at the ends of the axes of coordinates and labels in the same place if you use  plots:-arrow  and  plots:-textplot  commands.


Arrow_x:=plots:-arrow([2.3,0],[0.15,0], width=0, head_width=0.12, head_length=0.15):
Arrow_y:=plots:-arrow([0,4.3],[0,0.15], width=0, head_width=0.12, head_length=0.15):
Labels:=plots:-textplot([[2.4,-0.2,"x"],[-0.2,4.4,"y"]], font=[times,16]):
P:=plot(x^2, x=-2..2, color=red, thickness=2, labels=["",""]):




Add the line

convert(Q, exp);

@EB1000 The  DirectSearch  package is not included in Maple and must be downloaded from the Maple Application Center from  here

@tomleslie  Thanks for this. In my opinion it is the best solution.

@radaar  I did not understand the meaning of what you posted. But in general, I think that using loops is more efficient, but you need to increas  Digits  (for example take Digits:=15)  to compensate for the loss of accuracy.

@radaar Note that double  add  requires more time and memory, but the calculation itself is more accurate. In order to achieve the same accuracy with double  for-loop  you have to increase  Digits , but then both time and memory will increase. You need to check it all out. 

@mmcdara  I do not think your solution is shorter. You have written a special procedure for this, which uses a number of commands from  Statistics  package. I simply use  Composition  procedure, written several years ago and not directly related to this problem. The solution itself takes 1 line of the code and is about 50 times faster (see below):


P := proc(NbOfDice)
 local S, R:
 uses Statistics:
 S := add(RandomVariable(DiscreteUniform(1, 6)), k=1..NbOfDice):
 R := [$NbOfDice..6*NbOfDice]:
 return  R =~ Probability~(S =~ R)
end proc:




[3 = 1/216, 4 = 1/72, 5 = 1/36, 6 = 5/108, 7 = 5/72, 8 = 7/72, 9 = 25/216, 10 = 1/8, 11 = 1/8, 12 = 25/216, 13 = 7/72, 14 = 5/72, 15 = 5/108, 16 = 1/36, 17 = 1/72, 18 = 1/216]




Composition := proc (n::nonnegint, k::posint, res::{range, nonnegint} := 0)
local a, b, It, L0;
if res::nonnegint then a := res; b := n-(k-1)*a  else a := lhs(res); b := rhs(res) fi;
if b < a or b*k < n then return `No solutions` fi;
It := proc (L)
local m, j, P, R, i, N;
m := nops(L[1]); j := k-m; N := 0;
for i to nops(L) do
R := n-`+`(op(L[i]));
if R <= b*j and a*j <= R then N := N+1;
P[N] := [seq([op(L[i]), s], s = max(a, R-b*(j-1)) .. min(R, b))] fi;
[seq(op(P[s]), s = 1 .. N)];
end proc;
L0 := [[]];
end proc:

[seq([S,nops(Composition(S,n,1..6))/6^n], S=n..6*n)];



[[3, 1/216], [4, 1/72], [5, 1/36], [6, 5/108], [7, 5/72], [8, 7/72], [9, 25/216], [10, 1/8], [11, 1/8], [12, 25/216], [13, 7/72], [14, 5/72], [15, 5/108], [16, 1/36], [17, 1/72], [18, 1/216]]







@torabi  You have already been offered to use  DirectSearch  package. It is not part of Maple and must be downloaded from Maple Application Center from  here

5 6 7 8 9 10 11 Last Page 7 of 102