bliengme

70 Reputation

0 Badges

8 years, 210 days

MaplePrimes Activity


These are questions asked by bliengme

A book I am reading has the following

I cannot produce this in Maple 2017. Please tell me where I go wrong. Thank


 

restart

"P(t):=(r*Q[inf])/(2+2 cosh(b-r*t))"

proc (t) options operator, arrow; r*Q[inf]/(2+2*cosh(b-r*t)) end proc

(1)

"Q(t):=(∫)[0]^(t)P(t) ⅆt"

proc (t) options operator, arrow; int(P(t), t = 0 .. t) end proc

(2)

``


 

Download Hubbert.mw

Trying to simulate tossing 10 coins. What  am i doing rong? Thanks

 

``

restart

a := Vector[row](1 .. 10)

Vector[row](%id = 18446745395177063238)

(1)

randomize()

for k to 10 do r := rand(1 .. 2); if r < .5 then a[k] := "H" else a[k] := "T"; print(a[k]) end if end do

proc () (proc () option builtin = RandNumberInterface; end proc)(6, 2, 1)+1 end proc

 

Error, cannot determine if this expression is true or false: r < .5

 

a

Vector[row](%id = 18446745395177063238)

(2)

``


 

Download CoinToss.mw

 

 

Another GCD attempt. Why is there a parse problem? Thanks


 

``

``

restart

"proc GCD3:=proc(n1,n2)    local r, a,b;    a:=n1; b:= n2;    while (a mod b) >0  do       r:=a mod b;      a:=b;      b:=r;   end do;    return b;  end proc;  "

Error, unable to parse

"proc GCD3:=proc(n1,n2)   local r, a,b;  a:=n1; b:= n2;    while (a mod b) >0  do  r:=a mod b;  a:=b;  b:=r;   end do;  return b;  end proc;  "

 

``


 

Download GCD3.mw

Any sugggestions gratefully received

I do know that Maple has a gcd command but I am just experimenting

GCD2.mw
 

``

``

restart

"GED2:=proc(n1 ,n2)     local a,b;     option remember;     a:=n1:b:=n2:     if b = 0 then do         return a ;    else       return GED2(b, a mod b);    end if;  end proc;"

Error, unterminated procedure

"GED2:=proc(n1 ,n2)    local a,b;     option remember;  a:=n1:b:=n2:     if b = 0 then do return a ;    else  return GED2(b, a mod b);    end if;  end proc;"

 

``


 

Download GCD2.mw

 

I know abut semilogpot - it gives a semilog scale on the horizontal axis.

Is there any way to get semilog scale on the vertical axis?

Season's greeting

1 2 3 4 5 Page 1 of 5