3rd order polynomials in MATLAB?
20 ビュー (過去 30 日間)
古いコメントを表示
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)
coeff=[]
lp= minmax(SkiJump)
fd= hf-20
plot(h0,s0)
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.
0 件のコメント
回答 (2 件)
Image Analyst
2012 年 10 月 19 日
Take a look at polyfit() and polyval(). You may also find interp1() helpful.
2 件のコメント
Image Analyst
2012 年 10 月 19 日
I don't know - I didn't go over it in detail. I just saw something about trying to get coefficients from a 3rd order polynomial so polyfit() popped into mind.
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!