Permalink
Cannot retrieve contributors at this time
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?
paper_airplane/myODE
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44 lines (22 sloc)
784 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |