Results 1 to 9 of 9

Math Help - linear equations in matlab

  1. #1
    Newbie
    Joined
    Nov 2009
    Posts
    19

    linear equations in matlab

    Consider a point body of mass hung from a ceiling on two ropes which form the angles α and β to the horizontal. Tension forces and in the ropes are then determined by the solution of the following system of linear equations

    -T1 cos 30 + T2 cos 45 = 0

    T1 sin 30+ T2 sin 45 = mg

    where g=9.80665ms-2 is the acceleration due to gravity

    Write a script M-file which computes the tension forces T1and T2when m=20kg and alpha=30 and beta=45 degrees

    ive been told to represent this system in matrix form, but im not sure how to.....

    can anyone help?

    thanks

    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by saha01 View Post
    Consider a point body of mass hung from a ceiling on two ropes which form the angles α and β to the horizontal. Tension forces and in the ropes are then determined by the solution of the following system of linear equations

    -T1 cos 30 + T2 cos 45 = 0

    T1 sin 30+ T2 sin 45 = mg

    where g=9.80665ms-2 is the acceleration due to gravity

    Write a script M-file which computes the tension forces T1and T2when m=20kg and alpha=30 and beta=45 degrees

    ive been told to represent this system in matrix form, but im not sure how to.....

    can anyone help?

    thanks


    \left[<br />
\begin{array}{rr}<br />
-\cos(30) & \cos(45)\\<br />
\sin(30) & \sin(45)<br />
\end{array}\right]<br />
\left[ \begin{array}{c}T_1\\T_2\end{array}\right]=<br />
\left[ \begin{array}{c}0\\mg\end{array} \right]<br />

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    delete
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Nov 2009
    Posts
    19
    Quote Originally Posted by CaptainBlack View Post
    \left[<br />
\begin{array}{rr}<br />
-\cos(30) & \cos(45)\\<br />
\sin(30) & \sin(45)<br />
\end{array}\right]<br />
\left[ \begin{array}{c}T_1\\T_2\end{array}\right]=<br />
\left[ \begin{array}{c}0\\mg\end{array} \right]<br />

    CB
    i cant seem to insert [ t1 and t2] into matlab, it says undefined function, how should i change this?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    You are solving for \begin{pmatrix}T_1\\T_2\end{pmatrix}, so you write
    T = A \setminus b
    where A = \begin{pmatrix}-\cos(30) & \cos(45)\\<br />
\sin(30) & \sin(45)\end{pmatrix}, \quad b = \begin{pmatrix} 0 \\ mg\end{pmatrix}.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Nov 2009
    Posts
    19
    Quote Originally Posted by lvleph View Post
    You are solving for \begin{pmatrix}T_1\\T_2\end{pmatrix}, so you write
    T = A \setminus b
    where A = \begin{pmatrix}-\cos(30) & \cos(45)\\<br />
\sin(30) & \sin(45)\end{pmatrix}, \quad b = \begin{pmatrix} 0 \\ mg\end{pmatrix}.
    yes i know that, but the problem im having is that when i type into matlab [ T1 T2], it says T is an undefined function or variable.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    Can you post your code then?
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Nov 2009
    Posts
    19
    Quote Originally Posted by lvleph View Post
    Can you post your code then?
    T=A\b

    A=[-cos(30) cos(45)
    sin(30) sin(45)]


    m=20
    g=9.80665

    b=[0 m*g]

    when i type this in i get

    ??? Error using ==> mldivide
    Matrix dimensions must agree.


    Follow Math Help Forum on Facebook and Google+

  9. #9
    Senior Member
    Joined
    Mar 2009
    Posts
    378
    Your code should be in this order
    Code:
    A=[-cos(30) cos(45)
    sin(30) sin(45)]
    
    
    m=20
    g=9.80665
    
    b=[0 m*g]
    
    T=A\b
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. MatLab: Non-linear differential equations
    Posted in the Math Software Forum
    Replies: 3
    Last Post: June 30th 2010, 03:47 AM
  2. Replies: 3
    Last Post: February 27th 2009, 07:05 PM
  3. MATLAB linear programming
    Posted in the Math Software Forum
    Replies: 0
    Last Post: January 31st 2009, 02:02 PM
  4. Linear Algebra with MATLAB
    Posted in the Math Software Forum
    Replies: 0
    Last Post: December 7th 2008, 06:29 PM
  5. Linear equations and matlab
    Posted in the Math Software Forum
    Replies: 1
    Last Post: January 27th 2008, 11:40 PM

Search Tags


/mathhelpforum @mathhelpforum