New generation of math software from Maplesoft


Uploaded by Google on 20.09.2007

Transcript:

TERRY VAN BELLE: My name is Terry Van Belle.
And it's my distinct pleasure to introduce Mohamed Bendame
and Darren McIntyre from Maple.
I worked at Maple back in the mid-'90s, and I always thought
it was a great product.
And since I've been here at Google, every once in a while,
I come across projects, and I think, oh yeah, Maple would be
really nice for that or would be great for that.
So I was very pleased that they could show up.
I just wanted to mention that this talk is going to be going
to Google Video, so please keep any confidential
information out of the Q&A questions until maybe later on
if you want to ask it in person or something.
All right.
DARREN MCINTYRE: Thanks.
Thank you, Terry.
And thank you for coming again.
Again, my name is Darren McIntyre.
I'm the vice president of sales and business development
at Maplesoft.
It is not my job today to bore you with a number of
PowerPoint presentations.
This is a tech talk, so we're going to get Mohamed up here
and talking very shortly.
Wanted to ask a quick question, just a poll of the
group, who's familiar with Maple today?
Just by a show of hands.
For video, that was about 25%.
Is anyone familiar with the MATLAB suite of products?
That would be MATLAB, Simulink, Simscape.
By a show of hands.
That was more like 90%.
Our company is a mathematics software company.
We feel that anywhere mathematics is done, anywhere
computation is done, we feel that our product has
applicability.
We play nice with other pieces of technology that being
MATLAB, as well as Simulink.
And Mohamed will go into some additional detail
for you in a minute.
So just a quick couple slides from me.
Mission statement here.
We feel we're the leading provider of trusted,
high-performance software tools for
engineering, science.
We had our roots based in education, but branching out
into the commercial marketspace.
What we're trying to do is building a very high-end,
computational tool that has the world's easiest to use
interface, a very simplistic, easy to use interface.
And you'll see that in Mohamed's demonstration in
just a few minutes.
So one more slide from me.
Started as a research project here in University of Waterloo
back in the late '80s.
So we've been in business some 20 years.
Approximately two years ago, we introduced that new way to
access that very powerful mathematics-based engine.
And that is inherent inside of Maple 10, which we released a
couple years ago, and Maple 11 that we released back in March
of this year.
We have about 150 employees, half in R&D,
very technology based.
And we do have very strong ties back to
the academic space.
I'd like to introduce Mohamed at this point in time.
That was my last slide.
I just wanted to briefly introduce the company in the
background.
And now we'll launch right into a
demonstration of Maple itself.
MOHAMED BENDAME: Thank you, Darren.

Just before I start my presentation, I would like to
thank Terry.
And also, I would like to thank Google for the
opportunity for us to come here and do this tech talk.
So I can go back home and say, I've been to Google.
So Maple is a tool that would allow you to do mathematical
modeling and simulation.
It can go beyond that.
So what I'll do, I'll just do a quick demonstration of Maple
as a mathematical tool.
And then we'll go into some other add-ons.
So what we have here is a worksheet where you can
seamlessly mix math with text, with images, with
graphics, and so on.
So what I'm just going to type here, an expression.
So we say x squared plus sin of x divided by x and then
plus, say, 11 divided by 3.
Maple 11 has a 2-D equation in it, so that will allow you to
type in your equations as equations using real math
notations, unlike other tools where you have to code your
equations or have them hidden in cells.

The Maple document interface was meant to make the
usability more of an easy thing to do
when using the software.
So what we have is a context-sensitive menu that
will allow you to right click on any mathematical
expression.
And then Maple will give you a list of commands that you can
apply to that expression.
So here, we can see that we have differentiate, evaluate,
factor, integrate, and so on.
So if I just pick Optimize.
And I want to minimize that expression.
So we click on the Minimize, and then Maple will minimize
the expression.
It will give me the results there.
I can also right click on this, and we can do number
formatting.
So we can display our results in scientific notation,
engineering notation.
We can also specify the number of decimal places.
And then we click Apply, and then Maple will apply the
formatting there.
In some cases, a lot of people include
equations in their documents.
And when they go back to the document, they don't know
where the equations are coming from.
So what we've done, we can make notations.
So we can select the expression here.
And then if we'll get to the formats, and then we say,
Annotate Selection.
So I can say, OK, this is a reference, and it's coming
from a book called Math and Modeling and then
page 123 for instance.
So now when I hover over my expression there, I can see
the little reference that tells me where that equation
is coming from.

In mathematical symbols, it is very easy.
We have a number of palettes that give you access to over
1,000 different mathematical symbols.
So this is the Favorite palette.
And we also have the Expression palette there.
And you can see, we have integrals, derivatives,
summations, basic functions like the sines, the cosines.
So if you need to do an integration, we click on the
Integral symbol there.
And then we can say, OK, we go from x0 to x1, and then we
want to integrate the expression x squared times the
natural log of x plus 1 with respect to x.
And if I press Enter, so Maple will do the integration, and
it gives me the results as you can see there.
We can also use Summation there.
We'll do sigma, again from k.
k going from 1 to n.
And then we want to sum up all the k squared.
And then we press Enter, and then Maple
will give me the results.
Again, applying the context-sensitive menu, I can
right click on the expression there.
And then say I want to factorize, click on Facts.
And then Maple will factorize the expression for me.

Working with matrices, we also have a matrix pilot there that
will allow us to create different types of matrices.
So if I click there, we can specify the number of rows and
number of columns by just type M1 here.
And then we're going to create a three by three matrix for
simplicity.

And we click on Inset Matrix.
And here, you can see that we have different types of
matrices that we can create.
We can create random matrices, identity.
We can also specify the shape of the matrix and
also the data type.
So in this case, I just want to enter an empty matrix so I
can start typing random values here.

So that's my matrix there.
Now if I right click on the matrix, you will see that now
I have things like Solvers and Forms. I can LU
Decompositions.
I can do queries on the dimensions, the rank.
I can also do the inverse determinant of the matrix, and
then Maple will give me that.
I can also use--
so if I do M2, and M2 is the inverse, so I'll just M1 to
the minus 1 and press Enter.
And then Maple will give me the inverse of the matrix.
I can also multiply the two matrices, and this will give
me the identity matrix.
The other thing that we could do, you can work with numbers,
but you can also work with symbols.
So if I do a, b, and then c.
Now if I press Enter, we have the inverse matrix depends on
the parameters a, b, c.

And if I do simplify here to tell Maple to simplify the
products of M1 times M2, press Enter, and now we have also
the identity matrix when we multiply [UNINTELLIGIBLE].
Working with large matrices, I'm going to create a very
large matrix.

It's going to be 1,000 by 1,000 matrix,
which is very large.
And I'm going to choose Random Matrix.
I don't want to fill out 1,000 by 1,000 matrix.
And the data type is Float.
If I press Insert here--
oops--
so that's my matrix there.
Now I'm going to compute the inverse of large M. So I'm
just going to do large M to the minus 1.
So this is a very large matrix.
How long do you think it'll take to compute the inverse of
the matrix?
It's a million element matrix.
And any idea?
AUDIENCE: Is it actually going to be computing the inverse?
MOHAMED BENDAME: Yes.

Anyone want to guess?

AUDIENCE: I'm guessing it's already done.
MOHAMED BENDAME: Five hours?
AUDIENCE: Five seconds.
MOHAMED BENDAME: Five seconds?
OK.
I'm going to press Enter right now.
So it'll take about a second or two to compute the inverse
of a very large matrix.
Now to view the elements, we're going to have to just
double click.
And then we can see the entries there or the elements.
And you can see, it's 1,000 by 1,000.
We can also view the image there, and that will give me
an idea about the structure of the matrix.
And you can see, it's a very dense matrix.
A quick test is to multiply the two matrices, and this
should give me the identity matrix.
Again, multiplying two very matrices.

There it is.
If I double click now again, we should have
the identity matrix.
And you can see that we have 1, 0, 0, 0, 0, 1.
And I can view that by using the image.
And we see that we have a diagonal matrix, which is
exactly what we expect.

The other thing that I'm going to demonstrate here is using
Maple to solve differential equations.
Maple does solve differential equations symbolically as well
as numerically.
It can also solve differential algebraic equations.
This is one of the strong features in Maple.
So what I'm going to do here, I'm going to define ode1.
And we're going to use a numeric example first and then
a symbolic one.
So we're going to enter the ode again.
Entering differential equations in
Maple is very simple.
We use the prime notation, which is x double prime means
the second derivative with respect to time.
And then plus x of t squared plus 1.
And then times x prime of t.
And then plus x of t.
And this is equals to 0.

This is a second-order nonlinear
differential equation.
If I right click, what we have here is, you can see now in
the context-sensitive menu, you have Solve a Differential
Equation and Solve a Differential Equation
Interactively.
I'm going to choose the interactive one.
And that will give me this assistant that will allow me
to solve this differential equation, again, without
having to use any commands.
So far, I have not used a single command.
It's all using the context-sensitive menu or
using the shortcut keys.
Here, I can add initial conditions or boundary value
conditions.
So we say, at time t equals 0, x is 3.
And then x prime at time t equals 0 is going to be 0.
And then we say Add.
And then we say Done.
So these are the two initial conditions that we need to
solve this ode.
And now if I go solve numerically, here on the
left-hand side, you see the different solvers.
And Maple will always pick up the appropriate solver
depending on what type of differential equation we're
trying to solve.
I have to provide the value for time.
So if I say, time t equals 5 and I click Solve, Maple will
give me x and x prime at time t equals 5.
I can also create a plot.
And then the plot will plot the solution of that
differential equation, which I can then
return to my worksheet.
I can also return the numeric procedure that
generates the solution.
Or I can return the Maple commands that will generate
the solution as well.
If I click Quit, now we have a solution there.
So the next thing I want to show is
importing data into Maple.
So if I use the Tools, Assistants, we have a lot of
assistants, again, that will allow you to do things without
having to know anything about the commands of the syntax.
So we have Curve Fitting.
We have Data Analysis, Import Data.
So this is the one I'm going to use here.
So you can see the file format.
We can import Excel files, MATLAB files, audio files,
image files, and so on.
I'm going to select Excel.

And I'm going to look for an Excel file in my Maple folder.

Next, and then we say Done.
So this will import the data.
So we have 25,000 pairs of points.
Again, the context-sensitive menu will allow me to
visualize this, again, just by right
clicking on the data there.
And then we go Plots, and then we have the PlotBuilder.
And again, the PlotBuilder is an assistant that will allow
me to create different types of plots.
And then we say Plot.
So Maple will plot the data.

So that's the data there.
If I want to manipulate the data or change things in the
data, again, using the
context-sensitive menu, right click.
And then we can go Symbols, and then we choose Points.
Right click, we can choose to change the color,
say, red for instance.
We can also use the Drawing tools here.
So we can add text for annotation purposes.
So we can annotate the plot.
So we say, 2-D Point Plot Example.

Instead of math, we can also use mathematics
for annotation purposes.
So if we want to add pi there, k, again, from 1 to n.
And then we have 1 plus k squared.

We can highlight areas in the plot.

So this was a demonstration of importing data and visualizing
data, again, without having to use a single command.
It's all done using the assistants and the
context-sensitive menu.

The next example I'm going to show is a 3-D animation.
So we're going to define an expression here.
So x plus r times y multiplied by the exponential of minus x
squared plus y squared.

Now again, if I right click on this, again, we have the
context-sensitive menu, and then we have the plots.
And we go to the PlotBuilder.

And here, I'm going to select Animation.

So it's a 3-D plot.
Here, the x and y are the x-axis and the y-axis.
We can set the ranges.
We go from minus 1.5 to 1.5.
And then the same thing with y.

And r will make it go from 1 to 10.
If I click on Plot, Maple will generate the animation.

Again, we can right click there.
We can make changes, style, surface
without the wire frame.
We can add a lighting scheme.

And we can play the animation here, so
you can see the animation.
We can also rotate this in real time just using a mouse.
And you can also export this in different formats, bitmap,
giff, jpeg, and so on.

I said I was going to do a symbolic differential
equation, which I didn't.
I'll do that right now.
So we're going to define a differential equation.
M times y double prime of t plus B times y prime of t and
then plus K times y of t.
And this is equals to alpha times cosine of omega time t
and then plus beta.
So this is a differential equation.
The initial conditions, we'll just do y of 0 is 0.
And y prime of 0 is also--
let me make this 3.
So these are my initial conditions.
Now to solve this differential equation, all I have to do--
even if you have to use the command, it's very simple.
We just do dsolve, and we solve in the ode 2 with the
given conditions.
And we're solving for y of t.
And this will give me the solution in terms of all the
parameters of my system.
So you've got the a, b, the alpha, beta, and
omega, M, and so on.
So we have the solution there.
Now what we could do, let me show you something cool here.
I'm going to assign that solution.

If I type y of t here, if I right click on it, again,
using the context-sensitive menu, we can convert this into
any of the languages that we have there, C, Java, Fortran,
Visual Basic, and MATLABs.
If I do C, we convert that into a C code that we can then
use in some other applications.

Maple does have a number of packages.
And these packages are libraries for things like if
you're doing statistics or linear algebra.

With statistics, this will load the statistics package,
which means it loads the functions in that package.
There are a large number of functions that we have in the
statistics package, as you can see there.
There are about 35 different distributions.
There are a number of statistics plots.
We can generate random numbers.
We can do all kinds of things.
So let me just do a quick example here.
If I define x as a random variable, we use a normal
distribution here.
Then we take 1 and 0.5.

I'm going to create a sample of that.
So if I do Sample x.
And let's say we take 100,000 samples.
Press Enter.
That's my data there.
Again, if I right click here, now we have Statistics in the
context-sensitive menu.
And then we can do all kinds of visualization.
We can create bar charts and histograms. And in the
Summary, we have quantities, like geometric means, standard
deviation, the mean, and so on.
So let's do a histogram.
And that's the histogram there which we can edit.
I can change the color.

I can change the bandwidth there, then I click Update.
When I click on Quit, then Maple will return the
histogram for me there.
So there are a lot of functionality in the
statistics package.

We have a number of add-on tools.

Darren asked how many people use MATLAB and Simulink.
It was a quite large number of hands.
We do have tools that will allow you to do your
mathematical modeling in Maple.
And then you can convert all that stuff into a nest
function or a Simulink block that you can simulate in a
Simulink environment.
We also have BlockImporter that will allow you to bring
in Simulink models and then convert them into mathematics.
And you can simplify the model, and then you can send
it back as a Simulink block for better performance.

But before that, any questions so far?
Yes.
AUDIENCE: Could you compare yourself to Mathematica
[UNINTELLIGIBLE]?
MOHAMED BENDAME: We get that question--
do you want to?
OK.
The question is how do we differ from Mathematica?
Is that?

DARREN MCINTYRE: Mathematica has historically been our
number one competitor specifically in
the academic space.
We feel that the work that we've put into the interface
of Maple to make it extremely easy to use, the 2-D editor
that Mohamed showed, the assistants, the tutors built
into the software tool make it immensely easier to use than
that of Mathematica.
We feel that the power between the two systems is somewhat
comparable, but we feel that, for engineers and scientists,
we do reach out to other software tools like that of
MATLAB, Simulink for connectivity in an engineer's
tool chain.
So we feel that from a connectivity standpoint, we
feel that Maple is a much better tool than that of
Mathematica.
And as well, from an ease of use standpoint, we also feel
that Maple is superior.
In the past, as well, Mathematica is not a very open
system to allow access to view the code inside of
Mathematica.
95% of Maple has always been open and still is.
So if you wanted to see the coding that goes into the
4,000 functions that are physically a part of the math
libraries, you can go in and actually view
the actual code itself.

Any other questions before we continue?
Yes.
AUDIENCE: Well, if the code's viewable, then what about
intellectual property?
DARREN MCINTYRE: The question was what about intellectual
property if the code is open.
There is a subset of Maple that is protected that we do
not allow access readily to users.
We feel that it is important to open up the math libraries
to allow people to verify their results.
And that's really why it's there.
Maple does own the IP to the system.
And we don't feel that there are any holes there that are
opening us up in any insufficient way.

Anything else?
OK.
We'll continue.
MOHAMED BENDAME: OK.
Thank you.

Since there was a question about the Maple open
environment, let me just show you a simple example how you
can view the code of some of the functions.

There are a number of function in Maple obviously.
So there is one, it's called isprime, which checks whether
a number is prime or not.
So if I do isprime 17.
So it's true.
So if I want to view the code of the isprime function, what
I'll do here is print isprime.
And actually the code is written in the Maple language.
So Maple does have a programming language that we
can use to write code.
So this is the code that we use for the isprime function.
So there are a number of functions that you can view.
About 90% of the Maple commands are written in the
Maple language, and they can be viewed.
You can also modify them.
You can make changes.
And then you can save them.
You can also create your own libraries based on what we
have in Maple.

Now using Maple programming language, again, is very easy.
I'll just do a simple example here.

The name of the program is going to be prog.
proc is a keyword that starts a procedure in Maple.
And then we say, n1 is going to be an integer.
We don't have to specify what data type is, but sometimes we
can do that.
AUDIENCE: [INAUDIBLE] spell integer right.
MOHAMED BENDAME: Yes.

Thank you.
I was going to the same thing here, integer.

And then I'm going to define some local variables.
So we define M, i, j as local variables.
And then we're going to use the for loop.
So we say, for i from 1 to n1 do.
And then for j from 1 to n2 do.
So what we're going to do is create a matrix.
So Mi, we'll just put--
it's i plus j.
And then what we do is end.
We need to end the first do.

And then end the second loop.
And then we end the procedure.

So this is a Maple program.
We're using two for loops.
We could also use if statements and all kinds of--
and then here, we can run the program by prog if
we do 3 comma 4.
Oh, I forgot something here.
What we want to return is the matrix M. So the
matrix, n1 comma n2.
And then M.
Oops, I forgot to close this.
And then we have our matrix there.
If we choose something bigger, we have a 30 by 40 matrix.
And if I double click, I can see all the
entries of my matrix.

The next thing I'm going to do here is to show you
BlockBuilder and BlockImporter.
As I mentioned, BlockBuilder is a tool that would allow you
to convert mathematical models into Simulink.
So if I do with BlockBuilder, this will--
oops--

that's my BlockBuilder.
And these are the commands in the package.
And if I do question mark BlockBuilder, this will open
up the Help page.

And these are the commands that are built in the package.
So BlockBuilder, as it says there, exports a dynamic
system to Simulink.
So first, we have to create what we call a system object.
And a system object could be a system of
differential equations.
It could be a transitive functions.
It could be state-space matrices.
And then we can generate the code, which is an S function.
That could be a C code or a MATLAB code.
And then we can do manipulations, like the
characteristic polynomial, gain margins,
Gramians, and so on.
And if I go to an example, so here we have a number of
examples there.
So I'll just go to the Mobile Robot there.
So this is a system that was modeled in Maple.
And after it was modeled in Maple and tested and it was
working fine, then we wanted to convert that into a
Simulink block.

So initialization here just means that you
load all the libraries.
System definition.
So we have the parameters, and we have all the variables in
table form.
So here we have the robot chassis radius, and the moment
of inertia, the mass, the wheels, the moment of inertia,
the DC motor resistance and inductance.
And then we have the variable definitions, what each
variable means.
So xt, yt means the robot positions, the x- and
y-coordinates.
And then here, we have the model.
And the model is just a system of differential equations that
we need to solve.

So defining the system, what we have to do is give the
initial conditions and also the number of parameters there
that we have to give them values.
And then we do the simulation.
So the input is given by this piecewise function here.
And then we're going to view the output by solving the
system of [UNINTELLIGIBLE].
So this is the robot heading.
This is the x, y positions of the robot.
So this is the simulation.
And what we do is run this animation here that will show
how the robot moves along the trajectory that we have there.
And then we do the export to Simulink.
And this is the last piece, which will convert all that
into a Simulink diagram.
Here, we have two inputs, and we have five outputs.
And we have the different states.
We can also view the parameters, the resistor, the
mass, the moment of inertia, and so on.
These are the values.
We can also change these [UNINTELLIGIBLE]
labels if we want to.
And now if I go Generate, this will generate the code.
I can preview the code.
So this is a code that's generated automatically.

And now we're going to build the block.
This will open up MATLAB and Simulink.

That's MATLAB.

AUDIENCE: I have a question.
MOHAMED BENDAME: Yes, sure.
AUDIENCE: [INAUDIBLE]

MOHAMED BENDAME: OK, try hard.
It tries harder than optimize.
To be honest, we have three options.
What we use in here behind the scenes is the code
generation of Maple.
And it has the option to add the optimization, so you get
an optimized code.
The difference between optimize or try hard, I'm not
entirely sure.
But it gives you a better code, I think, but I'm not
entirely sure what try hard means.
We had that question this morning.
I wasn't expecting it to be honest.
So this is the robot for the block that we just created
using BlockBuilder.
If we double click here, again, we have all the
parameters there.
And if I apply an input, we could take a
sine wave or a step.
Let's just take a step here.

We'll apply the first input.
I'm going to use a second step input.

And we're going to use a scope.

So I'm just going to use two scopes, just for x and y.

Now if I run the simulation, it's done.
So this is my x position there.
And this will be the y position.

So this is uncontrolled output.
Then we could apply a PID controller, so we can control
the output.
So we can get the output that we want.
So this is BlockBuilder.
As I said, BlockImporter does the inverse.
So it gets you a Simulink model, and it converts into
equations that we can simplify and reduce the number of
equations, a lot of redundant equations, and then give you a
better code for that.
One last thing that I'm going to demonstrate here is
optimization.
Maple does have optimization functions.
We have the [UNINTELLIGIBLE] which is a built in optimizer.

It does local optimizations.
It does LPSolve.
There is the Least Square Solve.
There is the Maximize, Minimize Nonlinear Programming
Solve and that Quadratic Programming Solve.
We also have a Global Optimization toolbox.
That's an add-on that would allow you to do global
optimizations.
So you see, you have an objective function.
And you have a number of constraints.
And you have bounds.
And you want to find the optimal solution.
Then Maple will allow you definitely to do that.
In some cases, you have test data.
You have input, output.
And then you have a model, it's sometimes called
parameter identification.
So based on the test data, you want to find the values of the
different parameters that will give you the best or
will fit that data.
I think I have an example here instead of me creating one
from scratch.
I'll show you one.

So we have global optimization.
And this actually was done by a company.

So this is the test data.
So we read the data, and then we plot it.
And that's what we have there.
And then the model function is given by this expression here.
As you can see, it's nonlinear, where what we need
to find is the A, B, C, D, and the K. And those have some
real significance.
This is actually a spherical lens.
So here, we substituted R by this value.
So this is the model function that we have. We have the
intervals for the different parameters.
We have A between minus 0.001 and 0.001.
Same thing with B, C, D. And K is between minus 1 and 1.

So the objective function will be the sum of the least
squares between the actual value and
the calculated value.
And then we'll run the Global Solve command.
And this will find the values for A, B, C, and D, and K. And
what we do is plug them in the equation that we started with.
And then we create the plot.
So this is what we have here.
And if we plot the two together, you see that we have
two curves one on top of the other.

And then we verify the results here.

So the regression coefficients, we have A, B, C,
and D. And then we look at the error.
So it's in the region of 10 to the minus 6.
So the results are very, very good.

So this was the Global Optimization.
You can also use the Optimization Assistant.
So if we go Optimization, this will allow me to define an
objective function by clicking on the Edit button there.
So I can type in an expression there.
You could have as many variables as you want.
We can add the constraints.
So we can add constraints.
You could have as many as you want again.
And we can add all the bounds, so the intervals of those
parameters.
And then here we have, you can see, these are the local
solvers or the local optimizers.
And this is the global one.
And the global one does have different options.
There is branch and boundaries, multi-start,
single start.
And we can choose whether to minimize or maximize.
And once you enter all the information, you're just going
to go solve, and then Maple will solve.
And it'll give you the optimal value as well as the values
for the different parameters that you need.
How are we doing for time?
AUDIENCE: [INAUDIBLE]
MOHAMED BENDAME: So about 10 minutes.
Any questions?
OK.
AUDIENCE: I have two questions.
MOHAMED BENDAME: Yes, sure.
AUDIENCE: The first one is I use [UNINTELLIGIBLE].
It's very good.
But I have a lot of trouble trying to find out if the
function that I was looking for is
somewhere in these packages.
So I was looking for something [INAUDIBLE].
How do I find stuff?
MOHAMED BENDAME: OK, good.
The question is how to find built-in functions in Maple.
Yeah, that's very easy.
What you do is--
remember I did the question mark for help?
So if you do question mark, you're looking for functions,
type Functions.
You want an index, comma Index.
And then press Enter.
And then Maple will open the Help page.
And all the functions are built in the software with a
hyperlink, so you can click on the function name.
And then Maple will give it a Help page on the function.
So Add, if I click there, I'll have the Help page on the Add
and how it works with all the options.
And usually, at the end of the Help page, there is a number
of examples that you can copy and paste.
It shows you how to use the Add function.
AUDIENCE: But you have to know what the function is called.
MOHAMED BENDAME: Well, in here, I just did Function
Index, and it gave me a list of all the built-in functions.

AUDIENCE: That was good.
MOHAMED BENDAME: OK.
What's the second question?
AUDIENCE: The second question is about factorize.
I want to be able to factorize to minimize the number of
operations between the [UNINTELLIGIBLE] that I have.
So I want to be able to take an expression to use a minimum
number of operations for my computer to do.
And factorize seems to do something that makes it look
nice mathematically.
It doesn't necessarily give the minimum number of
operations [UNINTELLIGIBLE].
MOHAMED BENDAME: So the question is is there a
built-in functionality that will minimize the number of
operations.

So when you, for instance, simplify or factorize,
whatever, you just want to reduce the amount of
computations that will--
AUDIENCE: Yes.
MOHAMED BENDAME: That's a good question.
I don't know the answer to that.
But it's something that we can definitely get back to you on.
I'm not entirely sure if there is a built-in function that
you can say, OK, go and minimize the number of
operations.
I've seen something that's probably when the
optimization comes in.
But that's definitely with code generations.
But I'm not going to go into details.
I don't know the exact answer to that.
And we can definitely get back to you.
What version of Maple are you using?
AUDIENCE: It was way back.
It was version 10 or something.
MOHAMED BENDAME: Version 10 is--
it's a recent release.
It's just the previous release.
AUDIENCE: It will be 6 [UNINTELLIGIBLE].
MOHAMED BENDAME: It'll be 6.
Yeah, 6 is quite old.

Yeah, I have seen an example where you get a summary of all
the operations, how many multiplications, how many
additions, and so on.
And there was something that reduces the number of
operations, but I'm not entirely sure what it was.
I think it's to do with the code generation and the
optimizer that is built in Maple that does that.
OK?
Any other questions?
Yes.
AUDIENCE: What I've seen here so far is beautiful for
mathematicians, anybody who wants to [UNINTELLIGIBLE] put
in functions and [UNINTELLIGIBLE] and stuff.
But what about for people who have to do math and are not
very good at it?
So do I--
MOHAMED BENDAME: Sorry, could you repeat?
AUDIENCE: People who have to do math and are not
very good at it.
So you have people who are ecologists, who are very, very
good at their particular branch of science and then
have to do a whole bunch of mathematics in order to prove
their work.
Do you have assistance or help or something in there for
allowing them to know what to use to do the math that they
need to do to prove what they need to do.

MOHAMED BENDAME: The question from the gentleman there is
that what he's seen so far is good for mathematicians, but
it's not good for people who don't know math.
Is there anything in the software that can help them?
AUDIENCE: Do you have a Make It Stupid button?

MOHAMED BENDAME: Maple is, as I said, it's widely used by
engineers as well as mathematicians and scientists.
And it does mathematics, but what you need to do is, for
instance, you have a--
I give examples of differential equations.
The mathematicians know how to solve these
differential equations.
People who are not mathematicians wouldn't know
how to solve differential equation.
So what Maple does, you give it the information, and it
will go and do the math for you.
You don't have to do any mathematics when using Maple.
Maple does all that.
If you're looking for tools that will allow you to--
you want to create a system, use block diagrams, and
connect them, and then get your equations, then Maple
does have a number of options.
There is a tool called Dynaflex Pro.
So what you do, you don't have to do any mathematics.
You start with a system.
Let's say you have a spring mass damper.
So what you do using what we call ModelBuilder.
So you have your ground, then you have your spring damper,
and then you have the mass.
You just make the connection.
Bring block, which is the mass, and then the joints,
which is the spring and the damping.
And then Maple will translate all that into
mathematics for you.
And we're coming up with another tool called MapleSim.
It's in development.
And again, it's for engineers who don't need to worry about
the mathematics.
So they have a system.
They can create it using components, like I bring a
resistor, a capacitor, a spring, a damping coefficient,
make the connections, and then run the simulation.
And then get the results, and I don't have to
worry about the math.

Any other questions?

AUDIENCE: Does it run on Linux?
MOHAMED BENDAME: It does run on Linux.
It does run on Unix.
It does run on Macs, Windows.
So it's a multi-platform.
So you can run it on different platforms.
It's not just Windows.

Since we have a bit more time, so what I'm going to do here
just show you another add-on which is BlockImporter.
Is that OK?
AUDIENCE: Sure.
MOHAMED BENDAME: So what we'll do here--

I might have this open.

This is an F-14 model.
So I'm just going to run through it.
So here we load the two libraries, the BlockImporter
and the BlockBuilder.
So what we do here is import the F-14 model.
Let me just run this one more time.

So we'll have Simulink with the F-14 model run the
simulation here.
And then we get our results.

So what I've done here, this is the Simulink.
So we import it into Maple using the Import command.
And then here we print a summary of the model.
So we have 92 equations.
So there's a lot of equations.
We have 10 state variables.
We have 2 inputs, 2 outputs, and 19 different parameters.
So we use a Simplify Model, which is a command in Maple
that simplifies the model.
So we went from 92 equations to 12 equations.
So we got rid of 80 equations.
The parameters are the same, the inputs are the same, the
outputs are the same.
And then we do the simulation by solving
the system of ode's.
And then we got the response.
As you can see, if you look at that and you compare it to
this one here, you can see, they are similar.
So this is the result that we obtained in Maple.
And this is the result in Simulink.

Then we do the analysis here.
So we can do the Bode plot.
So we plot the phase and the gain.
And we also plot the poles on the 0's and the step response
when we're applying input to our system.

And then here, we have the gain margins.
So again, once you simplify the model, then you can send
it back to Simulink.
And then you can run it in a Simulink environment.

I'm going to stop here.
And then we can use whatever time is
left for any questions.
AUDIENCE: Anyone want any additional information?
MOHAMED BENDAME: Yeah, or if you need further information,
we have an information pack here that you can take.
It has all the information about Maple and all the
add-ons that we talked about.

Again, thank you very much.
Thanks for the time and thanks for the opportunity.