Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Differential equation with different parameter' topicStudent Support Forum > General > Archives > "Differential equation with different parameter"

Next Comment >Help | Reply To Topic
Author Comment/Response
streetlife
02/01/13 04:49am

I want to make my calculation faster, till now I make it as follows:
For[i = 1, i < 6, i++,
For[j = 1, j < 6, j++,
k[i, j] =
Plot[{Im@
Evaluate[
g[x] /. NDSolve[{g'[t] ==
0.0001 + (-10/((i*2)^2) +
2*j*I*HeavisideTheta[20 - t]*Sin[t] + I*20 +
2*j*I*HeavisideTheta[t - 20]*Sin[20] + g[t])*g[t],
g[0] == 0}, g, {t, 0, 61}]],
Re@Evaluate[
g[x] /. NDSolve[{g'[t] ==
0.0001 + (-10/((2*i)^2) +
2*j*I*HeavisideTheta[20 - t]*Sin[t] + I*20 +
2*j*I*HeavisideTheta[t - 20]*Sin[20] + g[t])*g[t],
g[0] == 0}, g, {t, 0, 61}]]}, {x, 0, 60},
PlotStyle -> Thick, PlotRange -> All , ImageSize -> Medium,
PlotLabel -> Nummer[i, j]]]]

That works, but is very slow, I suppose that because the differential equation has to be computed twice. How can I build this for-loop, so that the differential equation (for fixed i,j) is solved only once?

URL: ,

Subject (listing for 'Differential equation with different parameter')
Author Date Posted
Differential equation with different parameter streetlife 02/01/13 04:49am
Re: Differential equation with different parame... Peter Pein 02/05/13 06:07am
Next Comment >Help | Reply To Topic