I made a couple small changes that are not working either but I am my thought is that I was originally trying to skip a step would i need to do 3 different ode45 to find the variables [t,r] [t,T] and [t,z]. Then I could potentially do a pol2cart of and plot the the [x,y,z]
b = 2;
aspect = 0.5;
c = 3;
a = 2;
r = 2;
T = 0.1;
z = 5;
t = 0;
n = 50000;
Init_cond = 1;
tspan = [0 n];
% The values above are not the final values I am currently reseaching
% What they represent and trying to determine an appropate model
% They will be updated soon
[t,r] = ode45(@odeFun, tspan, Init_cond);
[t,T] = ode45(@odeFun, tspan, Init_cond);
[t,z] = ode45(@odeFun, tspan, Init_cond);
% using the matlab funciton ode45 I want it to output the variables r,T,z
% input function is odeFun which is equal to the velocity functions
% origianlly provided
% Initial condition is just so for all variables so r, T and z = 0 when
% time equals zero
function dVdt = odeFun(r,T,z);
b = 2;
aspect = 0.5;
c = 3;
a = 2;
r(1) = 0; % initial conditions
T(1) = 0; % initial conditions
z(1) = 0; % initial conditions
dVdt = zeros(3,2,1);
dVdt(1) = @(r,T,z) r*(z-b)/aspect; % Velocity in the radius
dVdt(2) = @(r,T,z) c; % Velocity in the Theta
dVdt(3) = @(r,T,z) z*(1-a*r); % Velocity in the z direction
end