Tim Vrablik

654 Reputation

13 Badges

18 years, 8 days

I work in Maplesoft’s Applications group. This group is a hub between Sales/Marketing and R&D. I primarily work with customers to help them use our software for their projects.

Born and raised in Windsor, Ontario, I spent a substantial chunk of my life there. I attended the University of Windsor to study Engineering and Math, and moved to Waterloo to start working with Maplesoft.

My first introduction to Maple was in a differential equations class. Our professor swore by it every day, and felt obliged to show us examples on how to use it at the end of every class. Admittedly, I usually skipped out of class right around that point. It wasn’t until I sat down and used the software to do my homework that I truly realized how useful Maple was…I only wish I had heeded my professor’s advice in the first month of the semester instead of the last.

MaplePrimes Activity


These are answers submitted by Tim Vrablik

To import data, you need to go to the Project tab > Attachments. Right click on Data Sets and go to Attach File.

To export data, you need to run your simulation the go to Project tab > Stored Results. Right click on the latest results and select export.

Looking at your original question, you are missing a couple of * or spaces for implied multiplication. You should have 3a*(-1/3*b/a)^2+2b*(-1/3*b/a)+c = 0. Once you put those in, Maple simplified the solution right away.

Hi Scot,

I spoke with the developer for this package and it does look like a bug. The issue is currently being addressed.

 

Tim

I'm assuming you downloaded the files, so there is a possibility that the files may have been corrupted (eg not downloaded correctly). I would contact our technical support to help you out with this.

There are several ways that you can create a state space representation. I've attached a worksheet with a few examples for you. In particular to your question, if you are using DE's to create your state space, you have to define what your input and output variables are in the equations.

I would also suggest looking at ?DynamicSystems to get a better understanding of how the DS objects work.

Tim

Download DynamicSystemsObjec.mw

 

(1)

(2)

(3)

More Examples of Dynamic System Objects

 

Steps

Results

Loading the DynamicSystems Package

 

To load any package in Maple, use the  command. When the command is executed, a list of functions available in the package are listed.

(1.1)

Transfer Functions

 

The transfer function of a system can be entered into Maple through the DynamicSystems package. Consider the system . This system can be entered into Maple directly as .

 

 

 

 

As an alternative, it can also be entered in as two arrays, each containing the coefficients of the polynomials in decreasing powers of .

(1.2)

(1.3)

 

To view the complete content of a system object, use the  command.

(1.4)

Zero-Pole-Gain

 

The ZeroPoleGain command creates a zero-pole-gain system object. The frequency-domain behavior of the object is modeled by lists of zeros, poles, and gains of transfer functions. Values for the zeros (z), poles (p) and gain (g) can be entered directly into the command call or assigned to variable.

 

(1.5)

(1.6)

State Space

 

For a control system defined in a state-space form, where state matrix a, control matrix b, output matrix c and direct transmission matrix d of state-space equations are known, the system can be created in Maple as .

State matrices definition

 

(1.7)

To make use of these system objects, it is common to assign your system objects to a variable.

(1.8)

(1.9)

You can easily create different representations of system objects from previously formed system objects. For example converting the above transfer function to a zero-pole-gain representation

(1.10)

System Object Exports

 

When a DynamicSystems object has been created, you can extract properties of the object such as transfer functions and state matrices by using the  operator.

 

To extract the transfer function from example (1.8), enter .

 

To extract the state matrix A from example (1.9), enter .

 

To see a list of module exports, see the DynamicSystems,SystemObject  help page.

(1.11)

(1.12)

With the DynamicSystems package, you can access many different analytical tools. For example, to generate a unit-step response plot you can use the ResponsePlot command.

 

In addition, you can use the interactive tutor found under Tools> Calculus - Single Variable> Arc Length.

If you take a look at the help page for ?piecewise you will see that if you press Ctrl+shift+R, you can enter more conditions.

Two ways (at least):

1. You could use the clock -> (connect to both ports) product -> gain (k=1/2) components for this.

2. Enter the equation 1/2*time^2 in the real expression component. After looking at the help page for this component, I agree that it could use some more in the description. I'll pass this along to our documentation group.

It looks like the problem you're having is that you're not actually assigning your values to your parameters. For example, to store 8.314472 to R, you need to enter it in as R:= 8.314472. If you make those assignments, it should work (I haven't actually checked this to see if it the only problems).

I also just notice that you're assigning a value to O, which is protected. Try changing that vale to say O1.

Also, when using E like you did for B and C, you should enter it in as 36.915E-3 without an * before the E. Maple takes this as the number 36.915 *E-3 where E is a parameter.

I use this routine for plotting 3d data sets quite often, and I don't recall having problems with this. I generated a random set of data (5500x3) and was able to import and did a 3d pointplot without a problem. I used the commands:

data:=ImportMatrix("C:\\test.csv", source=csv[standard],datatype=float[8])

X:=(data[1..,1]):Y:=(data[1..,2]):Z:=(data[1..,3]):

nRows:=LinearAlgebra[RowDimension](data)

plots[pointplot3d] ( [seq([X[i],Y[i],Z[i]],i=1..nRows)],axes=frame,symbol=solidsphere,symbolsize=10 )

 

Hoipe this helps

1. You could also remove the units from the parameters and just use  plot(x, useunits = [Unit('s'), Unit('m')])

2. You can add units to t in your equation x := d+(1/2)*a*(t*Unit('s'))^2, then enter plot(x, t = -10 .. 10)

to multiply a matrix by a function/scalar, you could do this:

u:=(x,y)->x^2+y^2

B:= your 3x3 matrix

u(x,y)*B

You can use the seq command: seq(exp(x), x = 1 .. 5)

You could also use a for loop: for i from 1 to 5 do exp(i) end do;

 

Hope this helps

Off the top of my head...

If you called SSTransform(...), you would get your A,B,C,D. You can then select each matrix by using reference labels and selecting each one. For example, if you were to copy the examples found in the help pages ?DynamicSystems/SSTransformation and executed it in your worksheet, the last execution is labelled 1.3. You could then reference that label (ctrl+l) (1.3)then pick each element off and assign them...so for example you could do A:=(ctrl+l)(1.3)[1].

Hope this helps (and makes sense)

See the attached worksheet.compose.mw

Remember to make a function you have to use x->. See ?operators/functional for more on this.

 

(1)

(2)

 

 

 

 



Download compose.mw

 

1 2 3 4 5 6 7 Page 1 of 8