Taking long time to give output

The name of the pictureThe name of the pictureThe name of the pictureClash 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]









share|improve this question























  • I changed. Is it clear?
    – Tharaka
    5 hours ago














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]









share|improve this question























  • I changed. Is it clear?
    – Tharaka
    5 hours ago












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]









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









kglr

167k8188390




167k8188390










asked 6 hours ago









Tharaka

144




144











  • 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




I changed. Is it clear?
– Tharaka
5 hours ago










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]


enter image description here



which appears to finish in about a minute.



Please check this very carefully to make certain that it is correct.






share|improve this answer
















  • 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











  • Thank you very much
    – Tharaka
    3 hours ago










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























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]


enter image description here



which appears to finish in about a minute.



Please check this very carefully to make certain that it is correct.






share|improve this answer
















  • 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











  • Thank you very much
    – Tharaka
    3 hours ago














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]


enter image description here



which appears to finish in about a minute.



Please check this very carefully to make certain that it is correct.






share|improve this answer
















  • 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











  • Thank you very much
    – Tharaka
    3 hours ago












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]


enter image description here



which appears to finish in about a minute.



Please check this very carefully to make certain that it is correct.






share|improve this answer












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]


enter image description here



which appears to finish in about a minute.



Please check this very carefully to make certain that it is correct.







share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









Bill

5,13058




5,13058







  • 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











  • Thank you very much
    – Tharaka
    3 hours ago












  • 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











  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

One-line joke