Jump to content

CAS4Wiki

From Wikiversity
Plotting of graphs for a defined function with a Computer-Algebra-System.
Plotten of curve/trace in for CAS-commands based on Algebrite
CAS4Wiki Settings - Create a start-link for set of commands for Wikiversity learning resource

In this learning resource, a AppLSAC commands are loaded and processed in a Computer Algebra System (CAS). It can be used to integrate interactive exercises directly a Wikiversity learning resources. The AppLSAC is able to store and load the data into a JSON file that contains the CAS commands predefined for learners to experiment with.

Wikiversity-CAS-App: CAS4Wiki for Wikiversity-Learning Resources in Mathematics[1]
Start-Link - Plot: CAS4Wiki-Start-Link with 4 Plot commands
Start-Link - Derivatives and Gradient: Derivatives and Gradient

Aim of the Learning Resource

[edit | edit source]

This learning resource was created to accompany a lecture in which students were also required to perform interactive exercises in Computer Algebra Systems on paths in topological spaces while the learning resources are provided in Wikiversity with Wiki2Reveal slides (lecture/seminar). The workflow for CAS4Wiki together Wikiversity was designed to launch CAS4Wiki with a link from a Wikiversity learning resource. Pre-loading CAS4Wiki with a specific defined set of commands allows students to experiment with commands (i.e. changing and altering the commands to understand the theoretical background in Mathematics). FOR EXAMPLE.

  • (Gradient) in calculus with the calculation of partial derivatives and the gradient, which is necessary for understanding the gradient descent method.
  • (Computer Algebra System - Starter for Interactive Exercises) This learning resource helps you to create such predefined CAS4Wiki starters for specific Wikiversity learning resources in mathematics.
  • (CAS4Wiki and Wiki2Reveal) The predefined CAS4Wiki launchers should be able to be launched directly from the learning resource as well as from Wiki2Reveal slides with a link to show a demo during lecture. Because Wiki2Reveal slides themselves are generated directly (on-the-fly) from a Wikiversity learning resource, you only need a link embedding in the Wikiversity learning resource itself.
  • (CAS4Wiki command sequence creation) CAS4Wiki command sequences can be created as result of students exercise. These results should be saved by students from the CAS4Wiki-WebApp (format: JSON) so that these results can also be exchanged between students and lecturer as a result. This is also applicable for storing an intermediate result.
  • (Wikiversity Tools) This learning resource can be used as a template for the workflow to create Wikiversity tools as AppLSACs that support authors in creating and maintaining learning resources with dynamic data.
  • (JSON as a storage format for CAS4Wiki) this learning resource is a complete use case for the Application of JSON2Schema and the corresponding learning resource in Wikiversity and for a browser-only web application that can be used offline in a school network without an Internet connection. Use cases include.
    • when computer algebra may be used in schools for e-exams, but no internet connection is allowed. The generated JSON is then part of the exam deliverable.
    • For specific applications the CAS4Wiki could replace e.g. another open source CAS (like wxMaxima[2]) or could be used as a mobile end-user applications with no installation required. Furthermore the WebApp can be used locally on a local area network because of the software design that needs not remote servers to perform the CAS commands.
  • (CAS4wiki - Application in other Languages for Wikiversity) There are 3 main labels for predefined
  • Commands,
  • Functions and
  • Variables
The label in the JSON editor and on buttons can be changed according to the language of the Wikiversity Learning Resource. For a german learning resource these labels and the header/title for the set of commands can be changes in CAS4Wiki Settings. Commands sets for the german Wikiversity course would change these labels e.g. to:
  • Befehle,
  • Funktionen and
  • Variablen
These labels are stored in the JSON of the command lists. If someone exchanges a JSON e.g. with spanish labels or uses a CAS4Wiki-Startlink then also the translated labels will be changed in the CAS4Wiki editor. This assures that the Wikiversity course material and CAS4Wiki command set are presented in the same language.

Use-Cases of Wikiversity-Tools CAS4Wiki

[edit | edit source]

You can use CAS4Wiki by just starting the WebApp in your browser. No installation is required. As an AppLSAC it was designed as a support tool for mathematical learning resources in Wikiversity. The commands can be populated with a link in CAS4Wiki from Wikiversity and the learners/students can experiment with the commands to explore e.g. the plots and learn how to apply computer algebra in different other settings by executing, modifying and adapting the given commands in other applications. After going through the learning course you will be able:

  • as a lecturer or teacher: to create your own set of CAS4Wiki-Commands either as a JSON-file and save the commands on your local file system. The generated file is meant to be shared among students to play with the prepared commands in CAS4Wiki. On the other hand your students could share their results among each other. Your changes to a given set of commands are not stored on a server. The commands can be executed in your browser and but can be kept, by saving your work in a local JSON file for further use. You can test the modification of commands and then reload CAS4Wiki. If you want, you can download the CAS4Wiki-Tool as ZIP-file from GitHub from the URL https://github.com/niebert/WikiversityDoc/archive/master.zip and then you will be able to start the cas4wiki.html in your browser or share the WebApp in your local area network LAN. So this allows offline work with Computer-Algebra commands with your stored JSON-file. The JSON is prepared according to the content of the corresponding Wikiversity learning ressource.
  • as a student you can experiment with the given CAS4Wiki commands according to the recommendation of the corresponding Wikiversity learning resource. According to the learning activities, you may want to share your generated JSON-Datei with your teacher to show, how you solved a given learning task or learning activity among the group of students to share and discuss your resulty in the Computer Algebra System.

Name of the AppLSAC

[edit | edit source]

The AppLSAC created in this learning resource will be called CAS4Wiki because, as a web application, it is a computer algebra system (CAS) used for (4=fo(u)r=for) a wiki (Wikiversity learning resources) can be used. As AppLSAC, this encodes the command sequences as JSON file as input and is used by Wikiversity from the learning resources.

Example for the CAS4Wiki output

[edit | edit source]

With convex combinations one can represent curves in the . As a visualisation example, Bernstein polynomials with binomial coefficients are considered, which represent the curve in as convex combinations with vectors. The basic example here is for dealing with functions, which can then be used as a trace of the function for using diagrams in learning resources and how to embed the diagrams with a template in a Wikiversity learning resource.

  • If you have launched the AppLSAC in your browser, you can use this WebApp CAS4Wiki for updating function plots and experimenting with function terms in the Wikiversity learning resource to analyse the consequences of modifying the function term on the trace (i.e. image set of vectors in range of a function) or on the graph. You will be able to load and save the updated JSON as command sequences and also integrate these custom command sequences into a Wikiversity learning resource. The setting for the colors of the graphs and the plot sections regarding x, y and z axes can also be saved and shared in the associated JSON file, making not only the CAS4Wiki command sequences but the CAS4Wiki plots reproducible for all learners with the formatting information.
  • Plots can also be exported as an image file (PNG file) in turn integrated as a graphic into a learning resource by uploading this image file to WikiCommons.
  • If you would like to deal with the mathematical example topic first, you will find the topic first under Convex Combination. You will also see other options besides CAS4Wiki to provide interactive components as Geogebra files for Wikiveristy learning resources.

Learning example

[edit | edit source]

Geogebra: Interactive applet - Download:' Geogebra-File

  • First look at the above video on convex combinations in the plane.
  • The 3rd order convex combination can be represented with the two auxiliary points using the following Bernstein polynomial:

.

  • We will use CAS4Wiki in this example task to transfer the above example to 4 vectors in and plot the trace in .
  • Start the CAS4Wiki in your browser as AppLSAC. After your first start you will find a given set of default commands of CAS4Wiki/Algebrite you can play around with. Please feel free to change any commands in the given list of commands of the given pre-defined set commands. The set of commands are defined according to the CAS Algebrite set of commands to experience the features and the command set of Algebrite that is used inside CAS4Wiki.
  • Change the given set of commands in the CAS4Wiki wditor and export your modified set of commands with the SAVE-Icon on your local filesystem. You will find the download JSON as a list of your commands in your download folder of your browser with the JSON-filename commands4cas.json. This JSON file contains your modified set of commands in CAS4Wiki.
  • Reload CAS4Wiki in your browser and your WebApp contain again the predefined set of commands. Your the load icon to import your saved list of commands from your download folder back into CAS4Wiki and check if your modification of the command list is restored.

Execute CAS4Wiki Commands

[edit | edit source]
CAS4Wiki - Execute a Command - e.g. a plot3d command

The loaded CAS4Wiki commands are displayed after loading as JSON or with a CAS4Wiki-Startlink in the JSON editor. The CAS4Wiki commands are not executed after loading. If you want to execute a CAS4Wiki command select a specific command in the command list and press the Play/Execute button for the command in the command line editor Play Execute Button CAS4Wiki.

The plot in the image uses a defined function and plots the graph in CAS4Wiki with

 plot3d(g(x,y),x[-5,5],y[-3,8])

The domain for the plot is defined in the arguments of the "plot3d" command with and .

CAS4Wiki Command List

[edit | edit source]

The CAS4Wiki can load and save the list of commands in a JSON to exchange them between students or submit JSON to the teacher, if the students should solve a specific task in the Computer Algebra System. There are two options to share CAS4Wiki command list.

  • CAS4Wiki-startlink with encoded list of commands in the URL
  • JSON file with list of commands

The following section will show how to use the CAS4Wiki.

Default Set of Demo Commands for CAS4Wiki

[edit | edit source]

If your start the CAS4Wiki with the URL https://niebert.github.io/WikiversityDoc/cas4wiki.html you will get a default set of commands showing

  • plot commands and
  • commands for computer algebra

For specific learnings tasks in Wikiversity it makes sense to have some commands pre-populated, where the learner/student should play around with according to the learning objective. The following section shows how to use such a link in Wikiversity to use pre

[edit | edit source]

Use the following link to restore a predefined set commands in CAS4Wiki. The set of commands was defined for curve in loads Bernstein polynomials for a curve in which can be plotted with the CAS4Wiki by application of plotly Open Source library.

CAS4Wiki-Link for a curve in the threedimensional vector space

The link contains

  • 4 pre-definined vectors in Variables,
  • 2 pre-definined curves in with both definitions of functions/mappings and the convex combination of the Bernstein polynomials, that are defined with the following mathematical expression and
  • a title for the topic - in the link above you it is "Convex Combination".

CAS4Wiki Kurve im dreidimensionalen Raum

Plot Result

[edit | edit source]

You can execute a given command by pressing on the Execute/Play-Button (black triangle Play Execute Button CAS4Wiki - according to selected icon in CAS4Wiki). For the corresponding commands of plots the curves in the selected plots will appear above the command. The plots can be rotated an inspected from different perspectives to understand the spatial shape of threedimensional curve.

Plot convex combination

[edit | edit source]

The objective of this section is to create your own set of commands for a learning resource and generate a CAS4Wiki startlink

CAS4Wiki Language Settings - Use in Wikiversity with other languages

  • The settings menu can also be checked which commands are encoded in the startlink. This settings check is included in CAS4Wiki for transparency to visualize the set of commands encoded as JSON in a URL (CAS4Wiki startlink)

JSON File for Commands

[edit | edit source]

The following JSON defines the command list for a the CAS4Wiki The JSON includes

  • List of commands,
  • List of pre-defined functions,
  • List of pre-defined variable - e.g. are threedimensional vectors,
  • Title for the CAS4Wiki command list e.g. commands for "Convex Combination"
  • Title/Label for Commands e.g. for german Wikiversity courses "Befehle" - title/label can be set for predefined functions and variables as well according to language settings (set titles in settings in CAS4Wiki)
{
 "castype": "maxima",
 "title4cas": "Convex Combination",
 "title4commands": "Befehle",
 "title4functions": "Funktionen",
 "title4variables": "Variablen",
 "commands": [
   {
     "cmdtitle": "Plot curve2d() - Spiral",
     "cmd": "curve2d([t*cos(t),t*sin(t)],t[0,16],color[green],linewidth[3])",
     "result4cmd": "curve2d: curve2d(t)=[t \\cdot cos(t)  ,t \\cdot sin(t)  ] \\quad "
   },
   {
     "cmdtitle": "Convex Comb - K(t)",
     "cmd": "curve3d(K(t),t[0,1],color[blue],linewidth[10])",
     "result4cmd": "curve3d"
   },
   {
     "cmdtitle": "Plot curve3d - cur(t)",
     "cmd": "curve3d(cur(t),cur(t)*2,t[0,18],color[blue],linewidth[10])",
     "result4cmd": "curve3d: cur(t)=[cos(t),sin(t),t] \\quad curve3d(t)=[cos(t),sin(t),t]   \\cdot 2"
   },
   {
     "cmdtitle": "Plot3D  g(x,y)",
     "cmd": "g(x,y):=cos(x)+sin(y)\nplot3d(g(x,y),x[-5,5],y[-3,8])",
     "result4cmd": ""
   }
 ],
 "casfunctions": [
   {
     "name": "g",
     "args": "x,y",
     "def": "x^3+y^2"
   },
   {
     "name": "cur",
     "args": "t",
     "def": "[cos(t),sin(t),t]"
   },
   {
     "name": "K",
     "args": "t",
     "def": "v1* (1-t)^3 +v2*3*(1-t)^2*t+ v3*3*(1-t)*t^2 +v4*t^3"
   }
 ],
 "casvariables": [
   {
     "name": "v1",
     "def": "[3,4,5]"
   },
   {
     "name": "v2",
     "def": "[5,4,-3]"
   },
   {
     "name": "v3",
     "def": "[-6,-6,6]"
   },
   {
     "name": "v4",
     "def": "[-3,-7,0]"
   }
 ]
}

Background Information - Software Development for Wikiversity

[edit | edit source]
  • (JSON) Learn JSON as a JavaScript object notation to store and load data in CAS4Wiki.
  • (JSON Editor) Learn about web-based applications (WebApps) that can be used to load, store, and modify data in a JSON data container. In this case the commands, function and predefined variables are stored in the JSON editor.
  • (AppLSAC) Learn more about AppLSAC|AppLSAC web-based applications that do not require Internet connectivity and run in your browser as a runtime environment.
  • (JSON Schema)' Learn more about JSON schema - see JSON-schema-step-by-step-tutorial[3]
  • (Preview of Graph[4][5]) Previewing the data in the graph should be possible so that the graph can be reviewed without having to render the graph in Wikiversity or Wikipedia. OpenSource libraries in javascript need to be identified that allow rendering of the data in the graph (e.g. MorrisJS or Plotly for Javascript]).
  • (Computer Algebra System - CAS) In the CAS4Wiki the Computer Algebra System "Algebrite" is used for processing the commands.

See also

[edit | edit source]

Refernences

[edit | edit source]
  1. CAS4Wiki (2022) Bert Niehaus, Wikiversity Support Tool as WebApp for Computer Algebra and Plotting in Learning resources - URL: https://niebert.github.io/WikiversityDoc/cas4wiki - ZIP-File of AppLSAC: https://github.com/niebert/WikiversityDoc/archive/refs/heads/main.zip - Git Repository: https://github.com/niebert/WikiversityDoc/ (accessed 2023/01/06)
  2. wxMaxima (2022) Open Source Computer Algebra System - URL: http://wxmaxima-developers.github.io/wxmaxima/download.html (access 2022/12/01)
  3. Web Portal JSON Schema: Getting Started Step-By-Step (en) URL: https://json-schema.org/learn/getting-started-step-by-step. html 2020 - Access Date: 2020-08-10}
  4. Olly Smith (2013). "Javascript Graph Rendering Library morris.js". morrisjs.github.io. Retrieved 2020-10-05.
  5. "Plotly for Javascript". plotly.com/javascript/. 2023. Retrieved 2023-02-05.