In step 5, we found the span at which the beam's utilisation reaches 1.0 by interpolating between the points of a seven-point sweep. In this step, we'll find that span directly with a Seek. To do this, we'll wire the script's utilisation output back into the Seek's signal socket. Each round of the search is then based on the utilisation that the script calculates from that round's moments, and Structure Bench solves only the spans the search needs. This is the last step of the pathway, and by the end of it we'll have answered a design question on the canvas without any interpolation.
The beam: a seek judged by the script's utilisation. The Studies view opens on the study this step is about, with the run its owner stored; nothing you do here changes the model.
Members can copy this model into their own projects and work the step in it. Join or sign in.
1.0 The idea
In step 1, we set the Seek's target on an observable. An observable is a result that the model returns directly from a solve, such as the peak moment or the deflection at midspan. In each round, Structure Bench solved the model at a set of trial values, and the Seek compared the observable at each one with the target.
However, the quantity we check in a design is usually calculated from those results, rather than returned by the solve itself. A utilisation is a good example. The solve returns the peak moment, but the utilisation is that moment divided by the section's resistance, and in this model it's the script that calculates it, after the solve.
So, to find the span at which the utilisation reaches 1.0, the Seek has to work with a value that's calculated on the canvas after the model is solved. This is what the Seek's signal socket is for. When we wire a series into it, the Seek uses the values on that wire in place of an observable, and the node shows judges by the wire followed by the wire's label.
Each round of the search then works in four stages, Fig 1.
The Seek sets out the spans for the round, and Structure Bench solves the model at each one, as one study.
The model returns the peak moment at each span, and the script divides each moment by the resistance to give the utilisation at that span.
The script's U output carries the utilisations back to the Seek, along the wire into its signal socket.
The Seek compares each utilisation with the target of 1.0 and narrows the range of spans around the crossing. If a span gives a utilisation within the 0.002 tolerance, the search stops. If not, the Seek sets out the spans for the next round and the four stages repeat.
Fig 1. One round of a seek on a calculated value. The Seek sets out the spans for the round (left), and Structure Bench solves the model at each span (centre). The script divides each peak moment by the resistance to give a utilisation (right). The signal wire (in colour) carries the utilisations back to the Seek, which compares them with the target of 1.0 and sets out the spans for the next round.
The signal wire runs from the output side of the model back to the Seek on its input side, so it forms a loop through the model. On any other wire, a loop of this kind is an error, because there's no order in which the canvas could evaluate the nodes. Structure Bench allows this one loop on purpose. The wire's type is checked in the same way as any other wire's, but the wire is left out of the ordinary order in which the canvas is evaluated. Instead, the Seek uses the values on it after each round, once the script has calculated them.
2.0 Reading the canvas
The model is the beam again, with step 5's utilisation script. The Seek varies L between 8 m and 20 m, with a target of 1.0 and a tolerance of 0.002, and it has no observable selected. The script's M input is wired from the model's peak-moment socket. Its L input is wired from the Seek's values socket, so the script receives each round's spans alongside that round's moments. The script's U output is wired into the Seek's signal socket.
Three Outputs show the span found, the moment at that span and the resistance. The Chart plots the Seek's values and observed outputs, which are the spans the search evaluated and the utilisation at each one. Together, they trace the utilisation curve.
Things to try
Press Load the model and press Run the scripts. Look at the Seek node. It has no observable, only the line judges by the wire: Script U. Follow that wire from the script's U output back to the Seek's signal input. The Output Span at U = 1 (seek) shows 13.64 m, which is the answer from the seek the model's owner stored.
If you're a member, press Copy to my projects. Your copy opens on this study. Press โถ Seek L, and the button counts the rounds as the search runs. When the search finishes, the Chart plots the utilisation curve. Its points are spread widely between 8 m and 20 m and close together around 13.6 m. The verdict gives the span found, the signal used, the target and the number of evaluations.
Look at the Outputs. These are the span at which U = 1, the moment at that span and MRdโ. The moment at the span found is 837.8 kNm, which is equal to the resistance. Press Open on the Table's green row to see the beam solved at that span.
In the script, change the default fy=355.0 to fy=275.0 and run the seek again. The resistance falls to 649 kNm, so the span at U = 1 is shorter, at about 12.0 m. This time, the seek finds the span in two rounds, because one of the evenly spaced points in round two happens to fall within the tolerance. Changing the yield strength doesn't change the moments, so every point in the first round is cached from the previous seek, and only round two is solved.
Delete the ws Constant and, in its place, wire a Range of ws from 10 to 30 kN/m in 5 steps into the model, as we did in step 2. The button now shows โถ Seek L across 5 points. The spans found trace step 2's moment-limit curve, with MRdโ in place of 600 kNm. The script receives the moments at every sweep point at once and returns a utilisation for each one. The Seek then matches each utilisation to its own sweep point.
Wire the Seek's observed output into a plain Output as well. After a seek, the Output shows [20], or a similar number. This is a series of utilisations, one for each point the search evaluated, in the order the Chart plots them.
13.43, 13.62 (the straight-line guess), 13.71, 14.0, 14.29, 14.57
0.969, 0.997, 1.010, 1.053, 1.096, 1.140
13.62 to 13.71
3
13.64, 13.645 (the guess), 13.65, 13.67, 13.68, 13.70
0.999, 1.000, 1.001, 1.004, 1.006, 1.008
done
The seek finds L = 13.645 m, where U reads 1.000 within the 0.002 tolerance. There's one crossing, found after three rounds and 20 evaluations. The moment at that span is 837.8 kNm.
Round one is the same kind of sweep as step 5's, with eight points instead of seven. The utilisation rises from 0.34 to 2.15 and crosses 1.0 once, between 13.14 m and 14.86 m. In round two, the Seek solves five points spaced evenly inside that bracket. It also solves one more span, where a straight line through the bracket's two ends reaches 1.0. This straight-line guess, at 13.62 m, gives a utilisation of 0.997, which is 0.3% short, and the bracket narrows to 13.62 to 13.71 m. In round three, the straight-line guess through the new bracket gives a utilisation of 1.000, and the search stops.
The first guess falls short because the moment increases with L2. This makes the utilisation curve convex, so a straight line between two points on the curve lies above it and reaches 1.0 at a slightly shorter span. As a result, a third round is needed. For a result that varies linearly with the parameter, such as the deflection in step 1, the straight-line guess is exact, so the seek finishes a round sooner.
Hand check
We can use step 1's formula, with the resistance in place of the 600 kNm limit,
L=w8MRdโโโ=368ร837.8โโ=13.645ย m
compared with 13.645 m found by the Seek. Step 5's interpolated 13.62 m was 2.5 cm short, because it came from a straight line between two points on the parabola, and that line lies above the curve. The Seek's answer doesn't have this error, because its last round solved the beam at 13.645 m and calculated the utilisation there.
4.0 Limits on the signal wire
What the signal wire must carry
The signal wire must carry one value for each point in the round. If it carries a single number for a round of several points, or a series of the wrong length, the seek stops with an error that names the problem. It doesn't give a no crossing verdict.
A point whose signal has no value is skipped, in the same way as a point whose solve failed, and the verdict counts it. This kind of gap can come from an Expression's series, at a point that failed or where the formula has no value.
A script can't return a gap, though. A NaN in the series a script returns is an error that names its position (ValueError: U[3] is not a finite number). A point that failed upstream reaches the script as None, so a script that might receive one has to handle it. If a script raises an exception, the round ends with that error named.
Only the Seek's own signal socket may close a loop through the model. Any other wire from the output side of the model back to its input side is a cycle, and Structure Bench rejects it. The Seek documentation page sets out these rules in full.
5.0 What to take from this pathway
In this pathway, we've used a Seek to find the parameter value at which a result meets a target, where a sweep only gives the results at the values we set. With a Range beside the Seek, we drew limit curves. The arithmetic nodes and the Expression node did calculations on the canvas before and after the model, and the Script node did the calculations that needed Python. Finally, the signal socket let us base the search on a value calculated on the canvas.
Together, these let us answer a design question on the canvas, such as the span at which this section is fully utilised under this load. We didn't need to interpolate between results, or copy them into a spreadsheet. Here, the closed-form solution agreed with the Seek to within a millimetre, although a tolerance of 0.002 would have accepted any span within about 14 mm of it.
Now try to put what you've learned in this pathway into practice by expanding one of your own models. Pick a model you've already made parametric and choose the check it has to pass, such as a utilisation, a deflection limit or a bearing pressure. Write that check as a Script, then use a Seek to find the value of the parameter at which the check is just met. Finally, check the answer by hand.
This pathway has introduced some very powerful modelling tools. But they take some time to get familiar with. My best advice at this stage is to play with them. Ask yourself real analysis and design questions and see how you can build a study that answers them. You'll learn so much more this way - pathways are a great starting point, but that's all they are!
Now, if you're not sure what the input values actually are, for example the load magnitude or the real-world material strength, the question changes. Instead of asking at what value the check is met, you ask how likely it is to be met. That's the subject of the Monte Carlo and probabilistic modelling pathway.