       Re: Innacurate Solve results

• To: mathgroup at smc.vnet.net
• Subject: [mg4054] Re: Innacurate Solve results
• From: danl (Daniel Lichtblau)
• Date: Thu, 30 May 1996 02:48:23 -0400
• Organization: Wolfram Research, Inc.
• Sender: owner-wri-mathgroup at wolfram.com

```In article <4nostg\$975 at dragonfly.wolfram.com> Mark Van de Vyver
<mvyver at ecel.uwa.edu.au> writes:
> Hi,
>
> I'm battling with Solve and the following problem.
> The Problem is set up in mma as follows:
>
> In
>
> Clear[ m, v, X0, ximageB, ximageC, A, imagestrength, q1, q]
> q1[x0_,x_,t_]:=(2 Pi t)^(-1/2) Exp[-(x-x0-m t)^2 (2 t v)^-1]
> a[t_]:=1/2 - t*Log[1/4 + (E^(-t^(-1)))^(1/2)/2^(1/2)]
> t=1;
> m=0;
> v=1;
> X0=0;
> ximageB=1;
> ximageC=2;
> A=1;
> (* imagestrength=1/2; *)
>
> In
>
> Solve[ {q[x, t]==A q1[X0, x, t] + imagestrength q1[ximageB, x, t] +
imagestrength q1[ximageC, x, t],
>        A q1[X0, x, 0] + imagestrength q1[ximageB, x, 0] + imagestrength
q1[ximageC, x, 0]==DiracDelta[x],
>        A q1[X0, a[t], t] + imagestrength q1[ximageB, a[t], t] +
imagestrength q1[ximageC, a[t], t]==0},
> { q[x,t], imagestrength}]//Simplify
>
> The result mma gives is close but v. innacurate and v. messy. For
example applying //N to imagestrength gives
> -0.44....
> It should be -0.5.
> Further more q[x,t] should be the same as
> g[y_, t_]=( (2 Pi t)^(-1/2) ) (Exp[-(y^2)/(2t)]-(1/2)
Exp[-((y-1)^2)/(2t)]-(1/2)Exp[-((y-2)^2)/(2t)])
> Ploting q and g will make clear how large the problem is and that
whatever mma is doing wrong grows as x does.
>
> Can anyone point me the problem out to me, or where I might find a
solution.
>
> Mark
> --
>    Mark Van de Vyver
>
__________________________________________________________________________
___
>    Mark Van de Vyver
>    Department of Accounting and Finance      Phone:  (61) (09) 380-2510
>    University of Western Australia           Fax:    (61) (09) 380-1047
>    Nedlands   6907                           e-mail:
mvyver at ecel.uwa.edu.au
>    Perth
>
__________________________________________________________________________
___
>
>

Your equations do not agree with your comment that imagestrength is 1/2.
If you explicitly substitute 1/2 for imagestrength in the third eqn you
get a numeric value of the left hand side that is not zero, as is shown
below (indeed, our development version recognizes this fact without
recourse to N[], and simply evaluates it to False).
Two other notable points: after setting t to 1, q[x,t] obviously becomes
q[x,1]. Also, your second equation does not evaluate to something useful
(which is just as well, or else the system would be overdetermined).

In:= Clear[ m, v, X0, ximageB, ximageC, A, imagestrength, q1, q]
q1[x0_,x_,t_]:=(2 Pi t)^(-1/2) Exp[-(x-x0-m t)^2 (2 t v)^-1]
a[t_]:=1/2 - t*Log[1/4 + (E^(-t^(-1)))^(1/2)/2^(1/2)]
t=1;
m=0;
v=1;
X0=0;
ximageB=1;
ximageC=2;
A=1;

General::spell1:
Possible spelling error: new symbol name "ximageC"
is similar to existing symbol "ximageB".

In:=
In:=
In:=
In:=
In:=
In:=
In:=
In:=
In:=
In:= eqns = {q[x, t]==A q1[X0, x, t] + imagestrength q1[ximageB, x, t]
+ imagestrength q1[ximageC, x, t],
A q1[X0, x, 0] + imagestrength q1[ximageB, x, 0] + imagestrength
q1[ximageC, x, 0]==DiracDelta[x],
A q1[X0, a[t], t] + imagestrength q1[ximageB, a[t], t] +
imagestrength q1[ximageC, a[t], t]==0};

1
Power::infy: Infinite expression ------- encountered.
Sqrt

1
Power::infy: Infinite expression - encountered.
0

ComplexInfinity
Infinity::indet: Indeterminate expression E                encountered.

1
Power::infy: Infinite expression ------- encountered.
Sqrt

General::stop: Further output of Power::infy
will be suppressed during this calculation.

ComplexInfinity
Infinity::indet: Indeterminate expression E                encountered.

ComplexInfinity
Infinity::indet: Indeterminate expression E                encountered.

General::stop: Further output of Infinity::indet
will be suppressed during this calculation.

In:= eqns // InputForm

Out//InputForm=
{q[x, 1] == 1/(E^(x^2/2)*(2*Pi)^(1/2)) +
imagestrength/(E^((-2 + x)^2/2)*(2*Pi)^(1/2)) +
imagestrength/(E^((-1 + x)^2/2)*(2*Pi)^(1/2)),
Indeterminate == DiracDelta[x],
1/(E^((1/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2)) +
imagestrength/(E^((-3/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2))
+
imagestrength/(E^((-1/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2))
==
0}

In:= InputForm[lasteq = Last[eqns] /. imagestrength->1/2]

Out//InputForm=
1/(2*E^((-3/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2)) +
1/(2*E^((-1/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2)) +
1/(E^((1/2 - Log[1/4 + (2*E)^(-1/2)])^2/2)*(2*Pi)^(1/2)) == 0

In:= N[lasteq[], 30]

Out= 0.574736261112608087103710247873

In:= \$Version

Out= NeXT 2.2 (July 13, 1993)

Daniel Lichtblau
Wolfram Research, Inc.
danl at wolfram.com

==== [MESSAGE SEPARATOR] ====

```

• Prev by Date: more Goldberg Variations
• Next by Date: operations with lists
• Previous by thread: Innacurate Solve results
• Next by thread: Q: Eigen values in Mathematica 2.2