Skip to content
Permalink
5fb812a296
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
44 lines (22 sloc) 784 Bytes
function [ output_args ] = myODE( input_args )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
% u = matrix of vectors [v, theta, x, y]
% use Euler method: solve at initial coditions + time step, set that as new initial conditions, repeat
tstep = 1; % set time step for Euler method
t = [0:tstep:100]; % time vector (seconds)
[TOUT,YOUT] = ode23(dv_dt,[0 100],y0);
plot(TOUT, YOUT);
%axis([0 1 0 3]) % set axis limits
% plan: optimize in v, then theta, then v, then theta...
%{
v = u[0]
theta = u[1]
x = u[2]
y = u[3]
return numpy.array([-g*sin(theta) - C_D/C_L*g/v_t**2*v**2,
-g*cos(theta)/v + g/v_t**2*v,
v*cos(theta),
v*sin(theta)])
%}
end