Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6145 > unrolled thread
| Started by | Rui <rui.rojo@gmail.com> |
|---|---|
| First post | 2011-11-03 08:52 +0000 |
| Last post | 2011-11-12 12:41 +0000 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Simple DSolve equation Rui <rui.rojo@gmail.com> - 2011-11-03 08:52 +0000
Re: Simple DSolve equation "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-11-04 10:59 +0000
Re: Simple DSolve equation Rui <rui.rojo@gmail.com> - 2011-11-06 10:58 +0000
Re: Simple DSolve equation "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-11-12 12:41 +0000
| From | Rui <rui.rojo@gmail.com> |
|---|---|
| Date | 2011-11-03 08:52 +0000 |
| Subject | Simple DSolve equation |
| Message-ID | <j8tkpb$f14$1@smc.vnet.net> |
Why does something like this not give the correct answer with restrictions over k?
How would you go about getting the right general solutions in these kind of basic differential equations?
Thanks
DSolve[{y''[x] == k y[x], y[0] == 0, y[10] == 0}, y[x], x]
Out={{y[x] -> 0}}
[toc] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2011-11-04 10:59 +0000 |
| Message-ID | <j90ghv$se0$1@smc.vnet.net> |
| In reply to | #6145 |
"Rui" <rui.rojo@gmail.com> schrieb im Newsbeitrag
news:j8tkpb$f14$1@smc.vnet.net...
> Why does something like this not give the correct answer with
> restrictions over k?
> How would you go about getting the right general solutions in these
> kind of basic differential equations?
>
> Thanks
>
> DSolve[{y''[x] == k y[x], y[0] == 0, y[10] == 0}, y[x], x]
> Out={{y[x] -> 0}}
>
Interesting question. Because I always had in mind to put down the
procedure I'll do it here though the elaborated version might be a
little lengthy. I have deleted the Ins and Outs and the error messages
for ease of reading.
We will find all solutions (the trivial and he non-trivial ones) in the
following way.
First we DSolve the differential equation with just one condition (at
x= 0, say), and then impose the second condition as a Solve requirement
on the set of solutions thus obtained.
We shall see that Solve does all the fine "quantization" we expect, i.e
it gives us the possible values of the parameter k.
For better transparency we shall first apply Reduce, and Solve
afterwards.
The code is found below
Best regards,
Wolfgang
Begin of code
f[x_] = y[x] /. DSolve[{Derivative[2][y][x] == k*y[x], y[0] == 0},
y[x], x][[1]]
(-E^((-Sqrt[k])*x))*(-1 + E^(2*Sqrt[k]*x))*C[2]
First Reduce,
r = Reduce[Simplify[f[10]] == 0]
(E^Sqrt[k] == -1 - E^(2*Sqrt[k]) - E^(3*Sqrt[k]) - E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) + E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0) ||
(E^Sqrt[k] == 1 + E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0) ||
(E^(2*Sqrt[k]) == -1 && E^Sqrt[k] != 0) || (E^(2*Sqrt[k]) == 1 +
E^(4*Sqrt[k]) - E^(6*Sqrt[k]) + E^(8*Sqrt[k]) && E^Sqrt[k] != 0) ||
(C[2] == 0 && E^Sqrt[k] != 0) || E^Sqrt[k] == -1 || E^Sqrt[k] == 1
Length[r]
7
now Solve, one by one
n = 1;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == -1 - E^(2*Sqrt[k]) - E^(3*Sqrt[k]) - E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) + E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0
{{k -> -((16*Pi^2)/25)}, {k -> -((4*Pi^2)/25)}, {k ->
Log[-(-1)^(1/5)]^2}, {k -> Log[-(-1)^(3/5)]^2}}
{-2*I*C[2]*Sin[(4*Pi*x)/5], -2*I*C[2]*Sin[(2*Pi*x)/5], -2*I*C[2]*Sin[(4*Pi*x)/5],
-2*I*C[2]*Sin[(2*Pi*x)/5]}
n = 2;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == 1 + E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) && 1 +
E^(2*Sqrt[k]) - E^(3*Sqrt[k]) + E^(4*Sqrt[k]) != 0
{{k -> -((9*Pi^2)/25)}, {k -> -(Pi^2/25)}, {k -> Log[-(-1)^(2/5)]^2},
{k -> Log[-(-1)^(4/5)]^2}}
{-2*I*C[2]*Sin[(3*Pi*x)/5], -2*I*C[2]*Sin[(Pi*x)/5], -2*I*C[2]*Sin[(3*Pi*x)/5],
-2*I*C[2]*Sin[(Pi*x)/5]}
n = 3;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^(2*Sqrt[k]) == -1 && E^Sqrt[k] != 0
{{k -> -(Pi^2/4)}}
{-2*I*C[2]*Sin[(Pi*x)/2]}
n = 4;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^(2*Sqrt[k]) == 1 + E^(4*Sqrt[k]) - E^(6*Sqrt[k]) + E^(8*Sqrt[k]) &&
E^Sqrt[k] != 0
{{k -> -((81*Pi^2)/100)}, {k -> -((49*Pi^2)/100)},
{k -> -((9*Pi^2)/100)}, {k -> -(Pi^2/100)}, {k -> Log[-(-1)^(1/10)]^2},
{k -> Log[-(-1)^(3/10)]^2}, {k -> Log[-(-1)^(7/10)]^2}, {k ->
Log[-(-1)^(9/10)]^2}}
{-2*I*C[2]*Sin[(9*Pi*x)/10], -2*I*C[2]*Sin[(7*Pi*x)/10], -2*I*C[2]*Sin[(3*Pi*x)/10],
-2*I*C[2]*Sin[(Pi*x)/10], -2*I*C[2]*Sin[(9*Pi*x)/10], -2*I*C[2]*Sin[(7*Pi*x)/10],
-2*I*C[2]*Sin[(3*Pi*x)/10], -2*I*C[2]*Sin[(Pi*x)/10]}
n = 5;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
C[2] == 0 && E^Sqrt[k] != 0
{0}
n = 6;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == -1
{{k -> -Pi^2}}
{-2*I*C[2]*Sin[Pi*x]}
n = 7;
r[[n]]
Solve[r[[n]]]
fs[n] = FullSimplify[f[x] /. %, x \[Element] Reals]
E^Sqrt[k] == 1
{{k -> 0}}
{0}
Finally, we put everything together (and letting C[2] -> 1/(-2*I) which
gives the list a nicer appeal)
Union[Flatten[Table[fs[i], {i, 1, 7}]]] /. C[2] -> 1/(-2*I)
{0, Sin[(Pi*x)/10], Sin[(Pi*x)/5], Sin[(3*Pi*x)/10], Sin[(2*Pi*x)/5],
Sin[(Pi*x)/2], Sin[(3*Pi*x)/5], Sin[(7*Pi*x)/10], Sin[(4*Pi*x)/5],
Sin[(9*Pi*x)/10], Sin[Pi*x]}
End of code
[toc] | [prev] | [next] | [standalone]
| From | Rui <rui.rojo@gmail.com> |
|---|---|
| Date | 2011-11-06 10:58 +0000 |
| Message-ID | <j95p9b$m6s$1@smc.vnet.net> |
| In reply to | #6145 |
Wolfgang, but I think C[1] Sin[p/10 Pi x] are all solutions for p integer, right?
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2011-11-12 12:41 +0000 |
| Message-ID | <j9lphi$lhm$1@smc.vnet.net> |
| In reply to | #6223 |
"Rui" <rui.rojo@gmail.com> schrieb im Newsbeitrag news:j95p9b$m6s$1@smc.vnet.net... > Wolfgang, but I think C[1] Sin[p/10 Pi x] are all solutions for p > integer, right? > > Rui, yes you are right, and these are all given in the list of results in my reply. The point was that Mathematica indeed produces the correct Eigenvalues, at least if you follow the procedure I have described. The latter is, by the way, very close to what one nomally does when solving Eigenvalue problems from diffenrential equations. Wolfgang
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web