Step-by-step exercises

Choosing a path

Use an exercise Session and new IDs. The linked files are synthetic. The paths marked as blocked indicate the point to reach and the output to check once corrected. If you already have a compatible Function check provider, revision and units before the exercises that require it.

1. Plot and save Sine

  1. Create a Session, open Viewers → Mathematics and choose Graphs. Check amplitude*sin(x), X from −6 to 6 and 301 samples.
  2. Use Operations → Plot / Refresh. Turn the wheel to zoom into the central area and double-click to fit the view.
  3. Save with File → Save model. From Publish → Sampled Dataset… use a free prefix. Wait for the publishing message.
  4. Look in the Dataset browser for the prefix with the suffix .s0001. Compare the output with the reference CSV (ZIP). At the central row X=0 gives 0 and at the ends about +0.2794155 and −0.2794155 are expected. Check 301 rows and unit 1.
  5. To compare samples and Graph, use Graph… and another prefix. In the P012 test the variant was visible after Plots → Refresh, then disappeared at restart (216 and 222). Check the existing objects before repeating the publication. To publish the plot starting from the samples use the Scientific Dataset Plot path.
Sine model and starting Native2D curve.
Sine model and starting Native2D curve.
Sine variant visible in Plots before the restart.
Sine variant visible in Plots before the restart.

2. Declare a branch with holes and change unit

  1. In the Sine function right-click the row and Edit selected…. Set Output unit = s. In Parameters → Edit selected… give the input amplitude value 4 and unit s. In the Units section set Common X unit = s.
  2. Double-click Main. Set Expression = x, limits -amplitude and amplitude, include only the upper one. Set Sampling → explicit and -4 -3 -2 -1 0 1 2 3 4 in Explicit X (space-separated).
  3. Enter -1 ; 1 ; 1 ; 0 and 2 ; 2 ; 1 ; 1 in Exclusions, on two rows. Use Output unit (empty inherits) = ms, confirm with Apply and calculate.
  4. Look for three native components. At X=−3 and −2 s the expected Y values are −3000 and −2000 ms. At X=1 s Y is 1000 ms, at 3 and 4 s it is 3000 and 4000 ms. The horizontal distances stay expressed in seconds.
  5. Save and publish with Sampled Dataset… and a free prefix. Reopen the samples of each segment to check order, units and isolation of the point X=1.
Segments of f(x)=x separated by the exclusions and converted to ms.
Segments of f(x)=x separated by the exclusions and converted to ms.

3. Family, exact input and definition

  1. Start from a function with unit 1 and declare two shared inputs, amplitude=4 and offset=2.75. Configure Slider mode → linear for the first, with limits −10 and 10. Leave none for the second. Declare a local offset in a second function to compare the precedence of the scopes.
  2. Open Linear systems… and set a single equation with coefficient 2 and known term 6 for the unknown coefficient. Look for 3 in the list. Check that the derived value cannot be edited from the input box.
  3. Open Parameter families… and record the set with amplitude 4, offset 2.75. Use a formula such as amplitude*sin(coefficient*x)+offset. At X=0 2.75 is expected. After selecting the family change only the amplitude with the exact value and check that the offset is unchanged. To get amplitude 4 back select the family again.
  4. Save the Workspace. Reopen it with File → Open…, then check units, values and family. Controls, conditioning and validation

4. Roots and extrema of a parabola

  1. In Graphs change Main to x^2-1, with X and Y in 1, global limits −2 and 2 and 401 samples.
  2. At the bottom of the Inspector choose roots. Use Operations → Analyze and keep the whole window. Substitute the reported X into the expression. Expected −1 and 1, with residual close to zero.
  3. Choose extrema and repeat. The expected minimum is −1 at X=0. Check how the report distinguishes interior candidates from the ends of the interval.
  4. To study intersections configure a distinct function with the formula x, then use x^2 in the first. Choose intersections and the second function. In the window [−2,2] the expected abscissas are 0 and 1.
  5. The report stays in Study → Last completed study as long as the context keeps it. Save the Workspace to resume model and configuration and run the analysis again after reopening. Analyze commands
Roots on the domain [−2, 2].
Roots on the domain [−2, 2].

5. Signed integral and boundary

  1. Create two branches of a function in unit 1. Choose x on [−2,0) and x^2 on [0,2]. Set 201 samples per branch. Keep 0 included only in the right branch.
  2. Select the first branch and use Operations → Integrate selected. Repeat for the second. Read the effective limits and the unit of the result. For the first branch, if the last sample is −0.01, the trapezium integrates up to −0.01 and the reference on that interval is −1.99995.
  3. In the context menu of the function choose Select all branches for calculus and integrate. Compare the numerical sum with the trapezium over the admitted samples and with the analytical reference 2/3 over the whole ideal interval.
  4. Enable Show derivative of selected function / branch and look at the segments. Sampled Dataset… keeps the grids of the components so you can redo the calculation. Procedure and limits

As an independent check already reproduced, integrate x^2-1 on [−2, 2] with 401 samples instead. The result expected from the grid is 1.3334.

Reference trapezoidal check.
Reference trapezoidal check.

6. Save, reopen and transfer the Workspace

  1. In an empty Session try File → Open…. If the P012 archive error (213) appears, do File → Save model and reopen the selector.
  2. Change the layout with Settings → More space for Graph and hide an inactive tab from Settings → Tabs. Keep at least one tab visible. Save.
  3. Reopen the document from the list. Check formula, name, layout and plot with Plot / Refresh. Close GX-TXT and reopen the Session to test persistence without the previous process.
  4. To transfer, open Workspace → Session Workspaces…, choose a row and use Export…. In a separate Session use Import…, then open the imported row and compare model, view and resources. Manager commands
Model available in the list after the first save.
Model available in the list after the first save.

7. Canonical Function, Mathematical Function and Algebra

P012 condition. In the Sine path the canonical publishing stops before the Dataset is created (214). The steps from the third onwards require a Function already admitted. The CSV of exercise 1 offers a check on the values.

  1. Save Sine, select it and open Publish selected Function Dataset…. Enter a free ID and start Publish Function.
  2. In Jobs check the terminal state and whether the ID has been created. In the standard P012 profile the test returned FAILED.
  3. If you have an admitted Function, activate it in Dataset and use Open. In Mathematical Function compare Formula, Scientific details, LaTeX, Provenance and Technical data. For a declaration a*x+b with a=0.125 V/s, b=0.25 V, check 0.875 V at 5 s.
  4. If Create editable Workspace… is available, save it with a new identity. Change a to 0.25 V/s, check 1.5 V in the copy and reopen the original. Parameters and revision of the original Dataset must match those read in step 3.
  5. For Algebra use the A/B operands of the local recipe distributed with P012 when the provider publishes them. Use Add Functions → Apply and View formula. The sum of the two 2*x+1 is 4*x+2. With Publish result… save it, reopen it from Dataset and select it again as an operand. With Evaluate samples… compare −2, 2, 10 at X −1,0,2. For piecewise try the product 2,0,4 at −1,0,1 and the scale −2.
  6. Save the Algebra Workspace and reopen it to consult the History. Before publishing again wait for the operands to be checked and repeat Apply.
Terminal state that prevents the step from Sine to Mathematical Function.
Terminal state that prevents the step from Sine to Mathematical Function.

8. Resonance of two RLC circuits

  1. Open Series RLC frequency response…. Use 100 Ω, 0.01 H, 1 μF and 100 1000 10000 100000 rad/s. The characteristic angular frequency is 1/sqrt(L*C)=10000 rad/s.
  2. Check Review response. Repeat with the same frequencies converted through f=ω/(2*pi). Check that the physically equivalent rows have the same response within rounding. Try duplicating a sample and read the rejection.
  3. Publish with a new ID and title. From Plots → Refresh locate the variant and read gain and phase. From Dataset compare the columns with the ratio Vc/Vin.
  4. Repeat in Parallel RLC current response…. Here you read Ir/Iin. With the four angular frequencies of the test, the gain reaches 0 dB. Meaning and units
Reopening the Bode plot published from the series RLC study.
Reopening the Bode plot published from the series RLC study.
Review with frequencies in rad/s and current in the resistor.
Review with frequencies in rad/s and current in the resistor.

9. Notch and Transfer composition

  1. Choose Continuous transfer response… → Single stage (A). Numerator 1 0 49, denominator 1 4 49, frequencies 1 4 7 10 20 rad/s.
  2. Review response shows Re and Im both at zero at angular frequency 7. The gain reports −∞ and the phase is undefined. After publishing look for the validity flag in the table and check which samples are represented in the Graph.
  3. For the comparison set A=1/(s+1) and B=1/(s+2). Choose in turn Cascade, Ideal parallel sum, Ideal parallel difference and Response quotient. At ω=1, the expected quotient (2+j)/(1+j) is 1.5−0.5j. Swap A and B and check the reciprocal.
  4. Give each publication a distinct ID. Reopen the Datasets of the outputs you want to compare and keep frequencies and units the same. Branches and conditions
The notch row distinguishes zero magnitude and undefined phase.
The notch row distinguishes zero magnitude and undefined phase.

10. Fourier at 125 Hz

  1. Download the Fourier CSV (ZIP). In Acquisition add a file of generic table type and import it into the Session after giving unit s to t and V to voltage. In the Dataset check 81 rows.
  2. Open Fourier partial sums…. Select the source ID, Time variable and Response variable. Set Period (s) = 0.008, Fitted harmonics = 2 and Retained orders (space-separated) = 1 2.
  3. Start Fit and review. Look for DC=2 V, first cosine=1.5 V and second sine=0.7 V. The maximum residual is 0.7 V for order 1 and about 5.55×10⁻¹⁵ V for order 2.
  4. Fill in New Dataset ID and Graph title, then Publish Graph. Reopen it in Plots and check that the requested sums are also represented. In P012 Store Function… remained disabled after this path (219). Use and limit
Fourier summary on the 125 and 250 Hz data.
Fourier summary on the 125 and 250 Hz data.

11. Quarter turn, conversion and triangle

  1. Open Trigonometry and plane geometry… → Angle and phase shift, use deg, angle 30 and shift 60. Calculate returns sine 1 and undefined tangent. Try a 59.99° shift and look for a finite tangent.
  2. Open Unit circle…. Project the angle marker and the phase marker, check Y=0.5 and Y=1. In Periodic curves… → Sine read the two values at δ=0. Use Cosine to compare the X values.
  3. In Cartesian to polar use X=3, Y=4 and unit m. Check r=5 m, direction ≈53.130102°. With X=Y=0 check the qualification of the direction. Try the triangle with Triangle · cosine law, sides 3 and 4 m, included angle 90°. Expected side 5 m.
  4. The results are read in the dialogs. To repeat the comparison after closing, reopen the study and enter the data again. All the modes
Exact limit at the quarter turn.
Exact limit at the quarter turn.
Geometric conversion (3,4) and (r=5).
Geometric conversion (3,4) and (r=5).

12. Laplace Step and convergence boundary

  1. Open Unilateral Laplace transform… → Step. Enter amplitude 3, unit V, σ=2 1/s and -4 0 4 rad/s.
  2. Start Evaluate transform. Read 0.3+0.6i, 1.5 and 0.3−0.6i V·s. Try σ=0 and read the convergence condition.
  3. Restore σ=2 and review again. If you want to keep the comparison, give a free ID and use Publish Graph. Check Graph and Dataset from the main window.
  4. Select Rectangular pulse (formal) and watch the switch to Review expression and Store Function. With P012 the review Job stopped before storage (218). Formal path
Numerical comparison at the three points of the complex plane.
Numerical comparison at the three points of the complex plane.

13. Assigned action, solver and Legendre

  1. In Lagrangian action and residual… → Straight-line reference, enter mass 2 kg and stiffness 0. Press Evaluate path. Check q from 1 to 3 m in 1 s, v=2 m/s, action 4 J·s and residual 0 N.
  2. With Fixed-endpoint free particle use the same endpoints and four intervals. The profile without Octave optim ends FAILED (215). With the dependency registered in the isolated profile the test returned four intervals at 2 m/s with action 4 J·s.
  3. Try Solve initial-value problem with stiffness 3 N/m and mass 2 kg. Compare the trajectory profile and the residual with the free reference. As a fourth mode, import the assigned trajectory (ZIP) with t in s and q in m. Choose Dataset trajectory, select the columns and use m=2 kg, k=0 N/m. Evaluate path returned action 4 J·s on 17 rows. Choose Publish Graph when you have a valid review, then consult the objects in the Session.
  4. Open Legendre transform at one state…. Enlarge it if the commands are out of view. Set q=1, v=4, m=2, k=3. Press Evaluate state and look for p=8 kg·m/s and H=17.5 J. Use Store state Dataset to keep an admitted state and reopen it from the Dataset tab.
Fixed-endpoint solution with the dependency active.
Fixed-endpoint solution with the dependency active.
Momentum and Hamiltonian for the assigned state.
Momentum and Hamiltonian for the assigned state.

14. Voltage grid and partials

P012 prerequisite. An admitted bilinear Function is needed. In the test Session the selector remained without the source. The figure shows how far the path goes without a Function.

  1. Open Study a physical surface… and select a Function z=x*(1+2*y) with X/Z in V and Y in 1, domain X from −2 to 1, Y from 0 to 1.
  2. Use X -2 0 1 and Y 0.25 1, Graph view → surface, Review grid. The expected values of the two rows are [−3,0,1.5] and [−6,0,3] V. With contour3 set 5 levels; with hold Y enter a single Y.
  3. Extend the grid with X=−0.5 and Y=0.25 inside. Evaluate partials at that point expects 1.5 V/V and −1 V/1. At the edge compare Endpoints → One-sided and Unavailable.
  4. Publish Graph on the admitted review. Reopen the Graph in Plots and compare axes and units. For a surface look for Native3D, for a section Native2D. Grids, sections and limits
Surface entry with Review grid unavailable as long as the Dataset is missing.
Surface entry with Review grid unavailable as long as the Dataset is missing.

15. Reading the simple zeros and the double zero

  1. In a new model, set X and Y in 1, Global X minimum = −4, Global X maximum = 4 and Default sample count = 401. In the Branch declaration write (x-2)*(x+1)^2*(x+3).
  2. Use Plot / Refresh. Watch the sign change at −3 and 2 and the tangency to the axis from below at −1. Check the sign by comparing, for example, P(−4)>0, P(−2)<0, P(0)<0 and P(3)>0.
  3. Choose roots → Analyze, interval [−4,4]. Substitute the candidates into the factored formula. On [−4,4] the test found −3, −1 and 2 with residuals displayed as zero. The double zero emerged as a sampling candidate. The absence of a candidate on another grid is compatible with a zero without a sign change.
  4. The multiplicity 2 at −1 follows from (x+1)^2. The expanded form is x^4+3*x^3-3*x^2-11*x-6. Keep the model with Save model, reopen it and change the grid to compare the sampling outcomes.
Numerical candidates for the three distinct zeros, including the double one.
Numerical candidates for the three distinct zeros, including the double one.

16. Single intersection, parallel and coincident lines

  1. Configure two functions in the same model, with X and Y in 1 and a window that contains X=3. Use 2*x+2 and x+5. Choose intersections → Analyze and indicate the other function. The test reports X=3, with zero residual. Substituting into one of the formulas gives Y=8.
  2. Change the first to x+2. Compare it again with x+5. The result no root detected is consistent with two parallel and distinct lines.
  3. Change the second to x+2 as well. Repeat the analysis. The response indeterminate sampled zero is indeterminate for a search for isolated points. The two identical formulas show that every point (x,x+2) in the domain is a solution.
  4. For the general case use a*x+2 and x+b, with parameters in 1. Solve (a-1)*x=b-2. With a≠1 you get X=(b−2)/(a−1) and Y=(ab−2)/(a−1). With a=1 it depends on whether b is 2. Use Save model and reopen the Workspace to repeat the test with the same configuration.
A candidate at X=3 when the slopes differ.
A candidate at X=3 when the slopes differ.
Zero difference at the samples when the two formulas coincide.
Zero difference at the samples when the two formulas coincide.