Change Log

2024-3-2

Added

New arc object

We have added two new gradient fill options for many of the Tychos objects.

The radial gradient and linear gradient objects are used as fill parameters for the following objects:

  • circle

  • rectangle

  • ellipse

  • arc

  • poly_line

Check out our Python API or our MathJs API for more information on how to use the new gradient fills.

New Update Clone Goals Button

Teachers can now update the goals in student cloned scenarios with the click of a button. This allows a teacher to adjust goals (by adding, removing, or editing them) after students have already cloned the teacher's scenario and have started working on their clone.

We know that you don't always get those goals written correctly, and then it was a real pain to have the students have to re-clone your scenario once you found the mistake...now you can change your goals, and then click a button (see below) and the new goals are pushed to all existing clones.

Fixed

Bugs

We fixed a few bugs in this release:

  • Graph, Table and Bar Chart tools were not showing up in the main World view. They are now viewable.

  • In the Python coding interface, The Toggle, Input, and Button tools were breaking if the input was None or the binding was None.

  • When a tool had an error due to some setting value being incorrectly input, the app went into an error state, but the tool disappeared, and so the user couldn't correct the error in the tool. The tools now are viewable, even when the app is in an error state.

  • Menus (in Python) were not filling in the values with choices if the values were not specified, which they should have been. Also, values could ony be numerical, but now they are strings. NOTE: If you want a value to be interpreted as a numeric value, you will need to cast it - e.g. int(my_menu.value)

2024-1-15

Added

New Arc Object

We have one more object that you can create for your scenarios - the arc! In MathJs or Python, you can now create an elliptical arc.

The start and end parameters specify the starting angular position of the arc (in radians) and the ending angular position of the arc along an elliptical curve. Just like the ellipse object, arc objects also are defined by a center position as well as a size that identifies the length of the major and minor axes.

There are also three options for drawing the arc object to the screen. use the mode parameter. You can choose "chord" mode, which will draw a connecting line from the starting point of the arc to the ending point of the arc, if the arc has a border. The "open" mode does not draw the connecting line. Finally, the "pie" mode creates a "pie slice" from the arc. You can also set the no_fill parameter so that the arc is not filled in with a color.

Check out our Python API or our MathJs API for more information on how to create arcs.

New Python Science Libraries

We have added some new Python libraries to Tychos that are now loaded by default so that you can easily import them into your scenarios. Here is a listing of all the libraries that you can now import:

You can also import many of the standard Python packages that are included in the standard installation of Python, like math, random, datetime, etc.

Changed

Step Rate Setting

In the Settings Pane, we have changed out the slider which set the value of your dt variable (the delta time for each step in your Calculations) to a numerical input defining your step rate. So when you enter a value of 100, this means that Tychos will set your dt value to 1/100 or .01 seconds. You can now enter a rate value of 1000 or even higher, but keep in mind that the simulation will most likely run in real time at a much slower rate because it take time for the code in Calculations to be executed. So setting the rate to a high value (>50) will make your simulations more accurate, but they will slow down.

Additionally, the screen refresh rate is about 50 fps, so additional steps won't be rendered to the screen. If you use the step button, you will actually render these steps in the World view.

New Align Property for Widgets (graphs, meters, etc.)

All widgets now have an align property so that you can align them to either the left or right side of the screen. This allows for more control over how your widgets appear on the screen when the scenario is loaded.

Fixed

Bugs

We fixed a few bugs in this release:

  • Python scenarios were not rendering arrow components. They should be visible now when you set the show_components to True.

  • The suffix value in the meter() widget was not displaying. This has been fixed.

  • When a Goal was deleted, it's associated "goal state" (FAIL/PASS) was not being deleted as well, so those orphaned goal states were visible in the Scenarios Index page. They will be removed as soon as the scenario is loaded by Tychos, removing any orphaned goal states.

2023-9-30

Added

New Button

You can now add a button UI control that allows you to hook into the button's click event. The button is styled like a classic video game from the 1980's, because we love those games! You can make the button any color you like as well!

To learn more, see our API for adding a button to your scenarios.

Changed

New Graph and BarChart UI Controls

We are now using the amazing Plotly graphing library to render our graphs and bar charts in Tychos. There are now some nifty tools for downloading images of the graphs and bar charts, as well as zooming into a region of the graph. Just hover your mouse over the graph or bar chart to see these tool buttons display in the top right corner of the graph.

Upgraded to Python 3.11

We upgraded to Pyodide 0.24 which runs on Python 3.11. This has made Python significantly faster - approximately x 1.25.

2023-8-26

Added

Hide or display the grid

You can now hide the grid in your scenarios with just the click of a checkbox.

Remove objects

Objects can now be removed from the World using a simple API call remove that all objects support.

Changed

We significantly changed the Console Hack Panel so that it now allows for input, much like a REPL. You can execute lines of code, even updating objects in the simulation. The Python Console also allows users to use the help() command to get some help with the Python API.

Fixed

Errors are now reported to the Console rather than to the World view, reducing clutter, and making the errors more readable. Error handling in general has been improved throughout Tychos.

We also made various speed/efficiency improvements so that scenarios with multiple objects run much smoother.

2023-4-28

Changed

We enhanced some of the collision detection functions in our Python and MathJs API's. Here is a list of the changes:

  • Collisions can be detected for circles and rectangles that are rotated around an axis besides their own center points.

  • Lines have been added to object detection.

  • Using either get_intersections in the Python API or getIntersectionPoints in the MathJs API returns the points where the object boundaries have intersected.

2023-4-20

Added

Tables are back! Sorry that we took tables away, we had an issue with them, and we wanted to re-design them anyway. Now rather than the table being hidden in the Hack Panel, you can now add them as a draggable, resizable widget that floats above your scenario.

You can add a table by defining a new table object in your Python or MathJs code or you can add a table through the Tools menu. Please check out our Python API or our MathJs API to learn how to do this programmatically.

You can learn more about how to use tables in your scenarios by watching this tutorial video.

Added

You can now upload a comma separated values (CSV) file into your Tychos session and then reference that data within your scenario. To do this, you simply go to the Settings pane of the Hack Panel, and then click on the Upload CSV button and choose your CSV file.

Keep in mind that we don't save this file to our server, so if you refresh your browser, the file will need to be uploaded again in order to reference the data in file.

2022-9-25

Changed

degrees and radians functions fixed for MathJs

Oops! We accidentally switched these calculations in the MathJs API. The functions degrees and radians have been fixed. The old aliases for these functions have also been brought back so as to be backwards compatible - rad_to_deg and deg_to_rad.

Changed

New "Tour" video.

Many of our current videos are very outdated, and we are trying to get those updated as time permits. The first one to be updated is our front page "tour" video. Finally...ugh.

2022-8-15

Added

Python Coding Interface Added!

We have added Python as the default language for coding your Tychos simulations! This is a huge change to Tychos, and if you are used to writing your scenarios in MathJs, don't worry, you still can! We have made it so Tychos will create simulations using either of the languages.

Python is such a great language with so much support and interest in both the scientific world and the academic world, that we decided to add Python and then make it the default language.

To switch between languages, you simply choose it in the Settings tab, from the Coding Language drop down.

We are using Pyodide as our Python in the browser implementation. Pyodide allows Tychos users to write scenarios using Python using the standard library, but you can also import many other modules, such as numpy and pandas!

We think that the power of Python, as well as the flexibility of writing code that might match what many users are already familiar with will be a huge improvement in writing Tychos simulations. All the standard Tychos objects still exist, and we have tried to maintain much of our Tychos API, with only minor changes to match the style and syntax of other popular Python libraries and tools such as VPython.

Please note there are some Python modules that are not compatible with Pyodide, and therefore Tychos. Please refer to this page to learn more.

Much of the interface has not changed, but there are some differences, such as the addition of a Console that displays the stdout.

2022-5-10

Added

New Tools!

We have added a number of new tools to the tool menu that you can add to a scenario for analyzing data or for accepting a user's input. These are essentially identical to the components that can be added to a scenario by writing code, but now you can add them directly through the Tools menu.

The tools that can now be added are: Ruler, Timer, Meter, Gauge, Graph, Bar Chart, Toggle, Slider, Input, Menu.

You can also edit any of these tools properties by clicking on the little "gear" icon on top left side of the tool's panel, which will reveal that tool's different settings.

To bind the tool to a variable in your scenario, you just need to reference that variable in the Binding setting. The tool will then display the value of the bound variable, or if its an input tool (Toggle, Slider, Menu, Input) it will update that variable's value in your scenario.

For tools that are used for displaying values, you can also have Tychos evaluate an expression. For example, it the image below, the graph plot sets are evaluated using math expression for the y axis values: t^2 and sin(2*t)

Which results in this graph:

2022-3-9

Added

New Borders and Line, Arrow Styling

Circles, Rectangles and Ellipses can now be displayed with borders. These borders can also be displayed as either the default solid border (style: "none") or dashed (style: "dash") or dotted (style: "dot").

Lines as well as Arrows can also now be styled in the same way.

2022-2-28

Added

New BarChart widget

Now you can add a bar chart for visualizing data in your simulations. BarChart is a chart of data that is displayed as a set of bars representing an array of data values. Each BarChart that is created will appear on the right side of the World View.

# Create the bar chart
bc_energy = BarChart({title:"Energy Bar Chart", min:0, max:500})
# Set the data for the bars
bc_energy.setData([x,y,z,w]) # Where x, y, z, and w are numerical data values
# Set the labels for the bars
bc_energy.setLabels(["KE", "Ue", "Ug", "TE"])
# Set the colors for the bars
bc_energy.setColors(["red", "blue", "green", "black"])

2022-1-23

Added

New Ruler Tool

We have added one new measuring tool to Tychos so that you can measure the distance between two points on the screen as well as the angle. You will find this new tool in a new menu that we also created where we intend to put some other tools soon!

The ruler tool measures length and angle.

2022-1-12

Changed

It's been quite some time since we added anything new to Tychos. That's because we have been busy working on a complete rewrite of our codebase as well as...well, you know, in a pandemic.

Most of what we have been working on will be unnoticeable for our users (hopefully!) but it gives us some added flexibility as we move forward with some new features that are in the pipeline.

Added

PolyLine object

We have added one new object that we think you will like - the PolyLine object. The PolyLine object draws a series of connected lines between a given set of points. This object can be used to represent a complex path or a shape other than a circle or rectangle.

Example:

star1 = PolyLine({stroke: 3, style:"dash", fill: true, opacity: .2, color: "blue"})
star1.setPoints([[0,75-200], [379-350,161-200],[469-350,161-200],[397-350,215-200], [423-350,301-200], [350-350,250-200], [277-350,301-200], [303-350,215-200], [231-350,161-200], [321-350,161-200], [0,75-200]])
star2 = PolyLine({stroke: 2, style:"none", color: "green"})
star2.setPoints([[0,75-200], [379-350,161-200],[469-350,161-200],[397-350,215-200], [423-350,301-200], [350-350,250-200], [277-350,301-200], [303-350,215-200], [231-350,161-200], [321-350,161-200], [0,75-200]])
star2.translate([100, 100])
star3 = PolyLine({stroke: 3, style:"dot", color: "red"})
star3.setPoints([[0,75-200], [379-350,161-200],[469-350,161-200],[397-350,215-200], [423-350,301-200], [350-350,250-200], [277-350,301-200], [303-350,215-200], [231-350,161-200], [321-350,161-200], [0,75-200]])
star3.translate([-100, 100])

New createPoints function

The new createPoints function allows you to create a certain number of [X, Y] points based on a mathematical expression. You define the minimum and maximum value for the domain, as well as the "step". The range is then evaluated based on an expression.

The expression has to be a string that can be evaluated by the Tychos engine as a function of "x":

points = createPoints(-10, 10, .1, "sin(x)")

This can be useful for a number of things such as creating a set of points for a PolyLine object (see above):

sinewave = PolyLine({stroke: 2, fill: false, style: "none", color: "blue"})
sinewave.setPoints(points)

2020-12-15

Changed

Bug Fix: User control widgets now update if scenario is not running

We have fixed a problem where the Input, Menu and Slider user control widgets were not allowing you to update their values unless the scenario was running. It is now possible to update the widgets, and then press the "play" button and the values are all immediately captured from the widget in the first frame of the simulation.

Input Widget now has min, max and step attributes

The Input widget now allows you to define a limit to the maximum and minimum value that it will accept in the input as well as a step value.

in_x = Input({title: "X input", min:0, max:5, step:.1})

You can override the step value by just inputting the value from the keyboard as opposed to clicking the step buttons, but the maximum and minimum values can only be overridden in the code.

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.

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.

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.

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

Last updated