tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are answers submitted by tomleslie

When you have a for-loop whihc errors at some index value, the Maple environment still contains a lot of usefule information.

For example you can query the loop index: you can also  query the values of any quantities currently used in the loop - all of this without actually invoking the debugger.

I'm not knocking the debugger, just suggesting simple checks which can be performed without invoking it.

See the "toy" example attached

  restart;
  for i from 1 to 10 do
      x:=i^2;
      y:=x+17;
      z:=1/(y-33);
  od:

Error, numeric exception: division by zero

 

#
# So what were the relevant values when the problem occured
#
  i;
  x;
  y;
  1/(y-33);

4

 

16

 

33

 

Error, numeric exception: division by zero

 

 

Download toy.mw

 

 

depending on how much you care abour "efficiency". For example

  restart:
  add( numelems([StringTools:-SearchAll("5", convert(j, string))]), j=1..2022);

will return 602

I'm pretty sure you cannot get non-trivial zeros of the Zeta function in symbolic form

It isn't too hard to get an "indication" of where these zeros might occur numerically - see the graph in the attached

  restart;
#
# The critical line for the function Zeta(s) occurs
# when Re(s)=1/2. So plot the value of
#
#   abs(Zeta(1/2+I*y)
#
# for y=-50..50. Whenever this function "touches" the
# x=axis, this ought to correspond to a zero
#
  f:=y-> abs(Zeta(1/2+I*y));
  p1:=plot(f, -50...50, numpoints=1000, color=blue):
#
# As a check, get a tist of the first few zeros of
# the Zeta function along the critical line - from
#
# https://en.wikipedia.org/wiki/Riemann_zeta_function#Zeros,_the_critical_line,_and_the_Riemann_hypothesis
#
  p2:=plots:-pointplot( [ [-37.586178, 0],
                          [-32.935062, 0],
                          [-30.424876, 0],
                          [-25.010858, 0],
                          [-21.022040, 0],
                          [-14.134725, 0],
                          [ 14.134725, 0],
                          [ 21.022040, 0],
                          [ 25.010858, 0],
                          [ 30.424876, 0],
                          [ 32.935062, 0],
                          [ 37.586178, 0]
                        ],
                        symbol=solidcircle,
                        symbolsize=16,
                        color=red
                     ):
  plots:-display([p1,p2]);

proc (y) options operator, arrow; abs(Zeta(1/2+I*y)) end proc

 

 

 

Download zeta.mw

 

when n=0, i1=2, j1=1, the main assignment becomes

f[1, 2, 1] := 0.413642419923288376728650338178 - 0.0500000000000000000000000000000*f[1, 3, 1] - 0.00250000000000000000000000000000*f[1, 2, 1]

The quantity f[1,2,1] is unresolved and occurs on both sides of the assignment: this is a recursive definition

More details in the attached


 

restart; printlevel := 3

restart; with(LinearAlgebra); with(linalg); with(CodeGeneration); with(plots); Digits := 30; `ε` := 0.1e-1; k := .5; m := 1; c := 1; q := 1

L[time] := 1; L[x] := 1; L[p] := 1; T := 5; N[x] := 5; N[p] := N[x]; `Δt` := 1.0*L[time]/T; `Δx` := 1.0*L[x]/N[x]; `Δp` := 1.0*L[p]/N[p]

.200000000000000000000000000000

 

.200000000000000000000000000000

 

.200000000000000000000000000000

(1)

NULL

ICff := 1.0*exp(-p^2/(2.0))*(1.0+`ε`*cos(1.0*k*x))/sqrt(2.0*Pi); ICE := (1/2)*sin(2*Pi*x)

for i from 0 while i <= N[x] do for j from 0 while j <= N[p] do f[0, i, j] := eval(ICff, [x = i*`&Delta;x`, p = j*`&Delta;p`]) end do end do; for i from 0 while i <= N[x] do E[0, i] := eval(ICE, [x = i*`&Delta;x`]) end do

for n from 0 while n <= T do for j from 0 while j <= N[p] do f[n, 0, j] := 0; f[n, N[x], j] := 0 end do end do; for n from 0 while n <= T do E[n, 0] := 0; E[n, N[x]] := 0 end do

for n from 0 while n <= T do for i from 0 while i <= N[x] do f[n, i, 0] := 0; f[n, i, N[p]] := 0 end do end do

NULL

for n1 from 0 while n1 <= T-1 do for i1 while i1 <= N[x] do for j1 while j1 <= N[p] do f[n1+1, i1, j1] := f[n1, i1, j1]-`&Delta;t`*j1*`&Delta;p`*(f[n1+1, i1+1, j1]-f[n1+1, i1-1, j1]+f[n1, i1+1, j1]-f[n1, i1-1, j1])/((4*`&Delta;x`)*(1.0)) end do end do end do

Error, recursive assignment

 

n1; i1; j1

0

 

2

 

1

(2)

seq(f[1, 1, j], j = 1 .. N[p])

.375189826432317101138898811545-0.500000000000000000000000000000e-1*f[1, 2, 1], .334746500252356081404597822428-.100000000000000000000000000000*f[1, 2, 2], .286066637692221248210016078528-.150000000000000000000000000000*f[1, 2, 3], .234067851208132609651338592616-.200000000000000000000000000000*f[1, 2, 4], 0.

(3)

f[n1+1, i1+1, j1]; f[n1+1, i1-1, j1]; f[n1, i1+1, j1]; f[n1, i1-1, j1]

f[1, 3, 1]

 

.375189826432317101138898811545-0.500000000000000000000000000000e-1*f[1, 2, 1]

 

.394778467519063185878491518683

 

.394933585068527067518384349348

(4)

f[n1+1, i1, j1] = f[n1, i1, j1]-`&Delta;t`*j1*`&Delta;p`*(f[n1+1, i1+1, j1]-f[n1+1, i1-1, j1]+f[n1, i1+1, j1]-f[n1, i1-1, j1])/((4*`&Delta;x`)*(1.0))

f[1, 2, 1] = .413642419923288376728650338178-0.500000000000000000000000000000e-1*f[1, 3, 1]-0.250000000000000000000000000000e-2*f[1, 2, 1]

(5)

``


 

Download recur2.mw

 

 

when n1-0, i1=2, j1=1, the expression within the triple loop evaluates to

f[1, 2, 1] := 0.4136424199 - 0.05000000000*f[1, 3, 1] - 0.002500000000*f[1, 2, 1];

Note that f[1, 2, 1]  is undetermined and occurs on both sides of the assignment. This is a recursive assignment - hence the error message.

See the final execution group in the attached for more details

restart

restart; `&epsilon;` := 0.1e-1; k := .5; m := 1; c := 1; q := 1

L[time] := 1; L[x] := 1; L[p] := 1; T := 5; N[x] := 5; N[p] := N[x]; `&Delta;t` := 1.0*L[time]/T; `&Delta;x` := 1.0*L[x]/N[x]; `&Delta;p` := 1.0*L[p]/N[p]

.2000000000

 

.2000000000

 

.2000000000

(1)

NULL

ICff := 1.0*exp(-p^2/(2.0))*(1.0+`&epsilon;`*cos(1.0*k*x))/sqrt(2.0*Pi); ICE := (1/2)*sin(2*Pi*x)

for i from 0 while i <= N[x] do for j from 0 while j <= N[p] do f[0, i, j] := eval(ICff, [x = i*`&Delta;x`, p = j*`&Delta;p`]) end do end do; for i from 0 while i <= N[x] do E[0, i] := eval(ICE, [x = i*`&Delta;x`]) end do

for n from 0 while n <= T do for j from 0 while j <= N[p] do f[n, 0, j] := 0; f[n, N[x], j] := 0 end do end do; for n from 0 while n <= T do E[n, 0] := 0; E[n, N[x]] := 0 end do

for n from 0 while n <= T do for i from 0 while i <= N[x] do f[n, i, 0] := 0; f[n, i, N[p]] := 0 end do end do

for n1 from 0 while n1 <= T-1 do for i1 while i1 <= N[x] do for j1 while j1 <= N[p] do f[n1+1, i1, j1] := f[n1, i1, j1]-`&Delta;t`*j1*`&Delta;p`*(f[n1+1, i1+1, j1]-f[n1+1, i1-1, j1]+f[n1, i1+1, j1]-f[n1, i1-1, j1])/((4*`&Delta;x`)*(1.0)) end do end do end do

Error, recursive assignment

 

#
# Check values of loop indices when failure occurs
#
  n1;
  i1;
  j1;
#
# Check quantities on the rhs of the expression of the
# inner loop
#
# Not all of these resolve to numeric values -is this
# desired behaviour?
#
  f[n1, i1, j1];
  f[n1 + 1, i1 + 1, j1];
  f[n1 + 1, i1 - 1, j1];
  f[n1, i1 + 1, j1];
  f[n1, i1 - 1, j1];
#
# Change the assignment within the triple loop to an
# equation (ie replace ':=' by '=') and examine the
# result for the "failing" index values
#
# The quantity f[1,2,1] is undetermined and occurs on
# both sides of the assignment - and that is a recursive
# assignment!
#
  f[n1 + 1, i1, j1] = f[n1, i1, j1] - `&Delta;t`*1/(4*`&Delta;x`)*j1*`&Delta;p`/1.0*(f[n1 + 1, i1 + 1, j1] - f[n1 + 1, i1 - 1, j1] + f[n1, i1 + 1, j1] - f[n1, i1 - 1, j1]);

0

 

2

 

1

 

.3948751727

 

f[1, 3, 1]

 

.3751898265-0.5000000000e-1*f[1, 2, 1]

 

.3947784675

 

.3949335851

 

f[1, 2, 1] = .4136424199-0.5000000000e-1*f[1, 3, 1]-0.2500000000e-2*f[1, 2, 1]

(2)

 

Download recur.mw

 

 

is to cheat!

In the attached I shade between two horizontal lines and then (if necessary) rotate/translate the result

  with(plots):
  with(plottools):
  p1:=shadebetween(0, Pi, x=-1..1, color="Blue", transparency=0.5):
  display( [ plot(sin(x), x=0..20),
             translate( rotate(p1, Pi/2), 2*Pi, 0)
           ]
         )

 

 

Download shadPlot.mw

 

has

  1. Both dependent functions in your PDEs are second-order in the spatial-variable, 'x': hence you need four "boundary" conditions
  2. Both dependent functions in your PDEs are first-order in the time-variable, 't': hence you need two "initial" conditions
  3. However, you have supplied two "boundary" conditions and four "initial" conditions - this will never work

For illustration, in the attached I have deleted two (of the four) "initial conditions" which you supplied (because they cannot be used),  and added two (arbitrary!) boundary conditions to the two which you supplied (because they are necessary). This now generates a solution, as shown in the attached

  restart:
  sys:= { -diff(v(x,t),t)+0.5*p*diff(u(x,t),x,x)+q*u(x,t)*(u(x,t)^2+v(x,t)^2)=0,
           diff(u(x,t),t)+0.5*p*diff(v(x,t),x,x)+q*v(x,t)*(u(x,t)^2+v(x,t)^2)=0
        };
  bc:= u(0,t) = 2,
       v(0,t) = 0,
       u(1,t) = 0,  # made this up
       v(1,t) = 0;  # made this up
  ic := u(x,0) = tanh(2*Pi),
        v(x,0) = tanh(2*Pi);
  pdsol := pdsolve(eval(sys, [p=1, q=0.5]), {ic, bc}, numeric);
  p1:= pdsol:-plot3d( u(x,t), x=0..1, t=0..5, color=red, style=surface, transparency=0.5):
  p2:= pdsol:-plot3d( v(x,t), x=0..1, t=0..5, color=blue, style=surface, transparency=0.5):
  plots:-display([p1,p2]);

{diff(u(x, t), t)+.5*p*(diff(diff(v(x, t), x), x))+q*v(x, t)*(u(x, t)^2+v(x, t)^2) = 0, -(diff(v(x, t), t))+.5*p*(diff(diff(u(x, t), x), x))+q*u(x, t)*(u(x, t)^2+v(x, t)^2) = 0}

 

u(0, t) = 2, v(0, t) = 0, u(1, t) = 0, v(1, t) = 0

 

u(x, 0) = tanh(2*Pi), v(x, 0) = tanh(2*Pi)

 

_m695789472

 

 

Download pdeProb.mw

You need to change the  main procedure slightly, as in the attached

NULL

with(plots)

DE1 := diff(f(eta), `$`(eta, 3))+f(eta)*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))^2 = 0

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2 = 0

(1)

DE2 := diff(theta(eta), `$`(eta, 2))+Pr*f(eta)*(diff(theta(eta), eta))+Pr*Nb*(diff(theta(eta), eta))*(diff(phi(eta), eta))+Pr*Nt*(diff(theta(eta), eta))^2 = 0

diff(diff(theta(eta), eta), eta)+Pr*f(eta)*(diff(theta(eta), eta))+Pr*Nb*(diff(theta(eta), eta))*(diff(phi(eta), eta))+Pr*Nt*(diff(theta(eta), eta))^2 = 0

(2)

DE3 := diff(phi(eta), `$`(eta, 2))+Le*(diff(phi(eta), eta))+Nt*(diff(theta(eta), `$`(eta, 2)))/Nb

diff(diff(phi(eta), eta), eta)+Le*(diff(phi(eta), eta))+Nt*(diff(diff(theta(eta), eta), eta))/Nb

(3)

BC1 := f(0) = 0, (D(f))(0) = 1, (D(f))(10) = 0

f(0) = 0, (D(f))(0) = 1, (D(f))(10) = 0

(4)

BC2 := theta(10) = 0, (D(theta))(0) = -Bi*(1-theta(0))

theta(10) = 0, (D(theta))(0) = -Bi*(1-theta(0))

(5)

BC3 := phi(0) = 1, phi(10) = 0

phi(0) = 1, phi(10) = 0

(6)

NULL

  getRes:= proc(a, x);
                local sol;
                if   type(x, numeric)
                then sol:= dsolve
                           ( eval
                             ( {BC1, BC2, BC3, DE1, DE2, DE3},
                               [Nt = a, Nb = a, Pr = 2, Le = 5, Bi = x]
                             ),
                             numeric,
                             output = listprocedure,
                             abserr = 0.0001,
                             maxmesh = 1024,
                             initmesh = 512
                           );
                else return 'procname(a,x)';
                fi;
                return -eval(diff(theta(eta), eta), sol)(0)
           end proc:

  cl:=[red, green, blue, yellow, black]:
  L:=[0.2, 0.4, 0.6,0.8,1.0]:
  display
  ( [ seq
      ( plot
        ( getRes( L[k], x),
          x=0..5,color = colorList[k],
          legend = ["Nb=Nt" = L[k]],
          legendstyle = [location = top, font=[times, bold, 14]],
          color=cl[k],
          labels=[typeset(Bi), typeset(-D(theta)(0))],
          labelfont=[times, bold, 14]
        ),
        k=1..5
      )
    ]
  )
               

 

  getRes2:= proc(a, x);
                local sol;
                if   type(x, numeric)
                then sol:= dsolve
                           ( eval
                             ( {BC1, BC2, BC3, DE1, DE2, DE3},
                               [Nt = x, Nb = x, Pr = 2, Le = 5, Bi = a]
                             ),
                             numeric,
                             output = listprocedure,
                             abserr = 0.0001,
                             maxmesh = 1024,
                             initmesh = 512
                           );
                else return 'procname(a,x)';
                fi;
                return -eval(diff(theta(eta), eta), sol)(0)
           end proc:

  cl:=[red, green, blue, yellow, black]:
  L:=[0.2, 0.4, 0.6,0.8,1.0]:
  display
  ( [ seq
      ( plot
        ( getRes2( L[k], x),
          x=0..1,
          color = colorList[k],
          legend = ["Bi" = L[k]],
          legendstyle = [location = top, font=[times, bold, 14]],
          color=cl[k],
          labels=[typeset(Nb=Nt), typeset(-D(theta)(0))],
          labelfont=[times, bold, 14]
        ),
        k=1..5
      )
    ]
  )

 

 


 

Download odeProb.mw

see the attached. I also don't understand why you can't upload a worksheet which illustrates your problem. As the attached shows, this seems to be functioning (at the moment)

restart:
data := [a=1, b=2]:
convert(
  piecewise(And(x(t) > a, x(t) < b), 1, 0),
  Heaviside
):
expr1 := eval(eval(%, data),  x(t)=z):
plot(expr1, z=0..3);


convert(
  piecewise(And(z > a, z< b), 1, 0),
  Heaviside
):
expr2 := eval(%, data):
plot(expr2, z=0..3);

 

 

restart:
data := [d=1.5, a=0.5]:
convert(
  piecewise(And(x(t) > d-a, x(t) < d+a), 1, 0),
  Heaviside
):
expr1 := eval(eval(%, data),  x(t)=z):
plot(expr1, z=0..3);


convert(
  piecewise(And(z > d-a, z< d+a), 1, 0),
  Heaviside
):
expr2 := eval(%, data):
plot(expr2, z=0..3);

 

 

 

 

Download issame.mw

On the assumption that you have both Maple and Matlab, then you can set-up (a restricted version of) Maple as a "symbolic toolbox" within Matlab.

This will allow you to use (a restricted set of) Maple commands from within Matlab. I genera\lly find this a more successful approach than generating code within Maple and then translating it.

You can achieve this with the following:

  1. Assuming that your operating system is Windows, then within your Maple installation directory (probably C:\Program Files\Maple 2021) there will be a file called MapleToolbox2021.2WindowsX64Installer.exe - all you have to do is run it
  2. It may prompt for stuff about your the location of your Matlab installation etc, etc, but the installation process is pretty automatic
  3. Assuming that step (2) above completes, then fire up Matlab, and open the Matlab help. In the panel on the left-hand-side  you should see an entry called Maple Toolbox under Supplemental Software
  4. Utilising the "help" in (3) above you will be able to perform many "Maple" calculations from within Matlab

A caveat: I should make it clear that (in general) I am do not recommend invoking one software package from within another, or asking one particular package to generate code for another - you will ALWAYS discover "incompatibilities" and trying to work around these will drive you nuts. So if all possible,

  1. whatever it is - do it all in Maple, or
  2. whatever it is - do it all in Matlab

the (minor) change in the attached

  restart;

  extend := proc(f)
                 local x, y;
                 unapply(f(x), x, y);
            end proc:
  p:=x->cos(2*x):
  q:=extend(p);
  ribbonplot5 := proc(Flist, r1::{range,name=range})
                      local i, m, p, n, opts,newFlist;
                      opts := [args[3 .. nargs]];
                      if   type(r1, range)
                      then if   not hasoption(opts, 'numpoints', 'n', 'opts')
                           then n := 25
                           end if;
                           m := nops(Flist);
                           p := seq(plot3d(extend( Flist[i]), r1, (i-1) .. i,
                                           grid=[n, 2], op(opts)),
                                    i = 1 .. m):
                           plots[display](p):
                      else newFlist := map(unapply, Flist(lhs(r1)), lhs(r1));
                           opts := ['labels'=[lhs(r1), " "," "], args[3 .. nargs]];
                           ribbonplot5(newFlist,rhs(r1),op(opts)):
                      end if:
                end proc:
  ribbonplot5([cos, sin, cos + sin], x=-Pi .. Pi,numpoints=20);
  ribbonplot5([cos, sin, cos + sin], -Pi .. Pi,numpoints=20);

proc (x, y) options operator, arrow; cos(2*x) end proc

 

 

 

 

Download ribbon.mw

from the piecewise() help page in Maple 2021 - my emphasis. (NB this paragraph does not exit in the equivalent help page for Maple 2015)

When using boolean combinations of relations, the use of boolean functions (such as And and Or) in piecewise functions is recommended over using boolean operators (such as and and or). While it is possible to use the operators if all relations involved are inequalities, or if all variables have been assigned values, using operators with equations or inequations involving symbolic parameters will lead to unexpected results. For more details, see the documentation of the evalb command.

Applying this advice in Maple 2015 seems to "solve" your problem - see the attached

  restart:
  interface(version);
  m2(t) = piecewise( And(x1(t) < c, v1(t) < 0), 1,  0);
  m1(t) = piecewise( And(x1(t) = c, v1(t) > 0), 0,  1);

`Standard Worksheet Interface, Maple 2015.2, Windows 7, December 21 2015 Build ID 1097895`

 

m2(t) = piecewise(And(x1(t) < c, v1(t) < 0), 1, 0)

 

m1(t) = piecewise(And(x1(t) = c, 0 < v1(t)), 0, 1)

(1)

 

Download pw2015.mw

the attached fulfils all/most of your requirements

  restart;
  with(Units[Standard]):
  interface(displayprecision=3):
  params:= [ P1=1.6e-4*Unit('Pa'),
             P2=36.4*Unit('Pa'),
             T1=273.15*Unit('K'),
             T2=373.15*Unit('K'),
             R=evalf(ScientificConstants:-Constant('R', units))
           ];
  Clacla := ln(P2/P1) = (Delta(H[vap])/R)*((1/T1) - (1/T2)):
  ans:= Delta(H[vap])= convert
                       ( rhs
                         ( eval
                           ( isolate( Clacla, Delta(H[vap]) ),
                             params
                           )
                         ),
                         'units',
                         'J/mol'
                       );

[P1 = 0.16e-3*Units:-Unit(Pa), P2 = 36.4*Units:-Unit(Pa), T1 = 273.15*Units:-Unit(K), T2 = 373.15*Units:-Unit(K), R = 8.3144598*Units:-Unit(m^2*kg/(s^2*mol*K))]

 

Delta(H[vap]) = 104533.2652*Units:-Unit(J/mol)

(1)

 

NULL

Download unProb.mw

is that in Maple, 'Pi' is the ratio of circumference ot diameter; 'pi' is just the (meaningless) Greek letter.

I'm not exactly sure what you are trying to achieve, but the attached *may* be what you want (and doesn'tt use either a for loop or a seq() command

In future please use the big green up-arrow in the Mapleprimes toolbar to upload your worksheet (rather than posting a picture of your worksheet). It makes life so much easier for anyone responding

  restart;
  assume(k, integer);
  lev:=[exp(2*k*Pi*I), exp((2*k+1)*Pi*I), exp(Pi*I/2), exp(3*Pi*I/2), exp(Pi*I/3)]:
  lunev:=[''exp(2*k*Pi*I)'', ''exp((2*k+1)*Pi*I)'', ''exp(Pi*I/2)'', ''exp(3*Pi*I/2)'', ''exp(Pi*I/3)'']:
  zip( (x,y)-> print( x=y), lunev, lev)[];

exp((2*I)*k*Pi) = 1

 

exp(I*(2*k+1)*Pi) = -1

 

exp(((1/2)*I)*Pi) = I

 

exp(((3/2)*I)*Pi) = -I

 

exp(((1/3)*I)*Pi) = 1/2+((1/2)*I)*3^(1/2)

(1)

 

Download Pinotpi.mw

 

it is always possible to write a procedure to perform a task - but for something very simple, such as comparing two values, one has to ask is it worth it? One  possibility for your example is shown in the attached - but I would say it is probably "overkill"

From within Maple, you can

  1. Use the CodeGeneration() package to generate Maple code to Python code, and (if necessary) output the latter to a file. Or
  2. Use the Python() package which provides direct access to a Python interpreter and a selection of pre-installed Python packages.

A caveat: I've never been a big fan of using one software package to generate code for, or access commands in a different package. In my experience only a restricted range of functionality in either the "source" or "target" software is supported, which can get really annoying reall quickly

For future reference please use the big green up-arrow in the Mapleprimes toolbar to upload your Maple worksheet: it makes life so much easier for anyone attempting to respond

  restart:
  f:= proc( z::integer)
          #
          # The golden mean and the golden ratio. (NB
          # these are often confused!)
          #
          # Basically goldenRatio = goldenMean+1
          #
            local GM:=( sqrt(5)-1)/2,
                  GR:=( sqrt(5)+1)/2,
                  expr:=exp(x)-exp(-x)=z,
                  ans:
            if   z=1 or z=-1
            then ans:= exp
                       ( select
                         ( type,
                           [ solve(expr) ],
                           realcons
                         )[]
                       );
                 if   ans=GM
                 then printf( "   Passed value %3d causes %a"\
                              " to generate the Golden Mean\n",
                              z,
                              expr
                            );
                 elif ans=GR
                 then printf( "   Passed value %3d causes %a"\
                              " to generate the Golden Ratio\n",
                              z,
                              expr
                            );
                 fi;
            else printf( "   Incorrect parameter value - %d" ,z);
            fi;
      end proc:

  f(-1);
  f(1);
  f(3);

   Passed value  -1 causes exp(x)-exp(-x) = -1 to generate the Golden Mean
   Passed value   1 causes exp(x)-exp(-x) = 1 to generate the Golden Ratio
   Incorrect parameter value - 3

 

 

Download GMGR.mw

First 33 34 35 36 37 38 39 Last Page 35 of 207