3rd order polynomials in MATLAB?
19 views (last 30 days)
Need help with problem. I am very confused. Don't know where to start and this question is very hard for me. I tried getting started with
function[coeff lp fd] = SkiJump(l,h0,hf,s0,sf)
but I am just too confused. I missed class due to sickness and i still have to turn in my homework and now I have no idea how to do anything concerning linear equations.
THis is the question
You have been hired as an intern at a ski resort. Your first intern project is to create a new design for a ski jump. Your boss is a big fan of 3rd order polynomials and therefore wants you to design the ski jump based on a 3rd order polynomial. For initial design purposes, your boss wants you to write a MATLAB function called SkiJump which will be used to evaluate the feasability of the design.
The equations of the 3rd order polynomial H(x) and the slope s(x) are defined below:
H(x)=p3x3 +p2x2 +p1x+p0
s(x) = 3p3x2 + 2p2x + p1
*The function header should look like the following:*
function [coeff lp fd] = SkiJump(l,h0,hf,s0,sf)
The inputs to the function are:
the horizontal distance from the start to the launch point (in feet).
h0: the initial height (in feet).
hf: the final height (in feet).
s0: the initial slope (in feet/feet). Must be less than or equal to zero.
sf: the final slope (in feet/feet). Must be greater than or equal to zero.
The outputs from the function are:
coeff: a vector containing the coefficients of the 3rd order polynomial. The coefficients
must be arranged from p3 to p0.
lp: the lowest point of the ski jump design.
fd: the ski jumper’s flying distance.
*To calculate fd assume the following:*
(a) Gravitational acceleration = 32.1522 ft/s2
(b) Neglect ground and air frictions and use conservation of energy in determining the speed of the skier when he/she leaves the jump.
(c) Assume that the ground is at height hf-20 feet.
In addition, the function should also plot the shape of the new ski jump, which is given in figure 1.
Image Analyst on 19 Oct 2012
Take a look at polyfit() and polyval(). You may also find interp1() helpful.
Dr. Seis on 19 Oct 2012
Edited: Dr. Seis on 19 Oct 2012
My answer for a different, but similar question might help (at least for the function for the ramp):