MATLAB, MAE 325, Fall 1999


No TK Solver in MAE 325. The text by Norton uses TK-Solver which is not commonly known on the Cornell campus nor outside.

Matlab is used in MAE 325. All MAE 325 computation is with MATLAB which is commonly known on the Cornell campus and used widely in industry.

Matlab is available. Matlab is available at all Engineering public facilities. Engineering students can get a password from the engineering library. The student version can be purchased at the campus store.

You are already comfortable using MATLAB. To some extent or another, Matlab is in CS100, Math293 and 294, TAM 203, and in many other courses.

MATLAB on exams. Matlab commands that, if executed, would generate a solution will be acceptable as exam solutions. Some exam problems will only by solvable this way.

More MATLAB help. First you should learn how to use all the different kinds of online help. Next, get a good book. Getting Started With Matlab 5 by Pratap is pretty good. Spend 8 hours slowly doing the tutorials therin and you will be ready to go. Some course relevant Matlab samples may appear on this page as the semester progresses.


Solving Algebraic Equations in Matlab

 

Here are several tips and some example M files which show various ways how linear and nonlinear equations can be solved with MATLAB. Put the examples in M files and run them to see how they work.

 

  1. Solving systems of linear algebraic equations. For example, here are some linear algebra equations you may want to solve.

                       3* x1 + 5* x2 + 2* x3 = 3
                       x1 + 7* x3 = 2
                       x2 + 3* x3 = 5

    The following three example files all depend on rewriting the equations in the form of Ax = b and then using backslash in MATLAB (i.e. x = A\b). But these files are slightly different in the way the A matrix is assembled and in how the output is expressed
  2. Nonlinear equations of 1 variable. For example, find x given that

                    0.1*e^x + sin(x) - 5 = x.

    The following four example files show the different approaches to solve this problem.
  3. Nonlinear equations of several variables

Four Bar Linkage Kinematcs

These are the functions explained in lecture on Wed September 22. They are not well documented since they were explained line by line in lecture.

driver          righthandside


Library of matlab m-files used in the homework solutions

These files have been used in doing homework solutions and you might find them useful for doing future homework problems. Do not employ these functions blindly -- they may not work with the notation you have used to set up a particular problem!
law_cos_ang.m
law_cos_len.m
linkage_vec.m
linkage_pos.m
linkage_ag.m
cross_2d.m