There is a newer version of the record available.

Published February 3, 2023 | Version v1.1
Software Open

learningsimulator/learningsimulator: 1.1

Description

This version includes the following new features, addressing issues #89, #96, #103, and #165.

Specify run label in @run without using runlabel:
@run myrunlbl phase1, phase2

as a shorter form of

@run phase1, phase2  runlabel: myrunlbl
Allow phase names on separate lines:
@run myrunlbl
    phase1
    phase2
    phase3

is the same as

@run phase1, phase2, phase3
Allow space-separated (not only comma-separated) phase names in @run:
@run myrunlbl phase1 phase2 phase3
Stop condition within @run statement:
@run myrunlbl
    phase1(stop: stop_cond)
    phase2(stop: stop_cond)

or

@run myrunlbl phase1(stop: myCond1), phase2(stop: myCond2)

If the stop condition is present in the @phase block, the one in @run overwrites it. If there is no stop condition, neither in @phase nor in @run, an error will occur.

New commands @plot and @export
@plot v(s->b)      # same as @vplot s->b
@plot p(s->b)      # same as @pplot s->b
@plot w(s)         # same as @wplot s
@plot n(a->b->c)   # same as @nplot a->b->c
@plot vss(s1->s2)  # same as @vssplot s1->s2

and in the same way

@export v(s->b)  # same as @vexport s->b

etc.

Allow arithmetic expressions in @plot and @export:
@plot v(s1->b1) + v(s2->b2)
@plot p(s1->b1) * p(s2->b2)
@plot n(s->response) / n(s)

Supported operators are

  • +, -, *, /, **
  • trigonometric functions (sin, cos, tan)
  • inverse trigonometric functions (asin, acos, atan)
  • hyperbolic functions (sinh, cosh, tanh)
  • inverse hyperbolic functions (asinh, acosh, atanh)
  • round, ceil, floor
  • exp, log, log10, sqrt
Allow multiple plots in one command with semicolon separation

Examples:

@plot v(s1->b1); v(s2->b2); p(s3->b3)
@plot v(s1->b1) + p(s2->b2) / 42 * sin(n(s1->b1->s2))   ;   n(a->b->c->d)
@pplot s1,s2->b1   ;   s3[0.1],s4[0.2] -> b2
Allow multiple plots in one command with wildcard syntax
@plot v(s->*)

is a short form of

@plot v(s->b1)
@plot v(s->b2)
@plot v(s->b3)

if behaviors = b1, b2, b3.

In the same way:

@plot v(*->b)
@plot v(*->*)
@plot w(*)
@panel may be used instead of @subplot
@panel 121  # Same as @subplot 121
Specify subplot grid in @figure
@figure(1,2)
@panel
@plot p(a->b) # This plot ends up in subplot 121
@panel
@plot p(c->d)  # This plot ends up in subplot 122

Files

learningsimulator/learningsimulator-v1.1.zip

Files (43.4 MB)

Name Size Download all
md5:cc1e11ee443266262ade252c7107c776
43.4 MB Preview Download

Additional details