Taking long time to give output
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Following code does not give any output. I kept it running for nearly 6 hours does but it does not give the output. What is the wrong with that?
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020
g2 = Plot[Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/ E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c* Sqrt[x - b]*
((Pi*(Sqrt[d]/Sqrt[x - b])*Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/
Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y],
y, 0, 1.4, PlotStyle -> Black, PlotRange -> All]
plotting
add a comment |Â
up vote
1
down vote
favorite
Following code does not give any output. I kept it running for nearly 6 hours does but it does not give the output. What is the wrong with that?
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020
g2 = Plot[Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/ E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c* Sqrt[x - b]*
((Pi*(Sqrt[d]/Sqrt[x - b])*Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/
Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y],
y, 0, 1.4, PlotStyle -> Black, PlotRange -> All]
plotting
I changed. Is it clear?
– Tharaka
5 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Following code does not give any output. I kept it running for nearly 6 hours does but it does not give the output. What is the wrong with that?
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020
g2 = Plot[Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/ E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c* Sqrt[x - b]*
((Pi*(Sqrt[d]/Sqrt[x - b])*Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/
Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y],
y, 0, 1.4, PlotStyle -> Black, PlotRange -> All]
plotting
Following code does not give any output. I kept it running for nearly 6 hours does but it does not give the output. What is the wrong with that?
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020
g2 = Plot[Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/ E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c* Sqrt[x - b]*
((Pi*(Sqrt[d]/Sqrt[x - b])*Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/
Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y],
y, 0, 1.4, PlotStyle -> Black, PlotRange -> All]
plotting
plotting
edited 4 hours ago
kglr
167k8188390
167k8188390
asked 6 hours ago
Tharaka
144
144
I changed. Is it clear?
– Tharaka
5 hours ago
add a comment |Â
I changed. Is it clear?
– Tharaka
5 hours ago
I changed. Is it clear?
– Tharaka
5 hours ago
I changed. Is it clear?
– Tharaka
5 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
Try this
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020;
f = Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c*Sqrt[x - b]*((Pi*(Sqrt[d]/Sqrt[x - b])*
Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y];
g2 = Plot[f, y, 0, 1.4, PlotRange -> All]
which appears to finish in about a minute.
Please check this very carefully to make certain that it is correct.
2
You could also wrapEvaluate
around yourConvolve[...]
and get about the same speedup. Either precomputingf
or usingEvaluate
will do most of the calculation once and then letPlot
use that result, instead of havingPlot
repeat most or all of theConvolve
calculation again and again for every one of hundreds or thousands of points.
– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Try this
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020;
f = Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c*Sqrt[x - b]*((Pi*(Sqrt[d]/Sqrt[x - b])*
Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y];
g2 = Plot[f, y, 0, 1.4, PlotRange -> All]
which appears to finish in about a minute.
Please check this very carefully to make certain that it is correct.
2
You could also wrapEvaluate
around yourConvolve[...]
and get about the same speedup. Either precomputingf
or usingEvaluate
will do most of the calculation once and then letPlot
use that result, instead of havingPlot
repeat most or all of theConvolve
calculation again and again for every one of hundreds or thousands of points.
– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
add a comment |Â
up vote
2
down vote
Try this
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020;
f = Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c*Sqrt[x - b]*((Pi*(Sqrt[d]/Sqrt[x - b])*
Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y];
g2 = Plot[f, y, 0, 1.4, PlotRange -> All]
which appears to finish in about a minute.
Please check this very carefully to make certain that it is correct.
2
You could also wrapEvaluate
around yourConvolve[...]
and get about the same speedup. Either precomputingf
or usingEvaluate
will do most of the calculation once and then letPlot
use that result, instead of havingPlot
repeat most or all of theConvolve
calculation again and again for every one of hundreds or thousands of points.
– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Try this
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020;
f = Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c*Sqrt[x - b]*((Pi*(Sqrt[d]/Sqrt[x - b])*
Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y];
g2 = Plot[f, y, 0, 1.4, PlotRange -> All]
which appears to finish in about a minute.
Please check this very carefully to make certain that it is correct.
Try this
a = 40.397;
b = 0.525;
c = 0.015000098827516313;
d = 0.000000001;
δ = 0.0095;
à = 0.020;
f = Convolve[Re[Erfc[(δ + I*x)/(Sqrt[2]*Ã)]/E^((x - I*δ)^2/(2*Ã^2))],
a*UnitStep[x - b]*c*Sqrt[x - b]*((Pi*(Sqrt[d]/Sqrt[x - b])*
Exp[Pi*(Sqrt[d]/Sqrt[x - b])])/Sinh[Pi*(Sqrt[d]/Sqrt[x - b])]) +
a*d*Sum[((4*Pi)/n^3)*DiracDelta[x - b + d/n^2], n, 1, 1], x, y];
g2 = Plot[f, y, 0, 1.4, PlotRange -> All]
which appears to finish in about a minute.
Please check this very carefully to make certain that it is correct.
answered 4 hours ago
Bill
5,13058
5,13058
2
You could also wrapEvaluate
around yourConvolve[...]
and get about the same speedup. Either precomputingf
or usingEvaluate
will do most of the calculation once and then letPlot
use that result, instead of havingPlot
repeat most or all of theConvolve
calculation again and again for every one of hundreds or thousands of points.
– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
add a comment |Â
2
You could also wrapEvaluate
around yourConvolve[...]
and get about the same speedup. Either precomputingf
or usingEvaluate
will do most of the calculation once and then letPlot
use that result, instead of havingPlot
repeat most or all of theConvolve
calculation again and again for every one of hundreds or thousands of points.
– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
2
2
You could also wrap
Evaluate
around your Convolve[...]
and get about the same speedup. Either precomputing f
or using Evaluate
will do most of the calculation once and then let Plot
use that result, instead of having Plot
repeat most or all of the Convolve
calculation again and again for every one of hundreds or thousands of points.– Bill
3 hours ago
You could also wrap
Evaluate
around your Convolve[...]
and get about the same speedup. Either precomputing f
or using Evaluate
will do most of the calculation once and then let Plot
use that result, instead of having Plot
repeat most or all of the Convolve
calculation again and again for every one of hundreds or thousands of points.– Bill
3 hours ago
Thank you very much
– Tharaka
3 hours ago
Thank you very much
– Tharaka
3 hours ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184321%2ftaking-long-time-to-give-output%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I changed. Is it clear?
– Tharaka
5 hours ago