Star1976
Materials
- Jan 31, 2005
- 6
Hi Guys
Here is a challenging trick for you:
Suppos that you have this star.m file containg an ODE with the needed parameters:
function dC = star(t,C)
dC = zeros(1,1);
Gn=1;
N=2;
f=3;
w=4;
dC = (1/2)*Gn*N*C(1)+f*cos(w*t-C(1))
Now to solve this equation you simply create the following file:
t =linspace(0,5,100);
C0 = [0];
[t,C] = ode45('star', t, C0);
Now, the trick is how to solve this equation for a range of one of the given parameters (for example w=0,1,2,3,4,5,6). You will need to use for loop but the question is where to insert the loop ????
Here is a challenging trick for you:
Suppos that you have this star.m file containg an ODE with the needed parameters:
function dC = star(t,C)
dC = zeros(1,1);
Gn=1;
N=2;
f=3;
w=4;
dC = (1/2)*Gn*N*C(1)+f*cos(w*t-C(1))
Now to solve this equation you simply create the following file:
t =linspace(0,5,100);
C0 = [0];
[t,C] = ode45('star', t, C0);
Now, the trick is how to solve this equation for a range of one of the given parameters (for example w=0,1,2,3,4,5,6). You will need to use for loop but the question is where to insert the loop ????