Vector-valued ParametricNDSolve, solving for a combinationVector ParametricNDSolve and FindRoot interactionIs it possible to give the closed-form of the stiffness matrix of triangular prism element?Frequency domain Maxwell equations with PML boundary conditionsJacobian of ParametricNDSolve and FindRoot for the Three Body ProblemGiven a vector field construct a corresponding stream functionNumerically solving two coupled nonlinear PDEs
Digital signature that is only verifiable by one specific person
When is the phrase "j'ai bon" used?
How did the European Union reach the figure of 3% as a maximum allowed deficit?
King or Queen-Which piece is which?
What is the context for Napoleon's quote "[the Austrians] did not know the value of five minutes"?
Checking if argument is a floating point without breaking on control sequences in argument
Boundaries and Buddhism
How can I prevent a user from copying files on another hard drive?
How to make a villain when your PCs are villains?
How to address players struggling with simple controls?
Build a scale without computer
Are there any individual aliens that have gained superpowers in the Marvel universe?
How can I maintain game balance while allowing my player to craft genuinely useful items?
Got a new frameset, don't know why I need this split ring collar?
In windows systems, is renaming files functionally similar to deleting them?
How can the US president give an order to a civilian?
Is it a bad idea to have a pen name with only an initial for a surname?
How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?
how to find which software is doing ssh connection?
Is this broken pipe the reason my freezer is not working? Can it be fixed?
How did space travel spread throughout the Star Wars galaxy?
Using roof rails to set up hammock
What is "dot" sign in •NO?
How do I correctly reduce geometry on part of a mesh?
Vector-valued ParametricNDSolve, solving for a combination
Vector ParametricNDSolve and FindRoot interactionIs it possible to give the closed-form of the stiffness matrix of triangular prism element?Frequency domain Maxwell equations with PML boundary conditionsJacobian of ParametricNDSolve and FindRoot for the Three Body ProblemGiven a vector field construct a corresponding stream functionNumerically solving two coupled nonlinear PDEs
$begingroup$
I am integrating two vector differential equations using ParametricNDSolve
, one for $mathbfY$ and one for $mathbfZ$, and then I'm interested in a combination of the two of them. ParametricNDSolve
allows for specifying the output to just be a function of the two, for instance $mathbfY cdot mathbfZ$, but the combination I want is (for the case of sixth order vector equations):
$$psi = y_1 z_6 -y_2 z_5 + y_3 z_4 + y_4 z_3 - y_5 z_2 +y_6 z_1$$
Is there a way to get ParametricNDSolve
to give me this combination directly?
Example code:
A = 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, q, 0, -Sin[x], 0;
Q[x_, q_] = 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, -Sin[x],0, 0, 1, 0,
0, 0, 0, 0, 1, 0, -q, 0, 0, -Sin[x], 0, 1, 0, -q, 0, 0, 0, 0;
n = Length[Q[x, q]];
cA = With[code = N@A, Compile[x, _Real, q, _Real, code]];
F[x_?NumericQ, q_?NumericQ, Y_?VectorQ] :=
(Q[x, q] - DiagonalMatrix[ConstantArray[1, n]]).Y;
xa = -4; xb = 4; xm = 0;
k = -((-xb + xm)/(xa - xm)); c = -((-xa xm + xb xm)/(xa - xm));
Y0 = 0, 0, 0, 0, -1, 0;
Z0 = 0, 1, 0, 0, 0, 0;
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c , q, Z[x]], Z[xa] == Z0, Y, Z, x, xa, xm, q];
I'm interested in finding where $psi=0$, which I can do with this construction, but is there a more direct way to get it out of the ParametricNDSolveValue
?
psi[q_?NumericQ] := (Y[1] Z[6] - Y[2] Z[5] + Y[3] Z[4] + Y[4] Z[3] -
Y[5] Z[2] + Y[6] Z[1]) /. Y[a_] :> YZsol[q][[1]][xm][[a]],
Z[a_] :> YZsol[q][[2]][xm][[a]];
FindRoot[psi[q], q, 3]
Edit:
Carl's answer does exactly what I need, but I see a strange timing effect, where after I use FindRoot
it takes 6 times longer to do the same calculation:
Clear[YZsol2]; YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0, Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
(* 0.259752, Null *)
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* 1.69719, Null *)
differential-equations
$endgroup$
add a comment |
$begingroup$
I am integrating two vector differential equations using ParametricNDSolve
, one for $mathbfY$ and one for $mathbfZ$, and then I'm interested in a combination of the two of them. ParametricNDSolve
allows for specifying the output to just be a function of the two, for instance $mathbfY cdot mathbfZ$, but the combination I want is (for the case of sixth order vector equations):
$$psi = y_1 z_6 -y_2 z_5 + y_3 z_4 + y_4 z_3 - y_5 z_2 +y_6 z_1$$
Is there a way to get ParametricNDSolve
to give me this combination directly?
Example code:
A = 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, q, 0, -Sin[x], 0;
Q[x_, q_] = 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, -Sin[x],0, 0, 1, 0,
0, 0, 0, 0, 1, 0, -q, 0, 0, -Sin[x], 0, 1, 0, -q, 0, 0, 0, 0;
n = Length[Q[x, q]];
cA = With[code = N@A, Compile[x, _Real, q, _Real, code]];
F[x_?NumericQ, q_?NumericQ, Y_?VectorQ] :=
(Q[x, q] - DiagonalMatrix[ConstantArray[1, n]]).Y;
xa = -4; xb = 4; xm = 0;
k = -((-xb + xm)/(xa - xm)); c = -((-xa xm + xb xm)/(xa - xm));
Y0 = 0, 0, 0, 0, -1, 0;
Z0 = 0, 1, 0, 0, 0, 0;
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c , q, Z[x]], Z[xa] == Z0, Y, Z, x, xa, xm, q];
I'm interested in finding where $psi=0$, which I can do with this construction, but is there a more direct way to get it out of the ParametricNDSolveValue
?
psi[q_?NumericQ] := (Y[1] Z[6] - Y[2] Z[5] + Y[3] Z[4] + Y[4] Z[3] -
Y[5] Z[2] + Y[6] Z[1]) /. Y[a_] :> YZsol[q][[1]][xm][[a]],
Z[a_] :> YZsol[q][[2]][xm][[a]];
FindRoot[psi[q], q, 3]
Edit:
Carl's answer does exactly what I need, but I see a strange timing effect, where after I use FindRoot
it takes 6 times longer to do the same calculation:
Clear[YZsol2]; YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0, Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
(* 0.259752, Null *)
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* 1.69719, Null *)
differential-equations
$endgroup$
add a comment |
$begingroup$
I am integrating two vector differential equations using ParametricNDSolve
, one for $mathbfY$ and one for $mathbfZ$, and then I'm interested in a combination of the two of them. ParametricNDSolve
allows for specifying the output to just be a function of the two, for instance $mathbfY cdot mathbfZ$, but the combination I want is (for the case of sixth order vector equations):
$$psi = y_1 z_6 -y_2 z_5 + y_3 z_4 + y_4 z_3 - y_5 z_2 +y_6 z_1$$
Is there a way to get ParametricNDSolve
to give me this combination directly?
Example code:
A = 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, q, 0, -Sin[x], 0;
Q[x_, q_] = 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, -Sin[x],0, 0, 1, 0,
0, 0, 0, 0, 1, 0, -q, 0, 0, -Sin[x], 0, 1, 0, -q, 0, 0, 0, 0;
n = Length[Q[x, q]];
cA = With[code = N@A, Compile[x, _Real, q, _Real, code]];
F[x_?NumericQ, q_?NumericQ, Y_?VectorQ] :=
(Q[x, q] - DiagonalMatrix[ConstantArray[1, n]]).Y;
xa = -4; xb = 4; xm = 0;
k = -((-xb + xm)/(xa - xm)); c = -((-xa xm + xb xm)/(xa - xm));
Y0 = 0, 0, 0, 0, -1, 0;
Z0 = 0, 1, 0, 0, 0, 0;
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c , q, Z[x]], Z[xa] == Z0, Y, Z, x, xa, xm, q];
I'm interested in finding where $psi=0$, which I can do with this construction, but is there a more direct way to get it out of the ParametricNDSolveValue
?
psi[q_?NumericQ] := (Y[1] Z[6] - Y[2] Z[5] + Y[3] Z[4] + Y[4] Z[3] -
Y[5] Z[2] + Y[6] Z[1]) /. Y[a_] :> YZsol[q][[1]][xm][[a]],
Z[a_] :> YZsol[q][[2]][xm][[a]];
FindRoot[psi[q], q, 3]
Edit:
Carl's answer does exactly what I need, but I see a strange timing effect, where after I use FindRoot
it takes 6 times longer to do the same calculation:
Clear[YZsol2]; YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0, Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
(* 0.259752, Null *)
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* 1.69719, Null *)
differential-equations
$endgroup$
I am integrating two vector differential equations using ParametricNDSolve
, one for $mathbfY$ and one for $mathbfZ$, and then I'm interested in a combination of the two of them. ParametricNDSolve
allows for specifying the output to just be a function of the two, for instance $mathbfY cdot mathbfZ$, but the combination I want is (for the case of sixth order vector equations):
$$psi = y_1 z_6 -y_2 z_5 + y_3 z_4 + y_4 z_3 - y_5 z_2 +y_6 z_1$$
Is there a way to get ParametricNDSolve
to give me this combination directly?
Example code:
A = 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, q, 0, -Sin[x], 0;
Q[x_, q_] = 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, -Sin[x],0, 0, 1, 0,
0, 0, 0, 0, 1, 0, -q, 0, 0, -Sin[x], 0, 1, 0, -q, 0, 0, 0, 0;
n = Length[Q[x, q]];
cA = With[code = N@A, Compile[x, _Real, q, _Real, code]];
F[x_?NumericQ, q_?NumericQ, Y_?VectorQ] :=
(Q[x, q] - DiagonalMatrix[ConstantArray[1, n]]).Y;
xa = -4; xb = 4; xm = 0;
k = -((-xb + xm)/(xa - xm)); c = -((-xa xm + xb xm)/(xa - xm));
Y0 = 0, 0, 0, 0, -1, 0;
Z0 = 0, 1, 0, 0, 0, 0;
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c , q, Z[x]], Z[xa] == Z0, Y, Z, x, xa, xm, q];
I'm interested in finding where $psi=0$, which I can do with this construction, but is there a more direct way to get it out of the ParametricNDSolveValue
?
psi[q_?NumericQ] := (Y[1] Z[6] - Y[2] Z[5] + Y[3] Z[4] + Y[4] Z[3] -
Y[5] Z[2] + Y[6] Z[1]) /. Y[a_] :> YZsol[q][[1]][xm][[a]],
Z[a_] :> YZsol[q][[2]][xm][[a]];
FindRoot[psi[q], q, 3]
Edit:
Carl's answer does exactly what I need, but I see a strange timing effect, where after I use FindRoot
it takes 6 times longer to do the same calculation:
Clear[YZsol2]; YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0, Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
(* 0.259752, Null *)
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* 1.69719, Null *)
differential-equations
differential-equations
edited May 31 at 19:42
KraZug
asked May 31 at 12:22
KraZugKraZug
3,71421131
3,71421131
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Define a quadratic form matrix:
form =
0, 0, 0, 0, 0, 1,
0, 0, 0, 0, -1, 0,
0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0,
0, -1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0
;
Then:
YZsol2 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
Y[xm] . form . Z[xm],
x,xa,xm,
q
];
will produce the desired function. For example:
YZsol2 /@ Range[0, 4]
psi /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Another possibility is to include your desired output as an additional equation (constraint):
YZsol3 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
U[x] == Y[x] . form . Z[x]
,
U[xm],
x,xa,xm,
q
];
Check:
YZsol3 /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Note that there is a bug as of June 2019 with using this inside a FindRoot
, which makes it much slower unless we add Method -> "ParametricSensitivity" -> None
as detailed in Vector ParametricNDSolve and FindRoot interaction).
$endgroup$
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on theNDSolve
.
$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow withFindRoot
.
$endgroup$
– KraZug
Jun 7 at 7:35
add a comment |
$begingroup$
A hybrid of yours and @CarlWoll's approach seems to perform well after FindRoot.
Clear[YZsol, psi2]
form = Reverse@DiagonalMatrix@PadRight[, 6, 1, -1, 1];
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y, Z, x, xa,
xm, q];
psi2[q_?NumericQ] := (Y.form.Z) /. Y :> YZsol[q][[1]][xm],
Z :> YZsol[q][[2]][xm];
FindRoot[psi2[q], q, 3]
AbsoluteTiming[psi2 /@ Range[20]]
Clear[YZsol2];
YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* q -> 3.55393 *)
(* 0.279002, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 0.337883, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 2.20664, -148.785, -6240.83, -7841.05, 12815., 63393.6,
134180., 197976., 214748.,
139054., -71335.6, -446840., -998421., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22467*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
$endgroup$
$begingroup$
Er… what's the difference betweenYZsol2
andYZsol3
?
$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, ifFindRoot
is called first, the correspondingParametricFunction
will be slower?
$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that usingParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.
$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And theFindRoot
is slower too. It is marginally faster to evaluate individual points until you useFindRoot
, then it slows down considerably
$endgroup$
– KraZug
Jun 1 at 9:13
add a comment |
Your Answer
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
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199458%2fvector-valued-parametricndsolve-solving-for-a-combination%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Define a quadratic form matrix:
form =
0, 0, 0, 0, 0, 1,
0, 0, 0, 0, -1, 0,
0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0,
0, -1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0
;
Then:
YZsol2 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
Y[xm] . form . Z[xm],
x,xa,xm,
q
];
will produce the desired function. For example:
YZsol2 /@ Range[0, 4]
psi /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Another possibility is to include your desired output as an additional equation (constraint):
YZsol3 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
U[x] == Y[x] . form . Z[x]
,
U[xm],
x,xa,xm,
q
];
Check:
YZsol3 /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Note that there is a bug as of June 2019 with using this inside a FindRoot
, which makes it much slower unless we add Method -> "ParametricSensitivity" -> None
as detailed in Vector ParametricNDSolve and FindRoot interaction).
$endgroup$
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on theNDSolve
.
$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow withFindRoot
.
$endgroup$
– KraZug
Jun 7 at 7:35
add a comment |
$begingroup$
Define a quadratic form matrix:
form =
0, 0, 0, 0, 0, 1,
0, 0, 0, 0, -1, 0,
0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0,
0, -1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0
;
Then:
YZsol2 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
Y[xm] . form . Z[xm],
x,xa,xm,
q
];
will produce the desired function. For example:
YZsol2 /@ Range[0, 4]
psi /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Another possibility is to include your desired output as an additional equation (constraint):
YZsol3 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
U[x] == Y[x] . form . Z[x]
,
U[xm],
x,xa,xm,
q
];
Check:
YZsol3 /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Note that there is a bug as of June 2019 with using this inside a FindRoot
, which makes it much slower unless we add Method -> "ParametricSensitivity" -> None
as detailed in Vector ParametricNDSolve and FindRoot interaction).
$endgroup$
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on theNDSolve
.
$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow withFindRoot
.
$endgroup$
– KraZug
Jun 7 at 7:35
add a comment |
$begingroup$
Define a quadratic form matrix:
form =
0, 0, 0, 0, 0, 1,
0, 0, 0, 0, -1, 0,
0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0,
0, -1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0
;
Then:
YZsol2 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
Y[xm] . form . Z[xm],
x,xa,xm,
q
];
will produce the desired function. For example:
YZsol2 /@ Range[0, 4]
psi /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Another possibility is to include your desired output as an additional equation (constraint):
YZsol3 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
U[x] == Y[x] . form . Z[x]
,
U[xm],
x,xa,xm,
q
];
Check:
YZsol3 /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Note that there is a bug as of June 2019 with using this inside a FindRoot
, which makes it much slower unless we add Method -> "ParametricSensitivity" -> None
as detailed in Vector ParametricNDSolve and FindRoot interaction).
$endgroup$
Define a quadratic form matrix:
form =
0, 0, 0, 0, 0, 1,
0, 0, 0, 0, -1, 0,
0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0,
0, -1, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0
;
Then:
YZsol2 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
Y[xm] . form . Z[xm],
x,xa,xm,
q
];
will produce the desired function. For example:
YZsol2 /@ Range[0, 4]
psi /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Another possibility is to include your desired output as an additional equation (constraint):
YZsol3 = ParametricNDSolveValue[
Y'[x] == F[x,q,Y[x]], Y[xa]==Y0,
Z'[x] == 1/k F[k x+c,q,Z[x]], Z[xa]==Z0,
U[x] == Y[x] . form . Z[x]
,
U[xm],
x,xa,xm,
q
];
Check:
YZsol3 /@ Range[0, 4]
-24.1853, -148.784, -6240.84, -7841.06, 12815.
Note that there is a bug as of June 2019 with using this inside a FindRoot
, which makes it much slower unless we add Method -> "ParametricSensitivity" -> None
as detailed in Vector ParametricNDSolve and FindRoot interaction).
edited Jun 7 at 7:20
KraZug
3,71421131
3,71421131
answered May 31 at 14:13
Carl WollCarl Woll
84.1k3107218
84.1k3107218
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on theNDSolve
.
$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow withFindRoot
.
$endgroup$
– KraZug
Jun 7 at 7:35
add a comment |
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on theNDSolve
.
$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow withFindRoot
.
$endgroup$
– KraZug
Jun 7 at 7:35
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Thanks, of course that is a way to write it as a vector/matrix equation
$endgroup$
– KraZug
May 31 at 14:31
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on the
NDSolve
.$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
Huh, that works really well, except they are both much slower than the original formulation. The constraint version also fails to find the root (presumably because it is using a different internal method on the
NDSolve
.$endgroup$
– KraZug
May 31 at 14:42
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow with
FindRoot
.$endgroup$
– KraZug
Jun 7 at 7:35
$begingroup$
I edited your answer to include a link to another question where I show the workaround to not be slow with
FindRoot
.$endgroup$
– KraZug
Jun 7 at 7:35
add a comment |
$begingroup$
A hybrid of yours and @CarlWoll's approach seems to perform well after FindRoot.
Clear[YZsol, psi2]
form = Reverse@DiagonalMatrix@PadRight[, 6, 1, -1, 1];
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y, Z, x, xa,
xm, q];
psi2[q_?NumericQ] := (Y.form.Z) /. Y :> YZsol[q][[1]][xm],
Z :> YZsol[q][[2]][xm];
FindRoot[psi2[q], q, 3]
AbsoluteTiming[psi2 /@ Range[20]]
Clear[YZsol2];
YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* q -> 3.55393 *)
(* 0.279002, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 0.337883, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 2.20664, -148.785, -6240.83, -7841.05, 12815., 63393.6,
134180., 197976., 214748.,
139054., -71335.6, -446840., -998421., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22467*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
$endgroup$
$begingroup$
Er… what's the difference betweenYZsol2
andYZsol3
?
$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, ifFindRoot
is called first, the correspondingParametricFunction
will be slower?
$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that usingParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.
$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And theFindRoot
is slower too. It is marginally faster to evaluate individual points until you useFindRoot
, then it slows down considerably
$endgroup$
– KraZug
Jun 1 at 9:13
add a comment |
$begingroup$
A hybrid of yours and @CarlWoll's approach seems to perform well after FindRoot.
Clear[YZsol, psi2]
form = Reverse@DiagonalMatrix@PadRight[, 6, 1, -1, 1];
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y, Z, x, xa,
xm, q];
psi2[q_?NumericQ] := (Y.form.Z) /. Y :> YZsol[q][[1]][xm],
Z :> YZsol[q][[2]][xm];
FindRoot[psi2[q], q, 3]
AbsoluteTiming[psi2 /@ Range[20]]
Clear[YZsol2];
YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* q -> 3.55393 *)
(* 0.279002, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 0.337883, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 2.20664, -148.785, -6240.83, -7841.05, 12815., 63393.6,
134180., 197976., 214748.,
139054., -71335.6, -446840., -998421., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22467*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
$endgroup$
$begingroup$
Er… what's the difference betweenYZsol2
andYZsol3
?
$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, ifFindRoot
is called first, the correspondingParametricFunction
will be slower?
$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that usingParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.
$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And theFindRoot
is slower too. It is marginally faster to evaluate individual points until you useFindRoot
, then it slows down considerably
$endgroup$
– KraZug
Jun 1 at 9:13
add a comment |
$begingroup$
A hybrid of yours and @CarlWoll's approach seems to perform well after FindRoot.
Clear[YZsol, psi2]
form = Reverse@DiagonalMatrix@PadRight[, 6, 1, -1, 1];
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y, Z, x, xa,
xm, q];
psi2[q_?NumericQ] := (Y.form.Z) /. Y :> YZsol[q][[1]][xm],
Z :> YZsol[q][[2]][xm];
FindRoot[psi2[q], q, 3]
AbsoluteTiming[psi2 /@ Range[20]]
Clear[YZsol2];
YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* q -> 3.55393 *)
(* 0.279002, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 0.337883, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 2.20664, -148.785, -6240.83, -7841.05, 12815., 63393.6,
134180., 197976., 214748.,
139054., -71335.6, -446840., -998421., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22467*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
$endgroup$
A hybrid of yours and @CarlWoll's approach seems to perform well after FindRoot.
Clear[YZsol, psi2]
form = Reverse@DiagonalMatrix@PadRight[, 6, 1, -1, 1];
YZsol = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0, Y, Z, x, xa,
xm, q];
psi2[q_?NumericQ] := (Y.form.Z) /. Y :> YZsol[q][[1]][xm],
Z :> YZsol[q][[2]][xm];
FindRoot[psi2[q], q, 3]
AbsoluteTiming[psi2 /@ Range[20]]
Clear[YZsol2];
YZsol2 = ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
AbsoluteTiming[YZsol2 /@ Range[20]]
Clear[YZsol3]; YZsol3 =
ParametricNDSolveValue[Y'[x] == F[x, q, Y[x]], Y[xa] == Y0,
Z'[x] == 1/k F[k x + c, q, Z[x]], Z[xa] == Z0,
Y[xm].form.Z[xm], x, xa, xm, q];
FindRoot[YZsol3[q], q, 3];
AbsoluteTiming[YZsol3 /@ Range[20]]
(* q -> 3.55393 *)
(* 0.279002, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 0.337883, -148.784, -6240.84, -7841.06, 12815., 63393.7,
134180., 197976., 214749.,
139054., -71335.6, -446840., -998422., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22468*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
(* 2.20664, -148.785, -6240.83, -7841.05, 12815., 63393.6,
134180., 197976., 214748.,
139054., -71335.6, -446840., -998421., -1.71155*10^6, -2.5422*10^6,
-3.41516*10^6, -4.22467*10^6, -4.83742*10^6, -5.09767*10^6,
-4.83432*10^6, -3.86961*10^6 *)
answered May 31 at 22:38
Tim LaskaTim Laska
1,1911210
1,1911210
$begingroup$
Er… what's the difference betweenYZsol2
andYZsol3
?
$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, ifFindRoot
is called first, the correspondingParametricFunction
will be slower?
$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that usingParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.
$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And theFindRoot
is slower too. It is marginally faster to evaluate individual points until you useFindRoot
, then it slows down considerably
$endgroup$
– KraZug
Jun 1 at 9:13
add a comment |
$begingroup$
Er… what's the difference betweenYZsol2
andYZsol3
?
$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, ifFindRoot
is called first, the correspondingParametricFunction
will be slower?
$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that usingParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.
$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And theFindRoot
is slower too. It is marginally faster to evaluate individual points until you useFindRoot
, then it slows down considerably
$endgroup$
– KraZug
Jun 1 at 9:13
$begingroup$
Er… what's the difference between
YZsol2
and YZsol3
?$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
Er… what's the difference between
YZsol2
and YZsol3
?$endgroup$
– xzczd
Jun 1 at 4:53
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@xzczd, there is no difference, just one has FindRoot applied first
$endgroup$
– KraZug
Jun 1 at 6:40
$begingroup$
@KraZug So, if
FindRoot
is called first, the corresponding ParametricFunction
will be slower?$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
@KraZug So, if
FindRoot
is called first, the corresponding ParametricFunction
will be slower?$endgroup$
– xzczd
Jun 1 at 9:09
$begingroup$
This is basically the same as my approach directly. I was thinking that using
ParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
This is basically the same as my approach directly. I was thinking that using
ParametricNDSolve
to calculate the quantity of interest would be faster and perhaps more accurate.$endgroup$
– KraZug
Jun 1 at 9:11
$begingroup$
@xzczd, exactly. And the
FindRoot
is slower too. It is marginally faster to evaluate individual points until you use FindRoot
, then it slows down considerably$endgroup$
– KraZug
Jun 1 at 9:13
$begingroup$
@xzczd, exactly. And the
FindRoot
is slower too. It is marginally faster to evaluate individual points until you use FindRoot
, then it slows down considerably$endgroup$
– KraZug
Jun 1 at 9:13
add a comment |
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.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199458%2fvector-valued-parametricndsolve-solving-for-a-combination%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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