For this problem, I am given the equation:
Solving for it by hand, I found the answer to be x(t) = (3/5)*e^(5*t) - (3/5)
From this, I would expect the graph to be an exponential curve that horizontally asymptotes at -(3/5) and cross the origin at (0,0)
However, when I inputted this into MATLAB using ode45, I got a graph that horizontally asymptotes at the x-axis and does not cross through the origin.
Its very possible that I messed up in the code for ode45 but I'm not sure where it occured. Here is the code I used:
hw0p4func = @(t,x) (5*x)+3;
time = [0 10];
initial = [0 0];
[t,x] = ode45(hw0p4func, time, initial);
plot(t,x(:,1)),title('Problem 4: x vs. time'),xlabel('time'),ylabel('x'),
For reference, this is what the graph should look like:
I'd like to know what exactly I've done wrong with my code here.