Advanced Octave A68 — Data preparation and publishing

by Giux GX-TXT, octave-en, scripts-en 2 min read

Advanced GNU Octave with GX-TXT · Module 12

Now we turn the A67 protocol into two Datasets. The data are artificially generated: to call them observations or measures in the project means here simulated samples, not experimental results.

Objectives and prerequisites

They serve A67 and the batch publication of A14. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import genera_misure.m, register it and run it in the Runner. The octave_project_response_a and octave_project_response_b IDs are created-only: to repeat, use a new Session or change both IDs even in dependent lessons.

Generate and publish

rng(2026,'twister') initializes the generator. For each condition the program calculates 1-exp(-k*t) and adds standard deviation gaussian noise 0.02. A use k = 0.5 s⁻¹, B uses k = 0.8 s⁻¹; both have 11 times from 0 to 5 s.

Dataset contains time_s in seconds, with time role, and response dimensionless. The origin declares synthetic nature, seed, parameter and standard deviation. publish_series_batch publishes the two series as an atomic operation according to the agreement of the API.

In the test the first answers are about −0.001726 and −0.018029, and the last 0.913431 and 0,957048. A slightly negative initial value is possible because Gaussian noise is added to the ideal zero value: it is not cut out or hidden. The receipt shows two published Datasets and 11 points each.

Exercise

  1. What sizes and units are published?
  2. Why can the first value be negative?
  3. What allows you to reproduce the seed, along with the code and the environment?

Worked solution

  1. Time in seconds and dimensionless response.
  2. Synthetic noise can have negative sign even when the ideal answer is zero.
  3. The random sequence of the test in the compatible environment; method and parameters should also be kept.

Download the Module 12 scripts (ZIP)

#GNU Octave #GX-TXT #GX-TXT public APIs

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *