From: Patrick on
Trying to to figure out why my code wont output a plot... any help from willing debuggers out there. Simple code.

function running_stride_2

w = input ('Please enter the weight of the runner (lbs): ');
% w= weight of the runner
a = 9.8;
m=((w*0.45359237)/a);
disp ('Please enter the shoe of the runner :');
% s = shoe of the runner
disp ('1 = Nike');
disp ('2 = Adidas');
disp ('3 = Asics');
disp ('4 = New Balance');
s = input( 'Shoe brand: ');
% various shoes have various spring constants and damping coefficients
if (s == 1);
c = 41.96;
k = 41957.30;
end;
if (s == 2);
c = 30.44;
k = 23435.61;
end;
if (s == 3);
c = 44.34;
k = 29483.51;
end;
if (s == 4);
c = 31.42;
k = 26081.56;
end;
v = input ('Please enter the speed of the runner (0-15m/s):');
% xdot = velocity of the runner
if (v >= 0 || v <= 4);
x = 2/1000;
pheta = (0.261799388:0.01:-0.261799388);
end;
if (v >= 5 || v <= 8);
x = 3.5/1000;
pheta = (0.34906585:0.01:-0.34906585);
end;
if (v >= 9 || v <= 15);
x = 5/1000;
pheta = (0.436332313:0.01:-0.436332313);
end;

mu = 0.65;

%Horizontal Forces
Fh = m*a*sin(pheta)-c*v*sin(pheta)-k*x*sin(pheta)-mu*m*a*cos(pheta)

%Vertical Forces
Fv = m*a*cos(pheta)-(m*a*cos(pheta)-c*v*cos(pheta)-k*x*cos(pheta))

%Horizontal Force Plots
subplot(2,1,1);
axis([-4, 4, -1000, 1000]);
plot(pheta, Fh)
ylabel('Force')
xlabel('Stride Progression')

%Vertical Force Plots
subplot(2,1,2);
axis([-4, 4, -1000, 1000]);
plot(pheta, Fv)
ylabel('Force')
xlabel('Stride Progression')
From: Justus Skorps on
> if (v >= 9 || v <= 15);

do you really want the condition in that way? And btw what for speeds
like 8.5?

> pheta = (0.436332313:0.01:-0.436332313);

rtfm how vectors are defined...


From: Patrick on
Justus Skorps <jussa(a)gmx.de> wrote in message <7525f739-902f-478b-8b8d-621531e26209(a)33g2000yqj.googlegroups.com>...
> > if (v >= 9 || v <= 15);
>
> do you really want the condition in that way? And btw what for speeds
> like 8.5?
>
> > pheta = (0.436332313:0.01:-0.436332313);
>
> rtfm how vectors are defined...
>
Thanks for the catch on the speeds.

I am not sure what you mean by 'how are the vectors defined?' which ones are you referring to?
From: Justus Skorps on
On 11 Mrz., 07:07, "Patrick " <pj...(a)drexel.edu> wrote:

> I am not sure what you mean by 'how are the vectors defined?' which ones are you referring to?

I refering to your definition of pheta...you define the start value,
the incremental value and the end value. Take a look on your choices
and figure out why that cannnot work...