dharr

Dr. David Harrington

8210 Reputation

22 Badges

20 years, 339 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

The error message is

Error, (in pdsolve/sys/info) the HINTs programmed for PDE systems are: {"as is", `*`, `+`, TWS, tws}; received: HINT = F[1](t)*F[2](r*sin(phi))

i.e., an arbitrary function hint is not available for a system. In the case of a single pde, F(t)*G(r)*H(phi) should work.

HINT=`*` works here to give a separated solution.

If you know it is periodic with period 12, then a Fourier series is the simplest choice. I went to n=3, with 7 parameters for 12 data points, and I guess you could go higher, but at some point you are overfitting.

Download Fit.mw

Your immediate problem is the N_y in the second for statement has an extra space between N and _y. Removing the space gets rid of the error message.

Use KroneckerDelta instead of kroneckerdelta, and since it is in the Physics package, you will have to use with(Physics) at the beginning (or perhaps you don't want it to evaluate?)

You have a matrix element in the quantum mechanics sense, but how do you want to generate a Maple Matrix? Do you want Nx*Ny rows and Nx*Ny columns each with order l=1, p=2; l=1, p=2; l=1, ..., p=N_x, l=2, p=1, etc? So then the  <l,p|H|l_prim,p_prim> element would go in H[l*N_y+p, l_prim*N_y+p_prim] entry (that's probably not right but I'll let you figure it out)

Your if statements don't test l_prim or p_prim.

You can test for even and odd by: if p::even then ...   ; if p::odd then

My tendency would be to just make four nested loops for l, p, l_prim, and p_prim and then just have a single complicated if statement to deal with the various cases.

(With this complex code I'd use 1-D math or a code edit region for ease of debugging.)
 



 

A degree 6 polynomial doesn't have a general symbolic solution, so you will need to provide values for at least some variables in the coefficients to get an explicit numerical or symbolic solution. (For simpler ploynomials you can give solve the option explicit.)

For future reference, you should upload your worksheet using the big green up arrow.

You are giving dsolve 60 differential equations and also 15 algebraic equations (final[k]), but then you are giving 75 initial conditions. The algebraic equations are just giving values to variables, so you should just substitute these into the differential equations and give dsolve 60 differential equations and 60 initial conditions in 60 variables.

[Edit: OPs uploaded worksheet is modified and is now producing output]

Probably you intended to give kappa and lambda numerical values and forgot. (If you really want them as parameters then use the parameters= option to dsolve - see the help page)

Do(%TextArea0(Enabled)) returns true (and not "true"). I find the Do mechanism easier to integrate into other code for this reason.

Seems there should be a simpler way, but you can do it step by step.

Download sums.mw

sigma[CNT] = 0.1e7; should be sigma[CNT] := 0.1e7;

In general it is helpful for us to solve your problems if you upload your worksheet using the fat green up arrow in the editor.

Since I needed to figure out good guesses and you formulated the ionic strength in molality and the others in moles I got frustrated and cheated by refomulating the whole problem in molalities, which is how I would have set up this problem anyway. These equilibrum problems almost always need high Digits and good guesses. You will see some chemical intuition was also required to solve it.

[Edit: at the end I check it satisfies the OPs eqns]

restart;

Given equations rewritten in terms of molalities m_X (=n_X/m). Omit x and just solve directly for the actual concentrations in the solution.

eq1:=K_1=(m_Cl*u_Cl)*(m_H*u_H)/(m_HCl):    #K1 for HCl(aq)->H+ + Cl-
eq2:=K_2=(m_Na*u_Na)*(m_OH*u_OH)/(m_NaOH): #K2 for NaOH(aq)->Na+ + OH-
eq3:=K_w=(m_H*u_H)*(m_OH*u_OH):            #Kw for H2O -> H+ + OH- (neglect water activity effects)
eq4:=m_NaCl=m_Na+m_NaOH:                   #mass balance for Na
eq5:=m_NaCl=m_Cl+m_HCl:                    #mass balance for Cl
eq6:=m_Na+m_H=m_Cl+m_OH:                   #charge balance
eq7:=2*ionic=m_H+m_Cl+m_Na+m_OH:           #definition of ionic strength
eq8:=u_H=0.4077*ionic^2-0.3152*ionic+0.9213:  #activity coeff of H+
eq9:=u_Na=0.0615*ionic^2-0.2196*ionic+0.8627: #activity coeff of Na+
eq10:=u_OH=0.1948*ionic^2-0.1803*ionic+0.8887:#activity coeff of HO-
eq11:=m=r*V:                                  #estimate of mass of water from density and volume
eq12:=u_Cl=(1.417625986641341e-01)*exp(-ionic/2.199955601666953e-02)+ #activity coeff of Cl-
      2.369460669647978e-01*exp(-ionic/3.756472377688394e-01)+5.859738096037875e-01:

Given parameters

params:={K_1=1.*10^8,K_2=10^(-0.2),K_w=10^(-13.995),n_NaCl=1.2*10^(-4),V=5.*10^(-8),r=997.0,x=0}:

m is directly available from these parameters and eq11.

{m=eval(rhs(eq11),params)};params:=params union %:

{m = 0.4985000000e-4}

And with m we can get the initial molality of NaCl

{m_NaCl=eval(n_NaCl/m,params)};params:=params union %:

{m_NaCl = 2.407221665}

What molalities are we actually interested in? Na+ and Cl- will be close to the above value, OH- and H+ will be smaller

mmax:=eval(m_NaCl,params);

2.407221665

So in this concentration range, what are the activity coefficients (u) of H+ (red), Na+ (blue) , OH- (green), Cl- (magenta)

plot(map(rhs,[eq8,eq9,eq10,eq12]),ionic=0..3,color=[red,blue,green,magenta]);

Leave eq 11 out since we know m. We will specify generous, but not too generous, ranges for fsolve

For the activities, the above plots suggest 0..4, but since thay are monotonic and we know we are above the minimum it may be safer to specify a restricted range for "ionic"

We choose 2*mmax for Na+ and Cl-  molalities (0..nmax should work but we don't want to be too close to the end of the range) , and 0.5*mmax...2*mmax for ionic (could choose this also for Na+ and Cl-)

For the OH- , H+, HCl, and maybe NaOH concentrations we can presumably go much smaller (msmall)

nmax:=2*eval(mmax*m,params);

0.2400000000e-3

msmall:=1e-2;

0.1e-1

Since the equilibrium constants and other parameters vary over many orders of magnitude, this should be solved with a high setting of Digits

Digits:=25;

25

eqns:=eval({eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq12},params):

First attempt gives no solution

res:=fsolve(eqns,{m_HCl=0..msmall,m_Cl=0..mmax,m_H=0..msmall,m_Na=0..mmax,m_OH=0..msmall,m_NaOH=0..mmax,ionic=0.5*mmax..2*mmax,u_H=0..4,u_Na=0..4,u_OH=0..4,u_Cl=0..4});

fsolve({0.1011579454e-13 = m_H*u_H*m_OH*u_OH, .6309573445 = m_Na*u_Na*m_OH*u_OH/m_NaOH, 2.407221665 = m_Cl+m_HCl, 2.407221665 = m_Na+m_NaOH, 100000000. = m_Cl*u_Cl*m_H*u_H/m_HCl, u_Cl = .1417625986641341*exp(-45.45546279*ionic)+.2369460669647978*exp(-2.662072017*ionic)+.5859738096037875, u_H = .4077*ionic^2-.3152*ionic+.9213, u_Na = 0.615e-1*ionic^2-.2196*ionic+.8627, u_OH = .1948*ionic^2-.1803*ionic+.8887, 2*ionic = m_H+m_Cl+m_Na+m_OH, m_Na+m_H = m_Cl+m_OH}, {ionic, m_Cl, m_H, m_HCl, m_Na, m_NaOH, m_OH, u_Cl, u_H, u_Na, u_OH}, {ionic = 1.2036108325 .. 4.814443330, m_Cl = 0 .. 2.407221665, m_H = 0 .. 0.1e-1, m_HCl = 0 .. 0.1e-1, m_Na = 0 .. 2.407221665, m_NaOH = 0 .. 2.407221665, m_OH = 0 .. 0.1e-1, u_Cl = 0 .. 4, u_H = 0 .. 4, u_Na = 0 .. 4, u_OH = 0 .. 4})

Solve the simpler problem by assuming that there is no HCl(aq) in solution - so omit eq 1 and set m_HCl=0 in eq 5

eqns1:=eval({eq2,eq3,eq4,eval(eq5,m_HCl=0),eq6,eq7,eq8,eq9,eq10,eq12},params):

res1:=fsolve(eqns1,{m_Cl=0..mmax,m_H=0..msmall,m_Na=0..mmax,m_OH=0..msmall,m_NaOH=0..mmax,ionic=0.5*mmax..2*mmax,u_H=0..4,u_Na=0..4,u_OH=0..4,u_Cl=0..4});

{ionic = 2.407221687118782060747778, m_Cl = 2.407221665000000000000000, m_H = 0.1143810110208346910486800e-6, m_Na = 2.407221572737771039913087, m_NaOH = 0.9226222896008691260626429e-7, m_OH = 0.2211878206074777844241567e-7, u_Cl = .5863642949085324404566185, u_H = 2.525049539726357549337178, u_Na = .6904491669412176811311638, u_OH = 1.583488655494620712846916}

Values look reasonable. Can we use this as a starting guess for the problem with HCl - guess m_HCl=0

guess:={m_HCl=0} union res1:

res2:=fsolve(eqns,guess);

{ionic = 2.407221687118778378231341, m_Cl = 2.407221664999995923312451, m_H = 0.1143810089824910411470732e-6, m_HCl = 0.4076687549288832532913356e-14, m_Na = 2.407221572737769395740300, m_NaOH = 0.9226223060425970007002799e-7, m_OH = 0.2211878245491889036587774e-7, u_Cl = .5863642949085324442845943, u_H = 2.525049539726351481844259, u_Na = .6904491669412173994618614, u_OH = 1.583488655494617923143445}

Looks good - HCl is very small and the change in m_Cl shows the requirement to use many digits. (won't work with Digits:=10)

 

Convert to the original mol units of the OP, and check it solves the OPs equations

molans:=eval({n_HCl=m_HCl*m,n_H=m_H*m,n_Cl=m_Cl*m,n_Na=m_Na*m,n_NaOH=m_NaOH*m,n_OH=m_OH*m},params union res2) union res2;

{ionic = 2.407221687118778378231341, m_Cl = 2.407221664999995923312451, m_H = 0.1143810089824910411470732e-6, m_HCl = 0.4076687549288832532913356e-14, m_Na = 2.407221572737769395740300, m_NaOH = 0.9226223060425970007002799e-7, m_OH = 0.2211878245491889036587774e-7, n_Cl = 0.1200000000002497967771257e-3, n_H = 0.5701893297777178401181599e-11, n_HCl = 0.2032228743320483017657308e-18, n_Na = 0.1199999954009778043776540e-3, n_NaOH = 0.4599272195622346048490895e-11, n_OH = 0.1102621305377706684739005e-11, u_Cl = .5863642949085324442845943, u_H = 2.525049539726351481844259, u_Na = .6904491669412173994618614, u_OH = 1.583488655494617923143445}

eeq1:=K_1=(((n_Cl-x)*u_Cl)*(n_H*u_H))/(n_HCl*m):
eeq2:=K_2=(((n_Na-x)*u_Na)*(n_OH*u_OH))/(n_NaOH*m):
eeq3:=K_w=(n_H*u_H/m)*(n_OH*u_OH/m):
eeq4:=(n_NaCl-x)=(n_Na-x)+n_NaOH:
eeq5:=(n_NaCl-x)=(n_Cl-x)+n_HCl:
eeq6:=(n_Na-x)+n_H=(n_Cl-x)+n_OH:
eeq7:=2*ionic=(n_H/m)+((n_Cl-x)/m)+((n_Na-x)/m)+(n_OH/m):
eeq8:=u_H=0.4077*ionic^2-0.3152*ionic+0.9213:
eeq9:=u_Na=0.0615*ionic^2-0.2196*ionic+0.8627:
eeq10:=u_OH=0.1948*ionic^2-0.1803*ionic+0.8887:
eeq11:=m=r*V:
eeq12:=u_Cl=(1.417625986641341e-01)*exp(-ionic/2.199955601666953e-02)+2.369460669647978e-01*exp(-ionic/3.756472377688394e-01)+5.859738096037875e-01:

We find that it does.

OPans:=eval([eeq1,eeq2,eeq3,eeq4,eeq5,eeq6,eeq7,eeq8,eeq9,eeq10,eeq11,eeq12],molans union params);

[100000000. = 100000000.0000000000000000, .6309573445 = .6309573445000000000000000, 0.1011579454e-13 = 0.1011579454000000000000000e-13, 0.1200000000e-3 = 0.1200000000002500000000000e-3, 0.1200000000e-3 = 0.1200000000002500000000000e-3, 0.1200000011028711021548324e-3 = 0.1200000011028711021548324e-3, 4.814443374237556756462682 = 4.814443374237556756462683, 2.525049539726351481844259 = 2.525049539726351481844259, .6904491669412173994618614 = .6904491669412173994618614, 1.583488655494617923143445 = 1.583488655494617923143445, 0.4985000000e-4 = 0.49850000000000e-4, .5863642949085324442845943 = .5863642949083517098635012]

 

Download Chem.mw

There is no difference in the singularity if the columns are permuted, so choosing the entries of the first row without considering different orders reduces the number of ways by n! for an n x n matrix.
 

restart:

alias(det = LinearAlgebra[Determinant]);
with(combinat):

det

Only test up to column permutations. Find all combinations to fill the first row, and then permutations of the other entries. Reduces the number of ways by a factor of n! for an nxn Matrix

st:=time():
S    := 0:
n    := 3;
N    := n^2:
COMB:=choose(N,n):
nums:=[$1..N]:
for comb in COMB do
  plist:=remove(has,nums,comb);
  PERM:=permute(plist);
  for perm in PERM do
    M:=Matrix(n,n,ListTools:-Flatten([comb,perm]));
    if det(M)=0 then S := S+1; end if:
  end do:
end do:
S*n!;
time()-st;

3

2736

4.672

Brute Force

 

st:=time():
S    := 0:
n    := 3;
N    := n^2:
PERM := permute(N):
for perm in PERM do
  M := Matrix(n, n, perm):
  if det(M)=0 then S := S+1; end if:
end do:
S;
time()-st;

3

2736

32.110

 

 

Download HowManyMatricesAreSingular.mw

T is already a Matrix, and stripping off the first two rows and columns can be done with T[3..,3..]

with(DifferentialGeometry); with(LieAlgebras)

NULL

M := [Matrix([[1, 0], [0, 0]]), Matrix([[0, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])]

M := [Matrix(2, 2, {(1, 1) = 1, (1, 2) = 0, (2, 1) = 0, (2, 2) = 0}), Matrix(2, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = 0, (2, 2) = 1}), Matrix(2, 2, {(1, 1) = 0, (1, 2) = 1, (2, 1) = 0, (2, 2) = 0})]

L := LieAlgebraData(M, Alg1)

_DG([["LieAlgebra", Alg1, [3, table( [ ] )]], [[[1, 3, 3], 1], [[2, 3, 3], -1]]])

DGsetup(L)

`Lie algebra: Alg1`

T := MultiplicationTable("LieTable")

T := Matrix(5, 5, {(1, 1) = ``, (1, 2) = `| `, (1, 3) = e1, (1, 4) = e2, (1, 5) = e3, (2, 1) = ``, (2, 2) = `----`, (2, 3) = `----`, (2, 4) = `----`, (2, 5) = `----`, (3, 1) = e1, (3, 2) = `| `, (3, 3) = 0, (3, 4) = 0, (3, 5) = Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (4, 1) = e2, (4, 2) = `| `, (4, 3) = 0, (4, 4) = 0, (4, 5) = Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DGproduct"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mi("e3"))))), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("&uminus0;1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (5, 1) = e3, (5, 2) = `| `, (5, 3) = Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DGproduct"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mi("e3"))))), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("&uminus0;1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (5, 4) = Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (5, 5) = 0})

whattype(T)

Matrix

A := T[3 .. (), 3 .. ()]

A := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (2, 1) = 0, (2, 2) = 0, (2, 3) = Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DGproduct"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mi("e3"))))), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("&uminus0;1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (3, 1) = Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DGproduct"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mi("e3"))))), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("&uminus0;1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (3, 2) = Typesetting:-mcomplete(Typesetting:-mi("e3"), Typesetting:-mrow(Typesetting:-mi("_DG"), Typesetting:-mo("&ApplyFunction;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-ms("vector"), Typesetting:-mi("Alg1"), Typesetting:-mfenced(open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mfenced(Typesetting:-mn("3"), open = "&lsqb;", close = "&rsqb;"), Typesetting:-mn("1"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;"), open = "&lsqb;", close = "&rsqb;")))), (3, 3) = 0})

LinearAlgebra:-Rank(A)

2

NULL

 

Download CommutatorExample.mw

You need normalization=full, and then, for some reason, another factor of 2 (Every time I do a DFT in a different piece of software, I always need to do a sample to figure this out).

FFT.mw

I couldn't see why yours didn't work, but here's an example that does. The button code is

use DocumentTools in 
nrows:=nrows+1;
A:=Matrix(nrows,2,A);
A[nrows,1]:=0;
A[nrows,2]:=1;
Do(%DataTable0(VisibleRows)=nrows);
end use; 

Download Morerows.mw

If your change ln(2) to ln(2.) then that will force the answer into a single numerical floating point value.

First 54 55 56 57 58 59 60 Last Page 56 of 81