Question: How to find a specific value of dsolve

I want to solve the position of a bal with a variable angel of the start velocity. I want to know which angle I have to take when the ball must be in a fully known position (5.44 , 1.60).I must also take the friction into account.

Therefore I have a system of equitations that I can solve with dsolve if I fill in the angle (in degrees).

> dsolve(eval(stlsl,angle = angeltest), numeric);

It gives me back values in x(t) and y(t). But know I want to make a function with a while-loop that gives me back the angle that I have to take.

I tought of something like this:

 

angletest := 0;

found :=0;

while (found == 0) do

angeltest := angeltest + 1:

opl:=dsolve(eval(stlsl,angle = angeltest), numeric);

//Code to get a value of y(t) when I give the value of x(t) of the function opl and store it in ypos

if (.55 < ypos < .60) then

 found := 1:

end do:

 

Can somebody help me with that statement?

I already found something like these:

p:= dsolve({D(y)(x) = y(x), y(0)=1}, numeric, output=Array([-1,-0.8,-0.6,-0.4,-0.2,0])):
myplot := plots[odeplot](p):
plottools[getdata](myplot, "curve")[-1];

But how do I get 1 single point of it?

 

Thank you very much,

 

Wimvr

 

Please Wait...