Finding NDSolve method details The Next CEO of Stack OverflowHow to find out which method Mathematica selected?inspecting step size and order of $tt NDSolve$What does MaxStepFraction do?How does Mathematica resolve symbolic systems of inequalities?NDSolve and strange “nonlinear coefficients problem”The idea behind Stiffness switching method with NDsolveProblems when solving a nonlinear PDE system with NDSolveSingularity treatment in a simple problemPDEs : automatic method choice : TensorProductGrid or FiniteElement?NDSolve struggling with tricky boundary conditionsNDSolve and memory usedDetails of NDSolve calling LSODA

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

Display a text message if the shortcode is not found?

How to scale a tikZ image which is within a figure environment

Is French Guiana a (hard) EU border?

What connection does MS Office have to Netscape Navigator?

Why is my new battery behaving weirdly?

unclear about Dynamic Binding

Plot of histogram similar to output from @risk

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Does increasing your ability score affect your main stat?

Recycling old answers

Is it professional to write unrelated content in an almost-empty email?

Does falling count as part of my movement?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

I want to make a picture in physics with TikZ. Can you help me?

Received an invoice from my ex-employer billing me for training; how to handle?

Need help understanding a power circuit (caps and diodes)

Why do remote US companies require working in the US?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Is it okay to majorly distort historical facts while writing a fiction story?

Chain wire methods together in Lightning Web Components

What happened in Rome, when the western empire "fell"?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

What did we know about the Kessel run before the prologues?



Finding NDSolve method details



The Next CEO of Stack OverflowHow to find out which method Mathematica selected?inspecting step size and order of $tt NDSolve$What does MaxStepFraction do?How does Mathematica resolve symbolic systems of inequalities?NDSolve and strange “nonlinear coefficients problem”The idea behind Stiffness switching method with NDsolveProblems when solving a nonlinear PDE system with NDSolveSingularity treatment in a simple problemPDEs : automatic method choice : TensorProductGrid or FiniteElement?NDSolve struggling with tricky boundary conditionsNDSolve and memory usedDetails of NDSolve calling LSODA










4












$begingroup$


I have eqs about the NDSolve, I know this code given the solving automatically.



How can I find out what method is used behind the scenes? How can I gauge the reliability level, find how many iterations have been used, the order of method. How can I estimate the error?



I found hints on this site, but I still do not fully understand.



It is impossible to say NDSolve has automatically solution for publishing paper?



I used this code related to my system:



r = 0.431201; β = 2.99 *10^-6; σ = 0.7; δ = 0.57;
m = 0.3, η = 0.1, μ = 0.1, ρ = 0.3;


S = N1'[t] == r N1[t] (1 - β N1[t]) - η N1[t] I1[t],
I1'[t] == σ + (ρ N1[t] I1[t])/( m + N1[t]) - δ I1[t] - μ N1[t] I1[t];

c = N1[0] == 1, I1[0] == 1.22;

Select[Flatten[
Trace[
NDSolve[S, c, N1, I1, t, 0, 30],
TraceInternal -> True]],
!FreeQ[#, Method | NDSolve`MethodData] &]


but I don't understand the output.










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Partial duplicate: mathematica.stackexchange.com/questions/145/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:17






  • 1




    $begingroup$
    Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:37






  • 1




    $begingroup$
    You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
    $endgroup$
    – Michael E2
    Mar 24 at 1:44






  • 2




    $begingroup$
    "It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
    $endgroup$
    – xzczd
    Mar 24 at 3:39






  • 3




    $begingroup$
    Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
    $endgroup$
    – xzczd
    Mar 24 at 3:59















4












$begingroup$


I have eqs about the NDSolve, I know this code given the solving automatically.



How can I find out what method is used behind the scenes? How can I gauge the reliability level, find how many iterations have been used, the order of method. How can I estimate the error?



I found hints on this site, but I still do not fully understand.



It is impossible to say NDSolve has automatically solution for publishing paper?



I used this code related to my system:



r = 0.431201; β = 2.99 *10^-6; σ = 0.7; δ = 0.57;
m = 0.3, η = 0.1, μ = 0.1, ρ = 0.3;


S = N1'[t] == r N1[t] (1 - β N1[t]) - η N1[t] I1[t],
I1'[t] == σ + (ρ N1[t] I1[t])/( m + N1[t]) - δ I1[t] - μ N1[t] I1[t];

c = N1[0] == 1, I1[0] == 1.22;

Select[Flatten[
Trace[
NDSolve[S, c, N1, I1, t, 0, 30],
TraceInternal -> True]],
!FreeQ[#, Method | NDSolve`MethodData] &]


but I don't understand the output.










share|improve this question











$endgroup$







  • 2




    $begingroup$
    Partial duplicate: mathematica.stackexchange.com/questions/145/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:17






  • 1




    $begingroup$
    Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:37






  • 1




    $begingroup$
    You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
    $endgroup$
    – Michael E2
    Mar 24 at 1:44






  • 2




    $begingroup$
    "It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
    $endgroup$
    – xzczd
    Mar 24 at 3:39






  • 3




    $begingroup$
    Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
    $endgroup$
    – xzczd
    Mar 24 at 3:59













4












4








4


0



$begingroup$


I have eqs about the NDSolve, I know this code given the solving automatically.



How can I find out what method is used behind the scenes? How can I gauge the reliability level, find how many iterations have been used, the order of method. How can I estimate the error?



I found hints on this site, but I still do not fully understand.



It is impossible to say NDSolve has automatically solution for publishing paper?



I used this code related to my system:



r = 0.431201; β = 2.99 *10^-6; σ = 0.7; δ = 0.57;
m = 0.3, η = 0.1, μ = 0.1, ρ = 0.3;


S = N1'[t] == r N1[t] (1 - β N1[t]) - η N1[t] I1[t],
I1'[t] == σ + (ρ N1[t] I1[t])/( m + N1[t]) - δ I1[t] - μ N1[t] I1[t];

c = N1[0] == 1, I1[0] == 1.22;

Select[Flatten[
Trace[
NDSolve[S, c, N1, I1, t, 0, 30],
TraceInternal -> True]],
!FreeQ[#, Method | NDSolve`MethodData] &]


but I don't understand the output.










share|improve this question











$endgroup$




I have eqs about the NDSolve, I know this code given the solving automatically.



How can I find out what method is used behind the scenes? How can I gauge the reliability level, find how many iterations have been used, the order of method. How can I estimate the error?



I found hints on this site, but I still do not fully understand.



It is impossible to say NDSolve has automatically solution for publishing paper?



I used this code related to my system:



r = 0.431201; β = 2.99 *10^-6; σ = 0.7; δ = 0.57;
m = 0.3, η = 0.1, μ = 0.1, ρ = 0.3;


S = N1'[t] == r N1[t] (1 - β N1[t]) - η N1[t] I1[t],
I1'[t] == σ + (ρ N1[t] I1[t])/( m + N1[t]) - δ I1[t] - μ N1[t] I1[t];

c = N1[0] == 1, I1[0] == 1.22;

Select[Flatten[
Trace[
NDSolve[S, c, N1, I1, t, 0, 30],
TraceInternal -> True]],
!FreeQ[#, Method | NDSolve`MethodData] &]


but I don't understand the output.







differential-equations implementation-details






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 4:14









xzczd

27.4k573255




27.4k573255










asked Mar 24 at 1:09









sana alharbisana alharbi

456




456







  • 2




    $begingroup$
    Partial duplicate: mathematica.stackexchange.com/questions/145/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:17






  • 1




    $begingroup$
    Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:37






  • 1




    $begingroup$
    You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
    $endgroup$
    – Michael E2
    Mar 24 at 1:44






  • 2




    $begingroup$
    "It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
    $endgroup$
    – xzczd
    Mar 24 at 3:39






  • 3




    $begingroup$
    Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
    $endgroup$
    – xzczd
    Mar 24 at 3:59












  • 2




    $begingroup$
    Partial duplicate: mathematica.stackexchange.com/questions/145/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:17






  • 1




    $begingroup$
    Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
    $endgroup$
    – Michael E2
    Mar 24 at 1:37






  • 1




    $begingroup$
    You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
    $endgroup$
    – Michael E2
    Mar 24 at 1:44






  • 2




    $begingroup$
    "It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
    $endgroup$
    – xzczd
    Mar 24 at 3:39






  • 3




    $begingroup$
    Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
    $endgroup$
    – xzczd
    Mar 24 at 3:59







2




2




$begingroup$
Partial duplicate: mathematica.stackexchange.com/questions/145/…
$endgroup$
– Michael E2
Mar 24 at 1:17




$begingroup$
Partial duplicate: mathematica.stackexchange.com/questions/145/…
$endgroup$
– Michael E2
Mar 24 at 1:17




1




1




$begingroup$
Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
$endgroup$
– Michael E2
Mar 24 at 1:37




$begingroup$
Another partial duplicate: mathematica.stackexchange.com/questions/102704/…
$endgroup$
– Michael E2
Mar 24 at 1:37




1




1




$begingroup$
You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
$endgroup$
– Michael E2
Mar 24 at 1:44




$begingroup$
You say you don't understand some technique or other, nor the output of your Trace[] command. But the first is a very general statement about things already explained and the second is about a command that no one else can reproduce
$endgroup$
– Michael E2
Mar 24 at 1:44




2




2




$begingroup$
"It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
$endgroup$
– xzczd
Mar 24 at 3:39




$begingroup$
"It is impossible to say NDSolve has automatically solution for publishing paper. " Simply saying "I've used NDSolve function of software Mathematica" is enough in many cases, AFAIK.
$endgroup$
– xzczd
Mar 24 at 3:39




3




3




$begingroup$
Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
$endgroup$
– xzczd
Mar 24 at 3:59




$begingroup$
Well, if the reviewer insists on such stuff, given that your system isn't that difficult, a possible workaround at this point is to choose a primary method like classical RK4 to solve the problem. The way to choose classical RK4 in NDSolve can be found in tutorial/NDSolveExplicitRungeKutta#1456351317, then you just need to set Method -> "ExplicitRungeKutta", "DifferenceOrder" -> 4, "Coefficients" -> ClassicalRungeKuttaCoefficients, StartingStepSize -> 1/20000, MaxSteps -> Infinity in NDSolve. The solving process is slower but gives the same result as given by default.
$endgroup$
– xzczd
Mar 24 at 3:59










1 Answer
1






active

oldest

votes


















6












$begingroup$

Comment



In response to your question, you already got very valuable comments. I will just try to comment on




How can I estimate the error?




For this I am going to plot residual error at steps and time, which will show the reliability and accuracy of NDSolve,



r = 0.431201; [Beta] = 2.99*10^-6; [Sigma] = 0.7; [Delta] = 0.57;
m = 0.3; [Eta] = 0.1; [Mu] = 0.1; [Rho] = 0.3;

ode = N1'[t] == r N1[t] (1 - [Beta] N1[t]) - [Eta] N1[t] I1[t],
I1'[t] == [Sigma] + ([Rho] N1[t] I1[t])/(m + N1[t]) - [Delta] I1[t] - [Mu] N1[t] I1[t];

bcs = N1[0] == 1, I1[0] == 1.22;

residuals = ode /. Equal -> Subtract;

s = NDSolve[ode, bcs, N1, I1, t, 20, InterpolationOrder -> All];

N1["Coordinates"] /. s;

residuals /. t -> N1["Coordinates"] /. s;

ListPlot[Abs[Flatten /@ (residuals /. t -> N1["Coordinates"] /. s)], Frame -> True]


enter image description here



With[data = Table[t, Abs@residuals[[1]] /. s, t, N1["Coordinates"] /. s // Flatten], 
ListLogPlot[data, Frame -> True, PlotRange -> All]]


enter image description here



Note: I adopted the above from this website but unable to find the link.






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
    $endgroup$
    – sana alharbi
    Mar 24 at 9:13











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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
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%2f193858%2ffinding-ndsolve-method-details%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









6












$begingroup$

Comment



In response to your question, you already got very valuable comments. I will just try to comment on




How can I estimate the error?




For this I am going to plot residual error at steps and time, which will show the reliability and accuracy of NDSolve,



r = 0.431201; [Beta] = 2.99*10^-6; [Sigma] = 0.7; [Delta] = 0.57;
m = 0.3; [Eta] = 0.1; [Mu] = 0.1; [Rho] = 0.3;

ode = N1'[t] == r N1[t] (1 - [Beta] N1[t]) - [Eta] N1[t] I1[t],
I1'[t] == [Sigma] + ([Rho] N1[t] I1[t])/(m + N1[t]) - [Delta] I1[t] - [Mu] N1[t] I1[t];

bcs = N1[0] == 1, I1[0] == 1.22;

residuals = ode /. Equal -> Subtract;

s = NDSolve[ode, bcs, N1, I1, t, 20, InterpolationOrder -> All];

N1["Coordinates"] /. s;

residuals /. t -> N1["Coordinates"] /. s;

ListPlot[Abs[Flatten /@ (residuals /. t -> N1["Coordinates"] /. s)], Frame -> True]


enter image description here



With[data = Table[t, Abs@residuals[[1]] /. s, t, N1["Coordinates"] /. s // Flatten], 
ListLogPlot[data, Frame -> True, PlotRange -> All]]


enter image description here



Note: I adopted the above from this website but unable to find the link.






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
    $endgroup$
    – sana alharbi
    Mar 24 at 9:13















6












$begingroup$

Comment



In response to your question, you already got very valuable comments. I will just try to comment on




How can I estimate the error?




For this I am going to plot residual error at steps and time, which will show the reliability and accuracy of NDSolve,



r = 0.431201; [Beta] = 2.99*10^-6; [Sigma] = 0.7; [Delta] = 0.57;
m = 0.3; [Eta] = 0.1; [Mu] = 0.1; [Rho] = 0.3;

ode = N1'[t] == r N1[t] (1 - [Beta] N1[t]) - [Eta] N1[t] I1[t],
I1'[t] == [Sigma] + ([Rho] N1[t] I1[t])/(m + N1[t]) - [Delta] I1[t] - [Mu] N1[t] I1[t];

bcs = N1[0] == 1, I1[0] == 1.22;

residuals = ode /. Equal -> Subtract;

s = NDSolve[ode, bcs, N1, I1, t, 20, InterpolationOrder -> All];

N1["Coordinates"] /. s;

residuals /. t -> N1["Coordinates"] /. s;

ListPlot[Abs[Flatten /@ (residuals /. t -> N1["Coordinates"] /. s)], Frame -> True]


enter image description here



With[data = Table[t, Abs@residuals[[1]] /. s, t, N1["Coordinates"] /. s // Flatten], 
ListLogPlot[data, Frame -> True, PlotRange -> All]]


enter image description here



Note: I adopted the above from this website but unable to find the link.






share|improve this answer









$endgroup$












  • $begingroup$
    Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
    $endgroup$
    – sana alharbi
    Mar 24 at 9:13













6












6








6





$begingroup$

Comment



In response to your question, you already got very valuable comments. I will just try to comment on




How can I estimate the error?




For this I am going to plot residual error at steps and time, which will show the reliability and accuracy of NDSolve,



r = 0.431201; [Beta] = 2.99*10^-6; [Sigma] = 0.7; [Delta] = 0.57;
m = 0.3; [Eta] = 0.1; [Mu] = 0.1; [Rho] = 0.3;

ode = N1'[t] == r N1[t] (1 - [Beta] N1[t]) - [Eta] N1[t] I1[t],
I1'[t] == [Sigma] + ([Rho] N1[t] I1[t])/(m + N1[t]) - [Delta] I1[t] - [Mu] N1[t] I1[t];

bcs = N1[0] == 1, I1[0] == 1.22;

residuals = ode /. Equal -> Subtract;

s = NDSolve[ode, bcs, N1, I1, t, 20, InterpolationOrder -> All];

N1["Coordinates"] /. s;

residuals /. t -> N1["Coordinates"] /. s;

ListPlot[Abs[Flatten /@ (residuals /. t -> N1["Coordinates"] /. s)], Frame -> True]


enter image description here



With[data = Table[t, Abs@residuals[[1]] /. s, t, N1["Coordinates"] /. s // Flatten], 
ListLogPlot[data, Frame -> True, PlotRange -> All]]


enter image description here



Note: I adopted the above from this website but unable to find the link.






share|improve this answer









$endgroup$



Comment



In response to your question, you already got very valuable comments. I will just try to comment on




How can I estimate the error?




For this I am going to plot residual error at steps and time, which will show the reliability and accuracy of NDSolve,



r = 0.431201; [Beta] = 2.99*10^-6; [Sigma] = 0.7; [Delta] = 0.57;
m = 0.3; [Eta] = 0.1; [Mu] = 0.1; [Rho] = 0.3;

ode = N1'[t] == r N1[t] (1 - [Beta] N1[t]) - [Eta] N1[t] I1[t],
I1'[t] == [Sigma] + ([Rho] N1[t] I1[t])/(m + N1[t]) - [Delta] I1[t] - [Mu] N1[t] I1[t];

bcs = N1[0] == 1, I1[0] == 1.22;

residuals = ode /. Equal -> Subtract;

s = NDSolve[ode, bcs, N1, I1, t, 20, InterpolationOrder -> All];

N1["Coordinates"] /. s;

residuals /. t -> N1["Coordinates"] /. s;

ListPlot[Abs[Flatten /@ (residuals /. t -> N1["Coordinates"] /. s)], Frame -> True]


enter image description here



With[data = Table[t, Abs@residuals[[1]] /. s, t, N1["Coordinates"] /. s // Flatten], 
ListLogPlot[data, Frame -> True, PlotRange -> All]]


enter image description here



Note: I adopted the above from this website but unable to find the link.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 24 at 5:09









zhkzhk

10.1k11533




10.1k11533











  • $begingroup$
    Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
    $endgroup$
    – sana alharbi
    Mar 24 at 9:13
















  • $begingroup$
    Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
    $endgroup$
    – sana alharbi
    Mar 24 at 9:13















$begingroup$
Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
$endgroup$
– sana alharbi
Mar 24 at 9:13




$begingroup$
Thank you so much @zhk but how can defend the axes for both figures? the first as x represented steps and y residual error. the second one x represents the t time and y residual error. sorry if my question is trivial but it is first time to see the code
$endgroup$
– sana alharbi
Mar 24 at 9:13

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193858%2ffinding-ndsolve-method-details%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Luettelo Yhdysvaltain laivaston lentotukialuksista Lähteet | Navigointivalikko

Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

Gary (muusikko) Sisällysluettelo Historia | Rockin' High | Lähteet | Aiheesta muualla | NavigointivalikkoInfobox OKTuomas "Gary" Keskinen Ancaran kitaristiksiProjekti Rockin' High