- #1
mazgan
- 5
- 0
i just signed up here so i hope this is the right place.
i need to solve a set of 2 non-linear ordinary differencial equations.
i tryed using NDSolve but it doesn't really work so I am not sure what's wrong with my code.
here is my code (copy paste):
c = 0.1;
Subscript[sys,
B] = {2*m[t]*(m'[t])*
Sin [\[Lambda][t]] + ((m[t])^2 )*(\[Lambda]'[t])*
Cos[\[Lambda][t]] == -(c/(4*m[t]))*Tan[\[Lambda][t]/2],
m'[t] == -(c/ (16*(m[t]^2)))*( Tan[\[Lambda][t]/2]^2),
Sin[\[Lambda][0]] == 0.95, m[0] == 1};
Subscript[sol, B] = NDSolve[Subscript[sys, B], {m}, t]
Plot[m[t], {t, 0, 50}]
as u can see from the code the equations are:
(1) 2*m*m'*sinλ+m^2*λ'*cosλ = -(c/4m)*tan(λ/2)
(2) m' = -(c/16m^2)*(tan(λ/2))^2
where c=0.1 and also its known that:
sin(λ(t=0))=0.95
m(t=0)=1
i want to find m(t).
i need to solve a set of 2 non-linear ordinary differencial equations.
i tryed using NDSolve but it doesn't really work so I am not sure what's wrong with my code.
here is my code (copy paste):
c = 0.1;
Subscript[sys,
B] = {2*m[t]*(m'[t])*
Sin [\[Lambda][t]] + ((m[t])^2 )*(\[Lambda]'[t])*
Cos[\[Lambda][t]] == -(c/(4*m[t]))*Tan[\[Lambda][t]/2],
m'[t] == -(c/ (16*(m[t]^2)))*( Tan[\[Lambda][t]/2]^2),
Sin[\[Lambda][0]] == 0.95, m[0] == 1};
Subscript[sol, B] = NDSolve[Subscript[sys, B], {m}, t]
Plot[m[t], {t, 0, 50}]
as u can see from the code the equations are:
(1) 2*m*m'*sinλ+m^2*λ'*cosλ = -(c/4m)*tan(λ/2)
(2) m' = -(c/16m^2)*(tan(λ/2))^2
where c=0.1 and also its known that:
sin(λ(t=0))=0.95
m(t=0)=1
i want to find m(t).