Ski Jump HELPPPP

6 Ansichten (letzte 30 Tage)
Reelz
Reelz am 1 Mai 2012
Kommentiert: Image Analyst am 22 Sep. 2020
I want to design this:
The ski jump starts at a height of h feet and finishes at a launch point height of eh feet, where height is represented by the variable y. From the start (x = 0) to the launch point, the ski jump extends a horizontal distance of d feet. A skier using the jump will begin horizontally and will fly off the end at a sa degree angle from the horizontal. Develop the set of equations to determine the four coefficients of a cubic polynomial y = f(x) for the side
view of the ski jump that meets the specifications above. Write a script to compute and display these coefficients, using methods described in class to solve a set of linear equations.
I want to plot this as well.
Here's my code, its effed up though I need help on assigning these values because every try is a failure!
A = [ 0 0 0 1 ];
d^3 d^2 d 1;
0 0 1 0;
3*d^2 2*d 1 0];
b = [100; 10; 0; tan(30*pi/180)];
format short e;
c = A\bx == 0:d;
y = polyval(c,x);
plot(x,y)

Antworten (2)

Walter Roberson
Walter Roberson am 1 Mai 2012
Try removing the ']' from the first line. And make sure you define d before that first line.
You need to define your variable "bx".
Why are you comparing A\bx to the vector of integers from 0 to d ?

Leah
Leah am 1 Mai 2012
I'm pretty sure you want to set up A as the system of linear equations like this
A=[0 0 0 1; 1 1 1 1; 0 0 1 0; 3 2 1 0]
b = [100; 10; 0; tan(30*pi/180)];
c=A\b
d=4*pi
x=1:.1:d
y = polyval(c,x);
plot(x,y)
It also seems that x=0:d, the range you want to evaluate your polynomial over. I'm not sure what that is so i made up some numbers.
Like Walter said always make sure you define variable in the right order. You can't use them until you create them.
  2 Kommentare
Rahul Karelia
Rahul Karelia am 22 Sep. 2020
Thank you leah, can u show what kind of Graph you get when you run this Code ?
Image Analyst
Image Analyst am 22 Sep. 2020
It works, did you try it Rahul?
A = [0 0 0 1; 1 1 1 1; 0 0 1 0; 3 2 1 0]
b = [100; 10; 0; tan(30*pi/180)];
c = A\b
d = 4*pi
x = 1:.1:d
y = polyval(c,x);
plot(x,y, 'b-', 'LineWidth', 2);
xlabel('x', 'FontSize', 22);
ylabel('y', 'FontSize', 22);
title('y vs. x', 'FontSize', 22);
grid on;

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Polynomials finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by