Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

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[1]
> 
> 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[2]
> 
> 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.
> Thanks in advance
> 
> 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[1]:= 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[2]:= 
In[3]:= 
In[4]:= 
In[5]:= 
In[6]:= 
In[7]:= 
In[8]:= 
In[9]:= 
In[10]:= 
In[11]:= 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[0]

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

                                           ComplexInfinity
Infinity::indet: Indeterminate expression E                encountered.

                                    1
Power::infy: Infinite expression ------- encountered.
                                 Sqrt[0]

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[12]:= eqns // InputForm

Out[12]//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[13]:= InputForm[lasteq = Last[eqns] /. imagestrength->1/2]

Out[13]//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[14]:= N[lasteq[[1]], 30]

Out[14]= 0.574736261112608087103710247873

In[15]:= $Version

Out[15]= 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