How to specifiy time in step size using ODE45?
Show older comments
Hello, I was looking for some help with my homework. Right now my attached code answers the following ode, where the unit step (de) is equal to one degree. I need to make the step size last for a duration of one second. I was wondering how I specify the length of the unit step. For clarification the code is setting up two constant matrices A (4x4) and B(4x1) to take the form: y'=(A*y)+ (B*de). Any help is appreciated. Thanks.
clear,clc
l1 = [-0.0453,0.0363,0,-0.183];
l2 = [-0.3717,-2.0354,1,0];
l3 = [0.3398,-7.0301,-2.9767,0];
l4 = [0,0,1,0];
A = [l1;l2;l3;l4];
B = [0;-0.1609;-11.8674;0];
de = 1;
y0 = [0;0;0;0];
F = @(t,y) A*y+B*de;
[t,y] = ode45(F,[0 200], y0,options);
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!