SystemModeler in Education

Jan Brugård, janb@wolfram.com
Patrik Ekenberg, patrike@wolfram.com

Join the Conversation #WolframTechConf

The Challenge

Need to teach advanced concepts in short time

Taking short-cuts

Not reaching the desired level

Why are teachers not using modeling and simulation?

Limited experience among teachers

No time to learn new software

Software needs to be intuitive

Our Approach

Contracted two interns from different Master of Science Programs

Talked to professors and the students to identify challenges

Suggest solutions to the professors

Give the student a two day crash course in SystemModeler

Let them develop supportive material using SystemModeler

Test this on the professors

Refine and implement

Bioengineering at Linköping University

Background

Linköping University

Biochemistry course

The problem

Complexity was not sufficient for courses down the line

Concepts not applicable in master level

Concepts not applicable in real life

The Course Today

diagram=WSMModelData["SystemModelerInBiochemistry.EnzymeReaction"]

Traditional Learning

Concentrations over time

WSMPlot["SystemModelerInBiochemistry.EnzymeReaction"]

Different parameter values

WSMPlot[WSMSimulate["EnzymeReaction",WSMParameterValues->{"kCat"-> #}],"enzyme.c",
PlotRange->All,
ImageSize->Medium,
PlotLegends->Table["kCat = "<>ToString[v],{v,#}],
PlotStyle->{
Directive[Dotted,ColorData[97][4]],
Directive[Dashed,ColorData[97][4]],
Directive[ColorData[97][4]],
Directive[DotDashed,ColorData[97][4]]
}]&@
{1,5,10,20}

Needed

Knowledge of dynamics

Network behavior

Tackling the Problem

Emil Arkstål

Two day SystemModeler and Mathematica crash course

Narrowed down what was missing in the biochemistry course

Implementation

Implemented demonstrations for the students on different biochemical pathways

Created student assignments

Example — Parameter Changes

diagram=WSMModelData["SystemModelerInBiochemistry.EnzymeReaction"]

Students can set the parameters themselves, evaluate and immediately see the result

Decide which parameters to change

WSMPlot[WSMSimulate["EnzymeReaction",WSMParameterValues->{"kCat"-> #}],"ComplexFormation",
PlotRange->All,
ImageSize->Medium,
PlotLegends->Table["kCat = "<>ToString[v],{v,#}]]&@
{1,5,10,20}

Example — Interactive Models

Interact directly with the simulations

Gain the intuition needed to understand the system

diagram

plotVars={"substrate1.c","product1.c","complex.c","enzyme.c"};
params={"kOn","kOff","kCat","kNonCat"};
paramPlot=plotVars/.WSMLink`Library`ParametricWSMSimulate["EnzymeReaction",plotVars,{0,20},params,Method->{"NDSolve",AccuracyGoal->6,PrecisionGoal->6,InterpolationOrder->1,Compiled->{Automatic,CompilationTarget->"C"}}];
Manipulate[ListLinePlot[(#[kOn,kOff,kCat,kNonCat]&/@paramPlot),PlotLegends->{
"Substrate",
"Product",
"Complex",
"Enzyme"
},
PlotRange-> {{0,1},{0,1}},ImageSize->Medium,AxesLabel->{"Time","Concentration"},Ticks->None],
{{kOn,10,"Binding Reaction (kOn)"},Row[{Slider[#,{0,20}],Spacer[5],#," mol/s"}]&},
{{kOff,1,"Dissociation Reaction (kOff)"},Row[{Slider[#,{0,10}],Spacer[5],#," mol/s"}]&},
{{kCat,10,"Catalytic Reaction (kCat)"},Row[{Slider[#,{0,20}],Spacer[5],#," mol/s"}]&},
{{kNonCat,0.0001,"Non-catalytic Reaction (kNonCat)"},Row[{Slider[#,{0,10}],Spacer[5],#," mol/s"}]&}]

Example — Networks

diagram

Stepping board to learn biochemical networks

Students gets models that they can further expand upon

Modify or create their own

Example — Bigger Networks

Students takes what they learn and develop their own models

Model expanded from the enzyme reaction

atcase=WSMModelData["SystemModelerInBiochemistry.ATCaseModel"]

First step of the synthesis of pyrimidines

Models are no longer only concepts, real life applications

The Verdict

Wants to expand this to multiple courses

CDIO Sunlight Simulator Project at Linköping University

Background

Linköping University

Undergraduate (Applied Physics and Electrical Engineering)

Goal — Implement a sunlight simulator with LED arrays

The simulator should be possible to use for research after improvements.

Setup

LED matrix, 8x8 LEDs

Representing 16 different wavelengths with 4 diodes per wavelength.

DAQ Cards

LabVIEW

Measurement equipment

...

The Course Today

Design

The students designed an the electrical circuit

Sent for review to the course assistant

Implementation

They were told they had made a great job, but... the world is not ideal!

New circuit supplied by the course assistant

The students implemented this

The problem

They were left without understanding the non ideal effects

Tackling the Problem

Alexander Näs

Two day SystemModeler and Mathematica crash course

Discussion on how non-ideal effects could be illustrated

Implementation

Implemented several demonstrations illustrating e.g. non-ideal effects

Created student assignments

Example — Non-ideal Effects on Operational Amplifiers

Needs["WSMLink`"]

Ideal inverting amplifier

WSMModelData["OperationalAmplifiers_Assignments.IdealOP"]

Manipulate[
WSMPlot[
WSMSimulate["OperationalAmplifiers_Assignments.IdealOP",
WSMParameterValues->{"R1.R"->R1*10^3,"R2.R"->R2*10^3}],
{"stepVoltage.v","outp.v"},
PlotRange->{Automatic,{-15,1}},ImageSize->Large,PlotLegends->Automatic
],
{{R1,10,"Input Resistance (R1)"},Row[{Slider[#,{1,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
{{R2,50,"Output Resistance (R2)"},Row[{Slider[#,{10,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
ContinuousAction->False,SaveDefinitions->True
]

Non-ideal effects

WSMModelData["OperationalAmplifiers_Assignments.NonIdealOPStep"]

Manipulate[
WSMPlot[
WSMSimulate["OperationalAmplifiers_Assignments.NonIdealOPStep",
WSMParameterValues->{"R1.R"->R1*10^3,"R2.R"->R2*10^3},Method->{"Tolerance"->10^-7}],
{"stepVoltage.v","outp.v"},
PlotRange->{Automatic,{-15,1}},ImageSize->Large,PlotLegends->Automatic
],
{{R1,10,"Input Resistance (R1)"},Row[{Slider[#,{1,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
{{R2,50,"Output Resistance (R2)"},Row[{Slider[#,{10,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
ContinuousAction->False,SaveDefinitions->True
]

Non-ideal effects with corrective filter

WSMModelData["OperationalAmplifiers_Assignments.NonIdealOPStepSourceCapCompensated"]

Manipulate[
WSMPlot[
WSMSimulate["OperationalAmplifiers_Assignments.NonIdealOPStepSourceCapCompensated",
WSMParameterValues->{"R1.R"->R1*10^3,"R2.R"->R2*10^3}],
{"stepVoltage.v","outp.v"},
PlotRange->{Automatic,{-15,1}},ImageSize->Large,PlotLegends->Automatic
],
{{R1,10,"Input Resistance (R1)"},Row[{Slider[#,{1,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
{{R2,50,"Output Resistance (R2)"},Row[{Slider[#,{10,100,1},ContinuousAction->False],Spacer[5],#," kΩ"}]&},
ContinuousAction->False,SaveDefinitions->True
]

Manipulate[
WSMPlot[
WSMSimulate["OperationalAmplifiers_Assignments.NonIdealOPStepSourceCapCompensated",
WSMParameterValues->{"C1.C"->C1*10^(-12),"C2.C"->C2*10^(-12)}],
{"stepVoltage.v","outp.v"},
PlotRange->{Automatic,{-15,1}},ImageSize->Large,PlotLegends->Automatic
],
{{C1,1000,"Input Side Capasitance (C1)"},Row[{Slider[#,{100,2000,100},ContinuousAction->False],Spacer[5],#," pF"}]&},
{{C2,90,"Output Side Capasitance (C2)"},Row[{Slider[#,{10,200,10},ContinuousAction->False],Spacer[5],#," pF"}]&},
ContinuousAction->False,SaveDefinitions->True
]

Extra assigments

NotebookOpen[FileNameJoin[{NotebookDirectory[],"OPAssignments/OperationalAmplifiers_Assignments.nb"}]];

NotebookOpen[FileNameJoin[{NotebookDirectory[],"OPAssignments/Rectifier_Assignments.nb"}]];

NotebookOpen[FileNameJoin[{NotebookDirectory[],"OPAssignments/DigitalAddersWeb.nb"}]];

The Verdict

Professor, assistants, and student happy!

Mechanical Engineering Dynamics Course

Based on MIT OpenCourseWare

Background

Engineering Dynamics course from MIT OpenCourseWare

Undergraduate (Mechanical Engineering)

Goal

Introduction to dynamics and vibrations:

Kinematics

Force-momentum formulation for systems of particles and rigid bodies in planar motion

Work-energy Concepts

Virtual displacements

Virtual work

Lagrange Equations

Method

Theory and maths/physics explained

An Introduction to Lagrange Equations

Quiz and exam using hand calculations

Problem Set 7

Our perspective

Shouldn’t it be possible to make the Lagrange equations to come more alive?

Example — Pendulum with Spring

Solution

Solving Lagrange’s equation in Mathematica

SystemModeler assignments

Let’s start with the original example

WSMModelData["LagrangesEquations_Assignments.PendulumWithSpring"]

We believe that some students will be excited, so let’s give them some extracurricular material:

NotebookOpen[FileNameJoin[{NotebookDirectory[],"DynamicsCourse/LagrangesEquations_Assignments.nb"}]];

WSMModelData["LagrangesEquations_Assignments.RotatingSwing"]

Where can this Potentially Be Applied?

Huge range of courses in secondary school and college

Aerospace

Biochemistry

Chemistry

Computational biology

Control engineering

Electrical engineering

Mechanical engineering

Physics

Social science

Systems biology

etc...

Do you have a course?

Thanks!

Wednesday

What's New in SystemModeler

2:30 PM - 3:00 PM

Jan Brugård

Little Chief

Thursday

SystemModeler in Process Industry

11:30 AM - 12:00 PM

Patrik Ekenberg

Little Chief

SystemModeler in Education

2:00 PM - 2:30 PM

Patrik Ekenberg, Jan Brugård

Little Chief

Friday

Using SystemModeler to Rapidly Build a Hardware Control System with Vision Feedback

10:30 AM - 11:00 AM

Neil Singer

Spartan/Golden Gopher

Networking of Fuel Cell Stacks Using the Wolfram Modeling and Simulation Suite

2:00 PM - 2:30 PM

Gunnar Preiß

Little Chief

Monday to Friday

Hardware lab

Almost all the time

In the basement

Balance a ball on a beam

Experiment with hardware control with vision feedback

Control paperboard production