# Question:maple programming

October 14 2013
Maple

1

I am try to program a proc that will plot the kinematic equations.

kinematics := proc(a::procedure, t::name, s0::numeric, v0::numeric, t0::numeric, t1:: numeric)

local v:=t->v0+int(a(t),t);

local s:=t->s0+int(v(t),t);

plot([a(t),v(t),s(t)], t=t0..t1);

end proc;

the above is my code, which works ok.

Note: a is acceleration function, v is velocity function, s is position function, t is independent variable, s0 is initial position, v0 is initial velocity, t0 is initial time, t1 is final time.

I want to graph these all on one plot.

So, The only catch is I want to force v(t0)=v0 and s(to)=s0. I dont know how to do this.

For example if i input 5 for t0 I want the graph to start at t0=5 with the same values as it would with t0=0.

Also, what has given me some problems is if a(t)=cos(t), then v(t)=sin(t), and s(t)=-cos(t). However if I input s0=-1 than with the above code, s(0) = -1 - cos(0) = -2, but I dont want this... I want it to be s(t0=0)=-1, not -2. How can I do this? I hope this makes sense...

Thanks!

﻿