Change Log

2020-10-20

Added

New Circle and Rectangle Objects

We decided to add a new Circle and Rectangle object that are meant to replace the Particle and Block objects. We did this in order to reflect a more general use for these objects. This way, Circle and Rectangle objects reflect just their visual nature, not a functional nature. A circle could represent a particle, but can also represent a wheel, a ball, etc. A rectangle could be a block, but it could also be a table, the ground, a ramp, etc.

New Circle Class

# New Circle
c = Circle({pos: [0,0], radius: 10, color: "red"})

New Rectangle Class

# New Rectangle
r = Rectangle({pos: [0,0], size: [10, 10], color: "purple"})

We have not removed the Particle and Block objects, so all your past scenarios will work. We just think, moving forward, these new object names will better represent a more generalized definition.

Please check out the Circle and Rectangle classes to learn how you can start using these objects in your scenarios.

New Arrow and Line Objects

You have been able to draw arrows and lines on the screen, but these were not treated as objects in their own right.

We decided to change that, and now Arrows and Lines are objects, much like the other objects in Tychos.

New Arrow Class

# New Arrow
arrow = Arrow({pos: [0,0], size: [10, 10], color: "red", components: true})

New Line Class

# New Line
line = Line({pos: [0,0], pos2: [10, 10], color: "purple", thickness: 2})

We have not removed the drawArrow or drawLine functions, so all your past scenarios will work. We just think, moving forward, these new objects will better represent a more generalized definition.

Please check out the Circle and Rectangle classes to learn how you can start using these objects in your scenarios.

New Object Constructors For All Objects and UI Widgets

Every object and user interface (UI) widget now can be initialized using a more easily readable and decipherable name:value input. This allows you to identify all the attributes with a name value pair as opposed to a list of comma separated arguments.

{name1: value1, name2: value2}

For example, before when creating a Spring object, you had to write this:

# Old API
s = Spring([0,0], [100, 0], "black", 5, 10, 1)

Which forced you to know the correct order of the parameters. You can now input a named/value pair in any order:

# New API
s = Spring({color:"black", pos2:[10, 10], pos:[0, 0], coils:10, thickness:1, width:5})

Although it does mean that there is more to type, you don't need get the order correct, and the name allows you to identify which parameter is which. Any missing parameters will just be replaced by default parameters for those objects and UI widgets. Please check out our updated Language Reference for more details.

New Input and Menu User Interface Widgets

We have added two new UI widgets to Tychos; the Input widget and the Menu widget. These will add additional interactivity options to your simulations.

Input widget and Menu widget

The Input widget:

To add the widget to your scenarios, you only need one parameter title:

# In Initial State
in = Input({title:"X Velocity"})

To access the value in the Input widget, you just need to do this:

# In Calculations
buggy.v[X] = in.value

The Menu widget:

To add this widget to your scenarios, you need two parameters, the title and an array for choices and an optional third array argument values that represent the values corresponding to the choices, though if you don't supply these, the choices array is used in place of values:

# In Initial State
color_menu = Menu({title:"Color", choices: ["green", "orange", "blue"]})

Top access the chosen value, you simply type this:

# In Calculations
buggy.color = color_menu.value

New Attributes for All Objects

We have been making some important changes to all the Tychos simulation objects. We have added these three attributes to every object:

  • opacity: A value from 0 to 1 (default) that sets the opacity level of the object: 0 = transparent, 1 = opaque.

  • visible: A value of true (default) which means the object is visible, or false, which means the object is invisible.

  • motion_map: A flag (true or false) for activating the Motion Map for this object.

Motion Map Maximum Strobe Adjustment

Motion maps are now activated by an attribute flag for each object in your simulation (see above). If an object's motion_map attribute is set to true, then a motion map will be displayed for this object.

Additionally, we have added a new setting in the Settings Panel where you can set the maximum motion map strobe images that will be displayed. This sets the number of motion map strobe images per object, so if you set this to 10, then each object in your scenario that has their motion_map attribute set to true, will display a maximum of 10 strobe images.

Set Max. Strobe Images to reduce clutter and maximize performance

Limiting the number can be helpful for two reasons. It can reduce clutter on your screen and improve performance/speed of your simulation.

Changed

We want to apologize because we have noticed that there has been an inconsistency in how angles have been dealt with in Tychos. Object angles of rotation tended to be in degrees, while many of the functions in Tychos return angles in radians. That required annoying translation.

So we decided to standardize all angle values to radians. You can still translate between radian values and degree values using our helper conversion functions:

degrees(angle): takes a radian input angle and returns the angle in degrees.

radians(angle): takes a degree input angle and returns the angle in radians.

This may affect existing scenarios that have used functions that have by default expected degree inputs or returned degree outputs.

2020-7-17

Added

Goal Status Added to Scenarios Page

The Scenarios page now displays the goal status of each Goal in the scenario. This is true for your scenarios as well as the scenarios of anyone who clones your scenarios. If you are a teacher, this means that you will be able to now easily see your students' progress.

You can move your mouse over the green "check", red "X" or grey "?" to get a goal description, making it easy to see the goal associated with the goal status.

Hover your mouse over the goal status to get a

When Tychos detects a change to the goal status in a scenario, the user can update that new goal status by saving the scenario. If they don't save the scenario, the goal status will not be updated.

A "?" status indicates that the goal has not been tested because the goal when condition has not been met. For more details, please see Writing Goals.

2020-3-19

Added

Frame History

Tychos now provides a way to access all the variables defined in the simulation at any frame. When writing goals it is often useful to compare a variable's value from one point of the simulation to another. For example, you might want to check if a Particle has moved, or accelerated. You can now do this because all your variable values are stored for each frame of the simulation.

To access a frame, you can simply type:

frame(10)

This captures all the variables values at frame 10. This is essentially a snap-shot of the simulation at that frame. To access an object and its properties (for example, the position of a particle) you simply use the "dot" notation:

# Access a Particle's (called "puck") position at frame 10
frame(10).puck.pos

This allows you to compare attributes of various objects or variables from one frame to another. So for example we can test to see if the "puck" particle has moved a certain distance by a specified time:

In this case the Goal is:

  1. Description: "Move the particle a distance of 10 from the origin after two seconds."

  2. When Condition: "t == 2"

  3. Victory Condition: "distance(frame(0).puck.pos, puck.pos) == 10"

The victory condition in this case calculates the distance between the position of the "puck" particle's position at frame 0 and the current position of the "puck" particle when the time is 2 seconds.

You could also use frames to test if a particle is moving in a specific direction:

# Is the puck moving in the positive X direction?
frame(1).puck.pos[X] > frame(0).puck.pos[X] >

We think this is a great improvement to writing better Goals, and we hope you like it.

Some New Useful Functions:

We have added some new useful functions. Here is a list of those functions and briefly what each one does:

  • between(value, min, max) : This function allows you to see if a value is between a minimum value and a maximum value. It is exclusive.

  • constrain(value, min, max): This function takes a value and then constrains it to a minimum value or a maximum value.

  • perpCW(vec): This function returns a two dimensional matrix representing the clockwise perpendicular vector of the given vector.

  • perpCCW(vec): This function returns a two dimensional matrix representing the counter-clockwise perpendicular vector of the given vector.

2020-2-28

Changed

Collision Functions

We have greatly enhanced two functions for helping model collisions. Collision detection and resolution are typically quite difficult for students to program. We have added the ability to detect as well as assist in the modeling of collision resolution much easier. The functions and how they have been enhanced are listed below:

  • hasCollided(source, target): This function takes two objects (Particle or Block) as its arguments and then returns true or false if the two objects are overlapping.

  • getIntersect(source, target): This function returns a two dimensional matrix representing the minimum translation vector (MTV) that would be needed to separate two objects when they overlap. This can be used to simulate collision forces based on the magnitude and direction of the MTV.

For some good examples of how these functions can be used to model realistic collisions, check out these demonstrations:

General Download Speed Increases

We have made some significant improvements in load times for Tychos when you first visit the site due to utilizing some caching and compression technologies. We hope you appreciate the faster loading times!

2020-1-13

Changed

Moved Tychos servers

We have moved Tychos.org to different servers to improve reliability and monitoring. Tychos was unavailable for half a day—we apologize for that. Now that we have created this change history for Tychos, we will announce maintenance issues here.

2020-1-03

Fixed

Settings Pane crashing for some scenarios

Some scenarios were crashing when the Settings pane was opened. We found the problem and now all scenarios should have an accessible Settings pane.

2019-11-25

Added

Hide/Show Panes:

Teachers can now hide different panes in order to more finely control access to different aspects of scenarios. In the Settings Pane, there is now an Access sub pane that allows you to show or hide one of the Hack Panel's panes:

2019-11-9

Added

Labels:

You can now add a Label object to your simulations. This gives users the ability to add and then animate text in the Tychos world. You can create text in any RGB color and define its size and position: myLabel = Label(position=[0, 0], size=[100, 100], “text”, “green") You can then rotate the text as well: myLabel.rotate(PI/4) Particle and Block objects can also be given a text labels. This is similar to the Label object. particle.addLabel(text="Hello", color="green") To learn more, check out our documentation here: https://docs.tychos.org/docs/learn/language-reference-api#label

Some New Useful Functions:

We have added some new useful functions. Here is a list of those functions and briefly what each one does:

  • stop(test=false) : Allows you to stop the simulation if a condition is met. The input can be any logical statement that can be evaluated to true or false.

  • hasCollided(p1 = Particle, p2 = Particle): This function takes two Particle objects as its arguments and then returns true or false if the two Particles are overlapping. This function only works with particles at this time, but we plan on building in more sophisticated collision detection for blocks too!

  • getIntersect(source, target): This function returns a two dimensional matrix representing the minimum translation vector (MTV) that would be needed to separate two Particle objects when they overlap. This can be used to simulate collision forces based on the magnitude and direction of the MTV.

  • polar(radius, angle, units=”rad”): This function is a utility function for quickly defining a 2d vector in polar form. It takes two required arguments, the scalar angle, and the scalar radial length. You can optionally include a tag of “deg” or “rad” to identify the angular units. The default value for units is “rad” for radians.

Code Presentation Mode

In the Settings Pane, you can now choose a new code color scheme that is better for presentation. Besides these changes we have added some other UI enhancements like better tooltips for the output gutter in the Initial State pane and the Calculations pane as well as a more organized Settings Panel. We hope you like the changes, and we are always looking for feedback and ideas on how to make Tychos better. A huge thanks to all the users that have contacted us and given us some great ideas!

Changed

Graph Enhancements

We have added some new enhancements to graphs:

  • Graphs are now resizable so that you can make them larger or smaller on the screen.

  • You can alternatively “roll” up the graph into the panel title bar.

  • We have added tooltips for the data points in the graphs.

2019-8-19

Added

Data Output Table:

This is has been a feature that we have wanted to add for quite some time, and we have an initial version ready for you! With just a few lines of code, you can now create a data table for displaying variable values. This can be really helpful for recording a history of the simulation. We think this is a crucial tool for helping students connect the code they write to the simulation animation. You can create a data table by setting the columns in the Initial State Pane like this:

table.setColumns(["column1", "column2", ...])

Where the array of strings "column1" and "column2" would be the table column headers. You must have a table with at least one column, but you can have many more. Then you can record a new row in the table using this command in the Calculations Pane:

table.addRow([val1, val2, ...])

Where the array of values for example - val1 and val2 - could be any variable values you would like to record. The array of values must have the same number of values as columns in the table.

Mouse Interactivity

You can now get the position of the mouse mapped to the simulation extents. This allows you, for example, to build interactive simulations where Particles or Blocks can respond to the mouse position. To do so, you simply just need to reference the mouse position like this: mouse.pos This will return the mouse position within the scenario coordinate system. We have also added the ability to detect “mouse over” events. The following function allows you to test if the mouse is over a Particle or a Block:

# Where p is a Particle, but could be a Block too!
mouse.is_over(p)

Here is a demonstration to check out these the new mouse interaction features:

https://tychos.org/scenarios/nQqTE7