Tuesday, May 18, 2010

MATLAB with Maps

I have more from my MATLAB class. For the latest assignment, I had to create a Simulink model for the equation 5y’’ + 3y’ + 7y = f(t).

When I first tried this, my Simulink block diagram looked like this.

My first block diagram in simulink
While it does not look like much, the settings on the state block can do a lot of things and minimize the need for other blocks. I got here by following the example in the teacher's notes and modifying it for the specific problem. However, some people were having problems with the Simulink stuff. The instructor posed his answers to the questions. This was his rendition of the block diagram I made above.

Teacher's simulink block diagram
Since the text is small, I will explain the action. The signal starts at a generator on the left. This follows the arrow to a sum circle where it continues to the box integrator. It then travels through a triangular multiplier before the signal is duplicated. One copy goes to another integrator box and multiplier triangle. That output and the duplicated signal from earlier are sent back to the sum circle (it can also subtract) where they affect the cycle.

It is a good thing the instructor posted his answer. Aside from the wrongness of what I originally did, it lacked the steps which made it look like I was doing things. I redid my diagram and came up with this.

My modified simulink block diagram
Creating these images was a ruinous process. MATLAB can't save as a jpg, Blogger will not accept PDF uploads, and when I tried to save as an XPS file I ended up with 7 different copies of the file on my desktop, none of which I could open (though I was eventually told .NET framework was necessary). After printing them to a PDF file, opening in Photoshop, cropping, saving as a properly sized jpg, and uploading they became the pictures they are now. This is also why I did not go back and recreate the last picture to be easier to read.

Learning takes...
When referring to the online discussion forums, my teacher said "It takes a village to teach MATLAB simulink." I disagree. All you need is a good video introduction (which we did not have for Simulink), access to the internet to research questions in the technical documentation, and the willingness and persistence to solve problems.

I taught myself a 3D graphic design program for an archeology project from youtube videos. No village was necessary, just a knowledgeable and dedicated teacher.

Now that I know about Simulink, I have to decide the best way to implement my class project. Luckily (or unluckily) I have not written any code for it yet.

No comments:

Post a Comment