MaplePrimes Questions

H2 := [a(t)*(diff(c(t), t))+b(t) = 100, a(t)*(diff(b(t), t))+c(t)*(diff(b(t), t)) = exp(t), a(t)*(diff(c(t), t))+a(t)*(diff(b(t), t))+b(t) = 90];
H1 := subs([diff(a(t),t)=a1,diff(b(t),t)=b1,diff(c(t),t)=c1], H2);
H := subs([a(t)=a0, b(t)=b0, c(t)=c0], H1);
ics := generate_ic(H, {a0=-2..2, b0=-2..2, c0=-2..2,a1 = -2 .. 2, b1 = -2 .. 2, c1 = -2 .. 2, t = 0, energy = 0}, 100);

 

Error, (in generate_ic) invalid input: `DEtools/generate_ic` expects its 1st argument, H, to be of type algebraic, but received [a0*c1+b0 = 100, a0*b1+c0*b1 = exp(t), a0*c1+a0*b1+b0 = 90]

Hello,

After trigonometric manipulations in a mechanical problem, I can obtain the desired angles but defined with modulo 2Pi.

I would like to program or find a function which can do this operation :

While angle doesn't belong to [-Pi, Pi]

do 

  If angle > Pi then do angle = angle - 2Pi

  If angle < - Pi then do angle = angle + 2Pi

end

Is there an existing function which can do this operation ?

Otherwise, may you help me to program it ?

Thanks a lot for your help

Dear all;

I need your help to solve the non-square system of equation

 


restart;
with(LinearAlgebra);
 l1 := [1, 1, 1, 0, 0, 0, 0, 0, 0];

l2 := [0, 0, 0, 1, 1, 1, 0, 0, 0];

l3 := [0, 0, 0, 0, 0, 0, 1, 1, 1];

l4 := [1, 0, 0, 1, 0, 0, 1, 0, 0];

l5 := [0, 1, 0, 0, 1, 0, 0, 1, 0];

l6 := [0, 0, 1, 0, 0, 1, 0, 0, 1];

l7 := [0, 0, 1, 0, 1, 0, 1, 0, 0];

A := Matrix([l1, l2, l3, l4, l5, l6, l7]);
    # Unknown vector                    

m := [m1, m2, m3, m4, m5, m6, m7, m8, m9];
# Right hand side                  

 b = [15, 15, 15, 15, 15, 15, 15];

 

# Let the matrix equation : A m =b

1)I need your help to compute the kernel and general solution of this matrix equation

2) can we find a solution if m_k in { 2 3 4 5 6 7 8 } and each of these number appears at least once

3) If there a solution if we consider m_k in the set {0 1 2 3 4 5 6 7 8 }  and the number used exactly one

 

 

Thank you very much for your help

 

 


                     

This is my source code to perform several binary arithmetic and HUffman Compression

Freq := proc (s) options operator, arrow; map(proc (x) options operator, arrow; rhs(x) = lhs(x) end proc, {StringTools:-CharacterFrequencies(s)}) end proc; s := readstat("x will be assigned "); Fr := Freq(s);

algo
{1 = "a", 1 = "g", 1 = "l", 1 = "o"}

HuffmanTree := proc (s) options operator, arrow; if nops(s) <= 1 then rhs(s[]) else procname(`union`(s[3 .. -1], {lhs(s[1])+lhs(s[2]) = [rhs(s[1]), rhs(s[2])]})) end if end proc; HT := HuffmanTree(Fr);


[["a", "g"], ["l", "o"]]

HuffmanCoding := proc (s, p := "") if s::string then s = p else procname(s[1], cat(p, 0)), procname(s[2], cat(p, 1)) end if end proc; HC := HuffmanCoding(HT);

"a" = "00", "g" = "01", "l" = "10", "o" = "11"

C := table([HC]); b := cat(map(proc (x) options operator, arrow; C[x] end proc, StringTools:-Explode(s))[]);

"00100111"

# Begin the procedure with make string to integer
z := parse(b);

                                                                   100111    #Should be 00100111 after parsing

# Step 1:add 1 to z
binaryAdd := proc (z, y) options operator, arrow; convert(convert(z, decimal, 2)+convert(y, decimal, 2), binary) end proc;
z1 := binaryAdd(z, 1);


101000

# Step 2: Reverse the number from left to right
z2 := convert(z1, base, 10);

[0, 0, 0, 1, 0, 1]


z3 := (parse@cat@op)(z2);


                                                                101  #Should be 000101 after parsing

 # Step 3: Addition between the first secret key and the Huffman Code

randomize();

p := rand(0 .. 2^(length(z3)-2)):

rn := convert(p(), binary);

1

z4 := binaryAdd(z3, rn);

110

# Step 4:Obtain 2's complement

s := length(z4);

z5 := convert(z4, decimal, binary);

6

z6 := [Bits:-GetBits(-z5, -1 .. 0, bits = s)];

[0, 1, 0]

z7 :=(parse@cat@op)(z6);

                                                       10  # Should be 010 after passing

 

The Bold part is MAPLE answer. My problem for this MAPLE source code is the underlined answer  as I can't get the answer I need after I have my parsing of string or list. Do this problem can be solved or it is impossible to make the leading zero all the way of the process. I try to figure it out for several solution but it still the same results. Thus hope some experts or someone can help me solve it together. Appreciated if get solved.

Dear All

I have simple problem related to ploting of 2-D graph

What I need is listed as below:

1. How I can re-scale axes by 1/2.

2. How to give custom gap between graph and its title.

3. How to place two legends in vertical format in opposite to horizontal.

4. How to assigne custom gap between legends and graph

5. How to place label 'q[b]' on the right side of vertical axes.


f[1] := 0.6553e-2+0.61277e-1*cos(.9976156575*x)-0.3448e-2*cos(1.995231315*x)+0.164e-3*cos(2.992846972*x)

0.6553e-2+0.61277e-1*cos(.9976156575*x)-0.3448e-2*cos(1.995231315*x)+0.164e-3*cos(2.992846972*x)

(1)

f[2] := 0.6601e-2+0.61212e-1*cos(.9878156204*x)-0.3834e-2*cos(1.975631241*x)+0.182e-3*cos(2.963446861*x)

0.6601e-2+0.61212e-1*cos(.9878156204*x)-0.3834e-2*cos(1.975631241*x)+0.182e-3*cos(2.963446861*x)

(2)

plot([diff(f[1], x), diff(f[2], x)], x = -3.2 .. 3.2, color = ["Red", "Green"], linestyle = [solid, dash], legend = ["undistorted ( n=0.0, q=0.0)", "undistorted"], labels = [tau*``, q[b]*`\` `], labeldirections = [HORIZONTAL, VERTICAL], size = [500, "golden"], title = "Radial velocity curve of Polytropic Model of Index N=3", titlefont = ["ROMAN", 15], legendstyle = [font = ["HELVETICA", 9], location = bottom]);

Download My_Plot_in_2D.mw

 

Regards

Hi,

I want to run an entire worksheet step by step to see errors and how variables are flowing and so on.

I know that I can invoke de debbuger but it doesn't allow me to do so from start.

How can I do that, is that possible?

It´s like:

restart:

<I want to start a step by step from here>
command
command
command
...
...
<and stop here>

Thanks in advance.

hi,

i'm trying to figure out where i did a mistake by coding reducedEchelonForm.

with(LinearAlgebra):
reduced:=proc(M)
 local l:=1, m:=RowDimension(M),n:=ColumnDimension(M),i,j; # l current column
 for i from 1 to m do # going trough every row item
  if n<l then # ColumnDimension need to be bigger than current column
   return M;
  end if;
 j:=i; # given current row item
 while M[j,l]=0 do # search for first rom item unequal zero
  j:=j+1;
  if m<j then # end of row
   j=i;
   l=l+1;
   if n<l then # end of rows and columns -> finish
    return M;
  end if;
 end if;
end do;
M:= perm(m,n,j,i).M; #permute row j and i
if not(M[i,l]=0) then # multiply row i with M[i,l])^(-1)
 M:= multiplikation(m,n,i,(M[i,l])^(-1)).M;
end if;
for j from 1 to m do # subtract every row j with row i for M[j,l]-times
 if not(j=i) then
  M:= addition(m,n,j,i,-M[j,l]).M;
 end if;
end do;
l:=l+1; # increase l by 1, next iteration i increase either
end do;
end proc:

 

Hint: perm(...),multiplikation(...) and addition(...) are the elementary matrices. They are working.

 

Now i got an error by running it: 

L:=Matrix(2,3,[1,2,3,4,5,6]);
reduced(L);
Error, (in reduced) invalid left hand side in assignment

Can someone explain me these error? And maybe a hint what i need to fix in my code?

Greets felix

Hello

I have a subscripts error, or it seems to be an error.

As you can see on the picture, then I have defined the varible I__K, but when I need it again I get another result or It seems to be another result that looks like this I[K]. I use the esc buttom to recall the varible.

Are there anybody that has a solution to this? I have been looking at other treads, but there seems not to be a solution that works or maybe I'm looking the wrong places.

Regards

Heide

 

 

Maple Coding:

z4:=11000010010000 (in binary form)

s = length(z4);

Bits:-Split(z4);

ListTools:-Reverse(n);

Bits:-Join(%);

[Bits:-GetBits(-%, -1 .. 0, bits = s)];

z5 := subsop(1 = 0, %);

z6 := (`@`(`@`(parse, cat), op))(z5)

Suppose after two's complement of 11000010010000 will be 00111101110000 but when i parse it down it will become 11110110000 which two 0's bit is disappeared,how i can get back the original answer in maple?Thanks

Hello everyone!

I am wondering why the Tabulate command does not work with Explore. E.g.:

Explore(`DocumentTools:-Tabulate`([plot(sin(a*x)), plot(cos(x-a))]), parameters = [[a = 0 .. 10, controller = slider]])

I know that I can display an array of plots with the display(Array([....])) which works fine with explore but Tabulate is another good way to display multiple plots and it gives better control over individual plots properties (e.g. setting different size to different plots). Is this a bug or Tabulate is just not meant to work in that context?  

If L is a list [a,c,b,d,f,e]

S is a list [b,c,f,e]

I want to use the permutation opf S to rearrange L [b,c,f,e,a,d]

In my case a,b,c,d,e,f are equations.

Hello

I try to write a matrix (15*15) by maple, but the maple programme doesn't run this.

 

Here I attached the worksheet.


restart

with(LinearAlgebra[Generic])

Q[`0`], Q[`1`], Q[`+`], Q[`-`], Q[`*`], Q[`/`], Q[`=`] := 0, 1, `+`, `-`, `*`, `/`, `=`

0, 1, `+`, `-`, `*`, `/`, `=`

(1)

``

Digits := 60

60

(2)

n:=14:

for v from 0 to n do

p[v,n]:=expand(binomial(n,v)*x^(v)*(1-x)^(n-v))

end do:

Phi := matrix(15, 1, [p[0, 14], p[1, 14], p[2, 14], p[3, 14], p[4, 14], p[5, 14], p[6, 14], p[7, 14], p[8, 14], p[9, 14], p[10, 14], p[11, 14], p[12, 14], p[13, 14], p[14, 14]])

Vector(15, {(1) = x^14-14*x^13+91*x^12-364*x^11+1001*x^10-2002*x^9+3003*x^8-3432*x^7+3003*x^6-2002*x^5+1001*x^4-364*x^3+91*x^2-14*x+1, (2) = -14*x^14+182*x^13-1092*x^12+4004*x^11-10010*x^10+18018*x^9-24024*x^8+24024*x^7-18018*x^6+10010*x^5-4004*x^4+1092*x^3-182*x^2+14*x, (3) = 91*x^14-1092*x^13+6006*x^12-20020*x^11+45045*x^10-72072*x^9+84084*x^8-72072*x^7+45045*x^6-20020*x^5+6006*x^4-1092*x^3+91*x^2, (4) = -364*x^14+4004*x^13-20020*x^12+60060*x^11-120120*x^10+168168*x^9-168168*x^8+120120*x^7-60060*x^6+20020*x^5-4004*x^4+364*x^3, (5) = 1001*x^14-10010*x^13+45045*x^12-120120*x^11+210210*x^10-252252*x^9+210210*x^8-120120*x^7+45045*x^6-10010*x^5+1001*x^4, (6) = -2002*x^14+18018*x^13-72072*x^12+168168*x^11-252252*x^10+252252*x^9-168168*x^8+72072*x^7-18018*x^6+2002*x^5, (7) = 3003*x^14-24024*x^13+84084*x^12-168168*x^11+210210*x^10-168168*x^9+84084*x^8-24024*x^7+3003*x^6, (8) = -3432*x^14+24024*x^13-72072*x^12+120120*x^11-120120*x^10+72072*x^9-24024*x^8+3432*x^7, (9) = 3003*x^14-18018*x^13+45045*x^12-60060*x^11+45045*x^10-18018*x^9+3003*x^8, (10) = -2002*x^14+10010*x^13-20020*x^12+20020*x^11-10010*x^10+2002*x^9, (11) = 1001*x^14-4004*x^13+6006*x^12-4004*x^11+1001*x^10, (12) = -364*x^14+1092*x^13-1092*x^12+364*x^11, (13) = 91*x^14-182*x^13+91*x^12, (14) = -14*x^14+14*x^13, (15) = x^14})

(3)

d := matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]

matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]

(4)

d1 := MatrixInverse[Q](d);

MatrixInverse[Q](Matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]])

(5)

NULL


Download ch512.mw

restart

with(LinearAlgebra[Generic])

Q[`0`], Q[`1`], Q[`+`], Q[`-`], Q[`*`], Q[`/`], Q[`=`] := 0, 1, `+`, `-`, `*`, `/`, `=`

0, 1, `+`, `-`, `*`, `/`, `=`

(1)

``

Digits := 60

60

(2)

n:=14:

for v from 0 to n do

p[v,n]:=expand(binomial(n,v)*x^(v)*(1-x)^(n-v))

end do:

Phi := matrix(15, 1, [p[0, 14], p[1, 14], p[2, 14], p[3, 14], p[4, 14], p[5, 14], p[6, 14], p[7, 14], p[8, 14], p[9, 14], p[10, 14], p[11, 14], p[12, 14], p[13, 14], p[14, 14]])

Vector(15, {(1) = x^14-14*x^13+91*x^12-364*x^11+1001*x^10-2002*x^9+3003*x^8-3432*x^7+3003*x^6-2002*x^5+1001*x^4-364*x^3+91*x^2-14*x+1, (2) = -14*x^14+182*x^13-1092*x^12+4004*x^11-10010*x^10+18018*x^9-24024*x^8+24024*x^7-18018*x^6+10010*x^5-4004*x^4+1092*x^3-182*x^2+14*x, (3) = 91*x^14-1092*x^13+6006*x^12-20020*x^11+45045*x^10-72072*x^9+84084*x^8-72072*x^7+45045*x^6-20020*x^5+6006*x^4-1092*x^3+91*x^2, (4) = -364*x^14+4004*x^13-20020*x^12+60060*x^11-120120*x^10+168168*x^9-168168*x^8+120120*x^7-60060*x^6+20020*x^5-4004*x^4+364*x^3, (5) = 1001*x^14-10010*x^13+45045*x^12-120120*x^11+210210*x^10-252252*x^9+210210*x^8-120120*x^7+45045*x^6-10010*x^5+1001*x^4, (6) = -2002*x^14+18018*x^13-72072*x^12+168168*x^11-252252*x^10+252252*x^9-168168*x^8+72072*x^7-18018*x^6+2002*x^5, (7) = 3003*x^14-24024*x^13+84084*x^12-168168*x^11+210210*x^10-168168*x^9+84084*x^8-24024*x^7+3003*x^6, (8) = -3432*x^14+24024*x^13-72072*x^12+120120*x^11-120120*x^10+72072*x^9-24024*x^8+3432*x^7, (9) = 3003*x^14-18018*x^13+45045*x^12-60060*x^11+45045*x^10-18018*x^9+3003*x^8, (10) = -2002*x^14+10010*x^13-20020*x^12+20020*x^11-10010*x^10+2002*x^9, (11) = 1001*x^14-4004*x^13+6006*x^12-4004*x^11+1001*x^10, (12) = -364*x^14+1092*x^13-1092*x^12+364*x^11, (13) = 91*x^14-182*x^13+91*x^12, (14) = -14*x^14+14*x^13, (15) = x^14})

(3)

d := matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]

matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]

(4)

d1 := MatrixInverse[Q](d);

MatrixInverse[Q](Matrix*[[1, -14, 91, -364, 1001, -2002, 3003, -3432, 3003, -2002, 1001, -364, 91, -14, 1], [0, -14, 18, -1092, 4004, -10010, 18018, -24024, 24024, -18018, 10010, -4004, 1092, -182, 14], [0, 0, 91, -1092, 6006, -20020, 45045, -72072, 84084, -72072, 45045, -20020, 6006, -1092, 91], [0, 0, 0, -364, 4004, -20020, 60060, -120120, 168168, -168168, 120120, -60060, 20020, -4004, 364], [0, 0, 0, 0, 1001, -10010, 45045, -120120, 210210, -252225, 210210, -120120, 45045, -10010, 1001], [0, 0, 0, 0, 0, -2002, 18018, -72072, 168168, -252225, 252225, -168168, 72072, -18018, 2002], [0, 0, 0, 0, 0, 0, 3003, -24024, 84084, 168168, 210210, -168168, 84084, -24024, 3003], [0, 0, 0, 0, 0, 0, 0, -3432, 24024, -72072, 120120, -120120, 72072, -24024, 3432], [0, 0, 0, 0, 0, 0, 0, 0, 3003, -18018, 45045, -60060, 45045, -18018, 3003], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2002, 10010, -20020, 20020, -10010, 2002], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1001, -4004, 6006, -4004, 1001], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -364, 1092, -1092, 364], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, -182, 91], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 14], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]])

(5)

NULL


Download ch512.mw

Could you please help me.

Dear All

The given Maple code can be easily converted into Latex code using "latex(.)", how can one perform reverse of it?? That, if we have latex code in proper format, can we convert it into Maple commands??

Regards

How I can write a procedure in Maple 18 that it receives:

Inputs: function f(x) and real unmbers a and b (as interval [a,b]) and natural unmber n 

then devides interval [a,b] to n subinterval and computes f'(a), f'(a+(b-a)/n), f'(a+2(b-a)/n),..., and f'(a+n(b-a)/n)=f'(b)

and

showes at output: graph f(x) and all points [a,f'(a)], [a+(b-a)/n, f'(a+(b-a)/n)],[a+2(b-a)/n, f'(a+2(b-a)/n)]..., and [a+n(b-a)/n,f'(a+n(b-a)/n)] on a coordinate plane x-y

Dear friends

It seems that Maple takes a long time to evaluate the square roots of numbers.

See the simple code below.

st := time();

for i to 1000 do for j to 1000 do

a[i, j] := evalf(abs(i-j+1)^0.3-abs(i-j)^0.3):

end: end:

time()-st

I run it, then after a few seconds I run it again and again  to see the consuming time: once the running time is 77 seconds, then is 57 seconds, again is 73 seconds ...

Two questions:

1- Why the time is so differnt?

2- Why a simple code is being done at about a minute? Based on the number of operations, I think it should be done at less than a second. It just involves finding two million real third roots each of them less than 100 operations (if Newton method for finding roots is applied it probably needs less than 20 operations). I was thinking that a computer may do one billion operations per second. 

Since I need to report my numerical results in a scientific paper, it is important for me to know what's going on.

It is worthy of noting that I use Maple 18 on a Lenovo Laptop with Corei3 1.90 GHz with 64 bit operating system and 4 Gb RAM.

In advance, I appreciate for helping me to reveal the secrets.

Thank you all

 

First 1136 1137 1138 1139 1140 1141 1142 Last Page 1138 of 2434