Results 1 to 4 of 4

Math Help - Matlab exercise

  1. #1
    Senior Member Pinkk's Avatar
    Joined
    Mar 2009
    From
    Uptown Manhattan, NY, USA
    Posts
    419

    Matlab exercise

    I am clueless on how to do this exercise I was assigned in my calculus class (even my professor isn't that knowledgeable about MATLAB):

    Using the parametric representation x = cosh(t) , y = sinh(t) , plot the curve 1= x^{2} - y^{2}. Include portions of both branches of this hyperbola. Then add the normalvectors to the plot of the curve. (Your plot should only show arrows attached to the hyperbola, not covering a 2D region.) Make sure you adjust the scales using axis equal to preserve orthogonality. Publish your M-file, including the graphic output.
    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 Pinkk View Post
    I am clueless on how to do this exercise I was assigned in my calculus class (even my professor isn't that knowledgeable about MATLAB):

    Using the parametric representation x = cosh(t) , y = sinh(t) , plot the curve 1= x^{2} - y^{2}. Include portions of both branches of this hyperbola. Then add the normalvectors to the plot of the curve. (Your plot should only show arrows attached to the hyperbola, not covering a 2D region.) Make sure you adjust the scales using axis equal to preserve orthogonality. Publish your M-file, including the graphic output.
    The basic plot (single branch) is simple:

    Code:
    t=-1:0.1:1;
    x=cosh(t);y=sinh(t);
     
    plot(x,y);
    The normal vector's gradients you will need to calculate yourself and then use the quiver function to plot the normals. For help on this type "help quiver" at the command prompt.

    CB
    Last edited by CaptainBlack; March 22nd 2009 at 10:37 AM.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member Pinkk's Avatar
    Joined
    Mar 2009
    From
    Uptown Manhattan, NY, USA
    Posts
    419
    Thank you. Like I said, our professor really hasn't gone over much in MATLAB so far.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member Pinkk's Avatar
    Joined
    Mar 2009
    From
    Uptown Manhattan, NY, USA
    Posts
    419
    Okay, so this is what I came up with:

    Code:
    t=-2:0.1:2;
    x1=cosh(t);y1=sinh(t);x2=-cosh(t);y2=sinh(t);
    dx1=2*sinh(t);dy1=-2*cosh(t);dx2=-2*sinh(t);dy2=dy1;
    plot(x1,y1)
    hold on
    plot(x2,y2)
    hold on
    quiver(x1,y1,dx1,dy1)
    hold on
    quiver(x2,y2,dx2,dy2)
    axis equal
    xlabel('x');ylabel('y');zlabel('z')
    grid on
    title('Exercise 8.2 by Brent Daniels')
    The result is this figure:



    This doesn't seem right, though. \nabla f(x,y) = <2x,-2y> since this figure is essentially a level curve of z=x^{2}-y^{2}. Therefore, shouldn't all the normal vectors on the lower halves of the two branches be pointing in the opposite direction? Or is my code/approach wrong? Thanks.

    Edit: Nevermind, I'm an idiot and found my mistake. What essentially I was plotting was <2\frac{dx}{dt},-2\frac{dy}{dt}> instead of <2x,-2y>. Thanks again.
    Last edited by Pinkk; March 22nd 2009 at 08:39 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. An Exercise
    Posted in the Advanced Algebra Forum
    Replies: 4
    Last Post: January 15th 2011, 09:47 AM
  2. Set exercise
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: June 19th 2010, 09:37 AM
  3. Exercise
    Posted in the Statistics Forum
    Replies: 1
    Last Post: November 25th 2009, 03:59 AM
  4. can you help me with this exercise?
    Posted in the Business Math Forum
    Replies: 0
    Last Post: November 8th 2008, 03:18 AM
  5. can you help me with this exercise?
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: October 26th 2008, 10:57 AM

Search Tags


/mathhelpforum @mathhelpforum