i have used the FindRoot function and it returns an output:
{sd -> 10} say
how do i get the output to return it without the sd -> bit ?
thanks for help
Glenn Roberts - HBOS Treasury Services
Interest Rate Derivatives Trading
glennroberts@hbosts.com - 020-7574-8602
33 Old Broad Street, London, EC2N 1HZ
====
4.1 for Microsoft Windows (December 11, 2000)
In[2]:=
f[a_]=Integrate[Log[2,1+10*x]*Exp[-x]*x,{x,0,a},Assumptions[Rule]a>0]
Out[2]=
-((1/(20*Log[2]))*((20 - 20*E^a + 18*E^(1/10 + a)*
ExpIntegralEi[-(1/10)] + 18*E^(1/10 + a)*Gamma[0, 1/10 + a] +
9*E^(1/10 + a)*Log[1/(-1 - 10*a)] - 9*E^(1/10 + a)*
Log[-1 - 10*a] + 20*Log[1 + 10*a] + 20*a*Log[1 + 10*a] +
18*E^(1/10 + a)*Log[1 + 10*a])/E^a))
Out[4]=
4.05855803419172 + 0.*I
Andrzej Kozlowski skrev i meddelandet
Dear all,
I got very extraordinary results today from below two same integrals
> except one is symbolic one and the other is numeric one:
> A. In[1]= N[Integrate[ Log[2, 1 + 10*x]*Exp[-x]*x, {x, 0, Infinity}]]
> Out[1]= -3.77002
> B. In[2]= NIntegrate[ Log[2, 1 + 10*x]*Exp[-x]*x, {x, 0, Infinity}]
> Out[2]= 4.05856
Why did I got the different results of these, surprisingly?
---
> Sung Jin Kim
> A member of MCL in SNU: kimsj@mobile.snu.ac.kr,
> A MTS of i-Networking Lab in SAIT: communication@samsung.com
The answer given by Integrate is clearly wrong and seems to be due to
> Mathematica's failure to deal with a difficult limit.
Not that if we set
> f[a_] = Integrate[Log[2, 1 + 10*x]*Exp[-x]*x, {x, 0, a}, Assumptions - a > 0]
> (1/Log[1024])*(Log[10*a + 1]/E^a - 10*E^(1/10)*Gamma[2, a +
> 1/10]*Log[10*a + 1] +
> E^(1/10)*MeijerG[{{}, {1}}, {{0, 0}, {}}, a + 1/10] -
> 10*E^(1/10)*MeijerG[{{}, {1, 1}}, {{0, 0, 2}, {}}, a + 1/10] +
> 10*E^(1/10)*MeijerG[{{}, {1, 1}}, {{0, 0, 2}, {}}, 1/10] -
> E^(1/10)*MeijerG[{{}, {1}}, {{0, 0}, {}}, 1/10])
Then this agrees with NIntegrate, e.g.
> NIntegrate[Log[2,1+10*x]*Exp[-x]*x,{x,0,20}]
> 4.05856
> N[f[20]]
> 4.05856
(Note also that using N for large a's will produce wrong answers unless
> you use more digits. For example, compare N[f[40]] with N[f[40],20]).
In any case, the answer given for Integrate is almost certainly right,
> but Mathematica is unable to correctly find the limit of the expression
> as a->Infinity. It seems to preform some numerical checks that it is
> unable to carry out.
Andrzej Kozlowski
> Chiba, Japan
> http://www.mimuw.edu.pl/~akoz/
>
====
> Mathematica 3.0 (April 25, 1997) returns a valid value for your
> integral
> 1/10*(9*Exp[1/10]*ExpIntegralE[1, 1/10] + 10)/Log[2] //N
> 4.05856
[akoz@mimuw.edu.pl]; David W. Cantrell [DWCantrell@sigmaxi.org]),
I finally got the solution of my proposed integral problem as below:
Integrate[ Log[2, 1 + a*x]*Exp[-x]*x, {x, 0, Infinity}]
==> (a-Exp[1/a]*(-1+a)*ExpIntegralEi[-1/a])/(a*Log[2])
Note that since I don't have older version, I did it with somehow
manipulation of my finger, e.g. including usage of Limit[] function.
To prohibit same failures again by others, I describe the procedures
what I have had to end this integration briefly.
Let us assume the original integral as *Integrate[ f, {x,0,Infinity}]*,
Then its step to find is denoted by
Step1: F = Integrate[ f, x]
Step2: Find F0 = F/.x->0
Step3: To find limit of F (x->Infinity) where assuming F = A+B,
I get limit values of A and B instead since limit of F is
unavailable to find and add two values as FL.
Therefore, I get final solution, which is FL - F0.
At this moment, I have another question: why do I need such dumb step3
to find Limit value, at least why in this example?
---
Sung Jin Kim
A member of MCL in SNU: kimsj@mobile.snu.ac.kr,
A MTS of i-Networking Lab in SAIT: communication@samsung.com
====
I want to interpolate function with a few different sets of nodes.
One of them are random ones. I have made the list of nodes and my
function's
values:
(n is given)
data1=Table[{e=Random[]*2-1,ArcTan(x,0.,n}]
and I have a list: {{x_0,f(x_0)},{x_1,f(x_1)}...}
I use the following formula to calculate my function
L(x) = SUM(j=0..n) f(x_j) * Lambda(j,x)
And I need to extract these values from my list.
and I want to define two functions
y[n] - this returns the f(x_n) from my list
x[n] - this returns the x_n from my list
how can I do it in mathematica?
Wojtek
====
A major improvement to a package I have posted at
http://library.wolfram.com/infocenter/MathSource/705/
is now available from this URL.
Normally Mathematica refuses to use a concise format of the following:
In[1]:= (x y x)^2 + Sqrt[2 w u v]
Out[1]= x^2 y^2 z^2 + Sqrt[2] Sqrt[w] Sqrt[u] Sqrt[v]
The package includes a function called PowerTogether that can use
assumtions to give:
In[2]:= expr = x^2 y^2 z^2 + Sqrt[2] Sqrt[w] Sqrt[u] Sqrt[v] ;
PowerTogether[ expr, u>0 && v>0 ]
Out[2]= (x y x)^2 + Sqrt[2 w u v]
The latest version of the package is very powerful!
------
Ted Ersek
Get Mathematica Tips & Tricks from
http://www.verbeia.com/mathematica/tips/Tricks.html
====
List @@ yourSum
??
Jens
> Given a function
> x y + Sin[x] Cos[y]
I need to convert it into the list
> {{x,y},{Sin[x],Cos[x]}}
Generally, the purpose to convert a function
> Sum[p[i,x] q[i[y], {i,1,n}]
into the list
> {{p[1,x],q[1,y]},...,{p[n,x],q[n,y]}
How to do it using Mathematica?
> V.Z.
>
====
IntegrationOperator[f_][x_] := Block[{t}, Integrate[f[t], {t, 0, x}]]
IntegrationOperator[#^3 &][x]
??
Jens
I'd like to define an operator such as ...
IntegrationOperator[f_] = Integrate[f, {t, 0, 1}]
so that if ...
g[x_, t_] = x t
I could write something like ...
h[x_] = IntegrationOperator[g][x]
How does one accomplish this in Mathematica?
====
> I'd like to define an operator such as ...
IntegrationOperator[f_] = Integrate[f, {t, 0, 1}]
so that if ...
g[x_, t_] = x t
I could write something like ...
h[x_] = IntegrationOperator[g][x]
How does one accomplish this in Mathematica?
Try Derivative:
In[]:= Derivative[-1, -2][(#1^2 + 3 Sin[#2]^2 &)][x, y]
Out[]:=1/12*x*(9 + 2*x^2)*y^2 + 3/8*x*Cos[2*y]
--
Roland Franzius
====
I dont know but try
ssh -X
perhaps it could solve your problem.
(To be honest i havent used it
for mathematica, but i have already
watched TV on a remote pc with it.)
> I seem to have the same problem as Claudia [00278]
I must log on a second PC (veneon) which has Mathematica installed
dranse ~]$ ssh veneon
On veneon I type
veneon$ setenv DISPLAY dranse:0
veneon$ echo $DISPLAY
> dranse:0
veneon$ math
> Copyright 1988-2002 Wolfram Research, Inc.
> -- Motif graphics initialized --
In[1]:= Plot[Sin[x],{x,0,1}]
> _X11TransSocketINETConnect: Can't get address for dranse
> Error: Can't open display:
- If I try gnuplot on veneon with exported display on dranse : no
problem,
> works
> fine
- ping works
veneon$ ping dranse
> 64 bytes from dranse.ceng.cea.fr (192.168.1.17): icmp_seq=1 ttl=64
time=0.132
> ms
- If I try logging on veneon with telnet instead of ssh, same problem ..
- I've correctly added veneon to the dranse access control list with
> dranse$ xhost + veneon
So the fix proposed by Olaf [00336] does not work for me
> (Did it work for you Claudia ?)
problem ?
dranse kernel 2.4.18-14
> veneon kernel 2.4.20-8
Can anyone help me out ?
> Serge
--
> *--------------------------------------------*
> | Serge Crouzy |
> | CEA Grenoble BMC/DRDC K 215 A |
> | 17 Avenue des Martyrs, |
> | 38054 GRENOBLE cedex 9 FRANCE |
> | E.Mail address : crouzy@dsvsud.cea.fr |
> *--------------------------------------------*
>
====
does any one know where there is a routine that does this in mathematica?
cannot make head nor tail of the stuff i have found on the web
thanks
--
====
Florian,
Ues Menu/Cell/Default Inline Format Type and change it to StandardForm.
Or edit the style sheet, Format Type Styles, InlineCell and use a bold
font.
Or use the Option Inspector/Editing Options/Traditional Notation
Options/Single Letter Italics.
David Park
djmp@earthlink.net
http://home.earthlink.net/~djmp/
-----Original Message-----
Is there any way to disable, that single letters are italic?
(The Global Preference SingleLettersItalics is disabled for sure)
F. Huber
====
I have problems with solving stuff like
!(pd = [PartialD]_t
n[x, t] == (-dif) [PartialD]_(x, x) n[x, t] +
int Exp[(-[Alpha]) x] - rek n[x, t])
( where dif, int, alpha and rek are constants )
I tried it via
!(lsg =
NDSolve[{pd, n[x, 0] == nstart,
n[0, t] == nstart, (([PartialD]_x n[x, t] /. x ->
thickn)) == 0},
n, {x, 0, thickn}, {t, 0, 2}])
( again nstart and thickn are constants )
but could not make it...
Have any advice??
Uli
====
>Given cf1 = {1,k1,-2 k2} and cf2 = {-2,-k3}
I would like to get the list
>{-2,-2 k1-k3,4 k2-k1 k3,2 k2 k3}
>for p1[x]*p2[x]
productList[cf1_,cf2_]:=ListConvolve[cf1, cf2, {1, -1}, 0]
>and the list
>{-1,k1-k3,-2 k2}
>for p1[x]+p2[x]
You need some padding here.
If you can supply the missing coeffients in your input, such as in
cf1 = {1,k1,-2 k2};
cf2 = {-2,-k3,0}
You just have to sum the two lists
sumList[cf1_,cf2_]:= cf1+cf2
otherwise you'll have to add a couple of lines to pad the shortest list
with
zeros up the the lenght of the longest one. Something like this would do:
sumList[cf1_,cf2_]:=Module[
{n=Max[Length[cf1],Length[cf2]]},
PadRight[cf1,n]+PadRight[cf2,n]
]
I haven't had a chanche to test the procedures, though. Check'em out prior
to using them.
cheers,
Peltio
====
does anybody have 2 functions ready to multiply and add
> 2 polynomials directly from their CoefficientList's?
example: the polynomials I'm considering are
> p1[x_] := 1 + k1 x - 2 k2 x^2
> p2[x_] := -2 -k3 x
Given
> cf1 = {1,k1,-2 k2}
> and
> cf2 = {-2,-k3}
I would like to get the list
> {-2,-2 k1-k3,4 k2-k1 k3,2 k2 k3}
> for p1[x]*p2[x]
and the list
> {-1,k1-k3,-2 k2}
> for p1[x]+p2[x]
without performing operations like
CoefficientList[
> cf1.Table[x^i,{i,0,Length[cf1]-1}]*
> cf2.Table[x^i,{i,0,Length[cf2]-1}], x]
--
> Paolo
pauldj@cs.utexas.edu paolo.bientinesi@iit.cnr.it
The code below will do this.
truncateRight[c1_] := Module[{len=Length[c1]},
While[c1[[len]]===0, len--]; Take[c1,len]]
coefficientListPlus[c1_,c2_] := With[{len=Max[Length[c1],Length[c2]]},
truncateRight[PadRight[cf1,len] + PadRight[cf2,len]]]
coefficientListTimes[c1_,c2_] := ListConvolve[c1, c2, {1,-1}, 0]
For your example:
p1[x_] := 1 + k1*x - 2*k2*x^2
p2[x_] := -2 -k3*x
cf1 = CoefficientList[p1[x], x];
cf2 = CoefficientList[p2[x], x];
In[24]:= InputForm[coefficientListPlus[cf1,cf2]]
Out[24]//InputForm= {-1, k1 - k3, -2*k2}
In[25]:= InputForm[coefficientListTimes[cf1,cf2]]
Out[25]//InputForm= {-2, -2*k1 - k3, 4*k2 - k1*k3, 2*k2*k3}
For the special case where one works with univariate polynomials with
coefficients in a prime field there is more efficient code for
multiplication (though it does not much matter if the degree tends to be
low).
Daniel Lichtblau
Wolfram Research
====
Paolo,
For multiplying polynomials, the simplest solution is to use ListConvolve.
For example,
In[7]:=
ListConvolve[cf1, cf2, {1, -1}, 0]
Out[7]=
{-2, -2 k1 - k3, 4 k2 - k1 k3, 2 k2 k3}
For adding polynomials, the simplest solution is to use padding. For
example,
In[8]:=
cf1 + PadRight[cf2, 3]
Out[8]=
{-1, k1 - k3, -2 k2}
Carl Woll
> does anybody have 2 functions ready to multiply and add
> 2 polynomials directly from their CoefficientList's?
example: the polynomials I'm considering are
> p1[x_] := 1 + k1 x - 2 k2 x^2
> p2[x_] := -2 -k3 x
Given
> cf1 = {1,k1,-2 k2}
> and
> cf2 = {-2,-k3}
I would like to get the list
> {-2,-2 k1-k3,4 k2-k1 k3,2 k2 k3}
> for p1[x]*p2[x]
and the list
> {-1,k1-k3,-2 k2}
> for p1[x]+p2[x]
without performing operations like
CoefficientList[
> cf1.Table[x^i,{i,0,Length[cf1]-1}]*
> cf2.Table[x^i,{i,0,Length[cf2]-1}], x]
--
> Paolo
pauldj@cs.utexas.edu paolo.bientinesi@iit.cnr.it
>
====
CoefficientAdd[lst1_, lst2_] /; Length[lst1] == Length[lst2] := lst1 +
lst2
CoefficientAdd[lst1_, lst2_] /; Length[lst1] > Length[lst2] :=
CoefficientAdd[lst1, PadRight[lst2, Length[lst1], 0]]
CoefficientAdd[lst1_, lst2_] := CoefficientAdd[lst2, lst1]
and
p1[x_] := 1 + k1 x - 2 k2 x^2
p2[x_] := -2 - k3 x
lst1 = CoefficientList[p1[x], x];
lst2 = CoefficientList[p2[x], x];
CoefficientAdd[lst1, lst2]
will help you.
Jens
does anybody have 2 functions ready to multiply and add
> 2 polynomials directly from their CoefficientList's?
example: the polynomials I'm considering are
> p1[x_] := 1 + k1 x - 2 k2 x^2
> p2[x_] := -2 -k3 x
Given
> cf1 = {1,k1,-2 k2}
> and
> cf2 = {-2,-k3}
I would like to get the list
> {-2,-2 k1-k3,4 k2-k1 k3,2 k2 k3}
> for p1[x]*p2[x]
and the list
> {-1,k1-k3,-2 k2}
> for p1[x]+p2[x]
without performing operations like
CoefficientList[
> cf1.Table[x^i,{i,0,Length[cf1]-1}]*
> cf2.Table[x^i,{i,0,Length[cf2]-1}], x]
--
> Paolo
pauldj@cs.utexas.edu paolo.bientinesi@iit.cnr.it
====
>-----Original Message-----
>To: mathgroup@smc.vnet.net
>does anybody have 2 functions ready to multiply and add
>2 polynomials directly from their CoefficientList's?
example: the polynomials I'm considering are
>p1[x_] := 1 + k1 x - 2 k2 x^2
>p2[x_] := -2 -k3 x
Given
>cf1 = {1,k1,-2 k2}
>and
>cf2 = {-2,-k3}
I would like to get the list
>{-2,-2 k1-k3,4 k2-k1 k3,2 k2 k3}
>for p1[x]*p2[x]
and the list
>{-1,k1-k3,-2 k2}
>for p1[x]+p2[x]
without performing operations like
CoefficientList[
> cf1.Table[x^i,{i,0,Length[cf1]-1}]*
> cf2.Table[x^i,{i,0,Length[cf2]-1}], x]
--
>Paolo
pauldj@cs.utexas.edu paolo.bientinesi@iit.cnr.it
>
Paolo,
With
In[1]:= cf1 = {1, k1, -2 k2};
In[2]:= cf2 = {-2, -k3};
you may add lists component-wise:
In[3]:= With[{len = Max[Length /@ {##}]},
PadRight[#, len] & /@ Unevaluated[Plus[##]]] &[cf1, cf2]
Out[3]= {-1, k1 - k3, -2 k2}
Adjusting for same length appears to be a bit nasty!
Multiplication is easier:
In[4]:= ListConvolve[cf1, cf2, {1, -1}, 0]
Out[4]=
{-2, -2 k1 - k3, 4 k2 - k1 k3, 2 k2 k3}
To me however it appears to be much more appropriate to use Mathematicas
built-in abilities to deal with polynomials, and come back to coefficient
lists only when necessary for the results (if ever).
In[5]:= p1 = Normal[SeriesData[x, 0, cf1]]
Out[5]= 1 + k1*x - 2*k2*x^2
In[6]:= p2 = Normal[SeriesData[x, 0, cf2]]
Out[6]= -2 - k3 x
In[7]:= CoefficientList[p1 + p2, x]
Out[7]= {-1, k1 - k3, -2 k2}
In[8]:= CoefficientList[p1*p2, x]
Out[8]= {-2, -2 k1 - k3, 4 k2 - k1 k3, 2 k2 k3}
--
Hartmut Wolf
====
1) At least three syntax errors are in this text. Look for & & instead &&
2) Rewrite your SetDelayed in the following form
o1[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
Evaluate[LogicalExpand[righthandside]]
This will save you some time but only if:
3) you state the definitions in reverse order. Otherwise you are getting
lost alredy at definition time.
4) write a test set
test=
Rule@@@Transpose[{{a1,a1,...b4},Table[If[Random[]<0.5,True,False],{8}]}]
and test your definitions using values Replace[#,test]&/@op[a1..]
5) You need at least 256 MB memory. Otherwise disk swapping becomes time
consuming
6)dont print the full result. (I have not seen it;-) Probably it will
take 100 times the memory used to represent the result internally.
7) Try
Xor[1 && 2 || 3 && 4, 5 && 6 || 7 && 8, 9 && 10 || 11 && 12] //
LogicalExpand
to see the explosion of logical combinations. Try to write the result
using Partition.
The complexity is seen by considering the value table: 2^8 =256 possible
input values for a1..b4 in{True,False}. It will be easier to calculate
this table using all possible values of True,False instead of symbolic
expressions.
--
Roland Franzius
I've got the following simple (well, IMO) boolean equations and can't
> believe that it takes more than 2 hours on an Intel(R) Xeon(TM) CPU
> 2.00GHz to evaluate the last output: foo[a1, a2, a3, a4, b1, b2, b3, b4]
> I'm using mathematica 4.1.
Am I doing something wrong?
cheers,
> Tom
Here comes the code:
o1[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> (a4 && b1 && b2 && b3 && b4) || (a1 && a4 && b2 && b3 && b4) ||
> (a2 && a4 && b1 && b3 && b4) || (a1 && a2 && a4 && b3 && b4) ||
> (a3 && a4 && b1 && b2 && b4) || (a1 && a3 && a4 && b2 && b4) ||
> (a2 && a3 && a4 && b1 && b4) || (a1 && a2 && a3 && a4 && b4) ||
> (a3 && b1 && b2 && b3) || (a1 && a3 && b2 && b3) ||
> (a2 && a3 && b1 && b3) || (a1 && a2 && a3 && b3) ||
> (a2 && b1 && b2) || (a1 && a2 && b2) || (a1 & & b1);
o2[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> (a1 && !a4 && !b1 && !b2 && !b3) || (!a1 && !a4 && b1 && !b2 && !b3) ||
> (a1 && !a2 && !a4 && !b1 && !b3) || (!a1 && !a2 && !a4 && b1 && !b3) ||
> (a1 && !a3 && !a4 && !b1 && !b2) || (!a1 && !a3 && !a4 && b1 && !b2) ||
> (a1 && !a2 && !a3 && !a4 && !b1) || (!a1 && !a2 && !a3 && !a4 && b1) ||
> (a1 && !b1 && !b2 && !b3 && !b4) || (!a1 && b1 && !b2 && !b3 && !b4) ||
> (a1 && !a2 && !b1 && !b3 && !b4) || (!a1 && !a2 && b1 && !b3 && !b4) ||
> (a1 && !a3 && !b1 && !b2 && !b4) || (!a1 && !a3 && b1 && !b2 && !b4) ||
> (a1 && !a2 && !a3 && !b1 && !b4) || (!a1 && !a2 & &!a3 && b1 && !b4) ||
> (!a1 && a4 && !b1 && b2 && b3 && b4) ||
> (!a1 && a2 && a4 && !b1 && b3 && b4) ||
> (!a1 && a3 && a4 && !b1 && b2 && b4) ||
> (!a1 && a2 && a3 && a4 && !b1 && b4) ||
> (a1 && a4 && b1 && b2 && b3 && b4) ||
> (a1 && a2 && a4 && b1 && b3 && b4) ||
> (a1 && a3 && a4 && b1 && b2 && b4) ||
> (a1 && a2 && a3 && a4 && b1 && b4) ||
> (a1 && !a3 && !b1 && !b2 && !b3) || (!a1 && !a3 && b1 && !b2 && !b3) ||
> (a1 && !a2 && !a3 && !b1 && !b3) || (!a1 && !a2 && !a3 && b1 && !b3) ||
> (!a1 && a3 && !b1 && b2 && b3) || (!a1 && a2 && a3 && !b1 && b3) ||
> (a1 && a3 && b1 && b2 && b3) || (a1 && a2 && a3 && b1 && b3) ||
> (a1 && !a2 && !b1 && !b2) || (!a1 && !a2 && b1 && !b2) ||
> (!a1 && a2 && !b1 && b2) || (a1 && a2 && b1 && b2);
o3[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> (a2 && !a4 && !b2 && !b3) || (!a2 && !a4 && b2 && !b3) ||
> (a2 && !a3 && !a4 && !b2) || (!a2 && !a3 && !a4 && b2) ||
> (a2 && !b2 && !b3 && !b4) || (!a2 && b2 && !b3 && !b4) ||
> (a2 && !a3 && !b2 && !b4) || (!a2 && !a3 && b2 && !b4) ||
> (!a2 && a4 && !b2 && b3 & & b4) || (!a2 && a3 && a4 && !b2 && b4) ||
> (a2 && a4 && b2 && b3 && b4) || (a2 && a3 && a4 && b2 && b4) ||
> (a2 && !a3 && !b2 && !b3) || (!a2 && !a3 && b2 && !b3) ||
> (!a2 && a3 && !b2 && b3) || (a2 && a3 && b2 && b3);
o4[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> (!a3 && a4 && !b3 && b4) || (a3 && a4 && b3 && b4) ||
> (a3 && !b3 && !b4) || (!a3 && b3 && !b4) || (a3 && !a4 && !b3) ||
> (!a3 && !a4 && b3);
o5[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> (a4 && !b4) || (!a4 && b4);
oparity[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> Xor[o1[a1, a2, a3, a4, b1, b2, b3, b4],
> o2[a1, a2, a3, a4, b1, b2, b3, b4],
> o3[a1, a2, a3, a4, b1, b2, b3, b4],
> o4[a1, a2, a3, a4, b1, b2, b3, b4],
> o5[a1, a2, a3, a4, b1, b2, b3, b4]];
foo[a1_, a2_, a3_, a4_, b1_, b2_, b3_, b4_] :=
> Simplify[Xor[oparity[a1, a2, a3, a4, b1, b2, b3, b4],
> !oparity[!a1, !a2, !a3, !a4, !b1, !b2, !b3, !b4]]];
foo[a1, a2, a3, a4, b1, b2, b3, b4]
>
====
When computing inverse Fourier transforms the principal value may give
the answer even when the integral does not converge. On p. 386 of
Churchill's Operational Mathematics there is an example which turns out
to be the very integral in question. Have we come full circle?
> More on this theme: can somebody explain what the concept of a
> principal value of an integral is good for? I have been a
> professional mathematician for years and have been involved in several
> different areas of research, and yet never came across any use for it.
> I have more then a dozen texts on analysis yet none of them mentions
> it. The only books where I can find it mentioned are books for
> physicists and engineers (one is the well known text by Riley, Hobson
> and Bence, the other a book in Polish) and they both give one line
> definitions without any examples of use (and do not mention poles at
> infinity). At first sight it seems a pretty trivial and useless
> concept, so I would like to know if it really has any serious
> applications.
Andrzej Kozlowski
>> In fact, I somehow did not notice the PrincipalValue->True in the
>> Jean-Clause's question, but Mathematica's documentation says:
>> Setting PrincipalValue->True gives finite answers for integrals that
>> had single pole divergences with PrincipalValue->False.
>> It is not clear form this if poles at infinity are included but this
>> example suggests that probably not. It is also not obvious to me that
>> they ought to be included; although I myself have already long since
>> forgotten this stuff, a couple of well-known text books I looked at do
>> not mention them when defining principal value.
>> Andrzej Kozlowski
>>>>> I'm not a mathematician and I wonder why Mathematica doesn't return
>>>>> 0
>>>>> for this doubly infinite improper integral :
>>>>>>>> Out[1]=4.1 for Microsoft Windows (November 2, 2000)
>>>>>>>> In[2]:=Integrate[x/(1+x^2),{x,-Infinity,Infinity},PrincipalValue-
>>>>>> True]
>>>>> Integrate::idiv[...]does not converge[...]
>>>>> Out[2]:=Integrate[x/(1+x^2),{x,-Infinity,Infinity},
>>>>> PrincipalValue->True]
>>>>>>>> maybe it's different with Mathematica 5.0 ?
>>>>>>> No it is the same, and it is correct.
>>>> Correct??
>>> Well, at least it's not blatantly wrong. Mathematica makes the
>>> statement
>>> does not converge about
>>> Integrate[x/(1+x^2),{x,-Infinity,Infinity}],
>>> rather than about its Cauchy principal value. But Mathematica never
>>> gets
>>> the answer to the question that was asked. If a student gave me the
>>> same
>>> response to that question on a test, they would get little (if any)
>>> partial
>>> credit.
>>>>> Presumably the reason why you
>>>> think the answer should be zero is:
>>>>>> In[21]:=
>>>> Integrate[x/(1 + x^2), {x, -a, a}]
>>>>>> Out[21]=
>>>> 0
>>>>>> But Integrate[x/(1 + x^2), {x, -Infinity, Infinity}] is not just
>>>> the
>>>> limit of the above as a->Infinity.
>>>> Right. But Jean-Claude's question was specifically about that
>>> integral's
>>> _Cauchy principal value_, which is precisely the limit you mentioned.
>>> Thus,
>>>> In[1]:= Limit[Integrate[x/(1+x^2),{x,-a,a}],a->Infinity]
>>>> Out[1]= 0
>>>> is a way for us to assist Mathematica so that it can give the correct
>>> answer for the Cauchy principal value.
>>>> But of course, we shouldn't have to assist Mathematica in this way!
>>>> David Cantrell
>>>>> What has to be true is that the
>>>> limits of Integrate[x/(1 + x^2), {x, a, b}] must exist as a ->>> -Infinity and b->Infinity independently of one another. This is of
>>>> course not true. If you defined the infinite integral in a different
>>>> way you could end up with all sorts of contradictions. For example,
>>>> observe that:
>>>>>> Limit[Integrate[x/(1 + x^2), {x, -a, 2*a}], a -> Infinity]
>>>>>> Log[2]
>>>>>> and so on.
>>
>
Garry Helzer
Department of Mathematics
University of Maryland
1303 Math Bldg
College Park, MD 20742-4015
====
I try to write out some data to a file. I need them to be in a table form.
I.e. Each row is an instance, and each column is the value for each time
point.
I successfully use the below function to get the correct format in
mathematica
new = Table[trajectory[j][t], {j, 1, 11}, {t, 0, 100, 1}]
datainfile = TableForm[new, TableHeadings -> {None, Automatic} ]
The output looks good so far, it likes
1 2 3 4 5 ....
0.1 0.2 0.3 0.5 0.8
1.0 1.1 1.2 1.8 1.0
0.3 0.5 1.0 0.9 1.0
...
however, when I type in
datainfile >> outputfile
The output file outputfile does not contain the correct format , it
becomes like:
TableForm[{{1., 2, 3, 4,
5,...},{0.1,0.2,0.3, 0.5,0.8},{1.0, 1.1, 1.2,1.8,1.0}....]
i am just wondering is there anyway to come across the problem and get the
kind of format that I want in the output file?
jc
====
====
Second question about polynomials:
assume you are given a polynomial
p[x_] := c[0] + c[1] x + c[2] x^2 ....
and you want to generate a polynomial p1[x] from p[x]
changing one coefficient only, like:
p1[x_] := -c[0] + c[1] x + c[2] x^2
Is there any other way other than the obvious CoefficientList
solution?
--
Paolo
pauldj@cs.utexas.edu paolo.bientinesi@iit.cnr.it
====
Mathematica can solve it: just type
Solve[y Log[x] == (1 - x), x]
The result is in terms of the ProductLog, aka the Lambert W function, a
built-in function.
> I 'm trying to find a way to solve the equation
y = (1-x)/ Log(x)
How can I find x when y is known ?
Is there a numerical method ?
> with series development?
--
> Bernard Bour.8ee
> bernard@bouree.net
====
Mathematica 5 gives the following:
In[2]:=
Solve[y == (1 - x)/Log[x], x]
Out[2]=
{{x -> y*ProductLog[E^(1/y)/y]}}
--
Steve Luttrell
West Malvern, UK
> I 'm trying to find a way to solve the equation
y = (1-x)/ Log(x)
How can I find x when y is known ?
Is there a numerical method ?
> with series development?
--
> Bernard Bour.8ee
> bernard@bouree.net
====
Your equation has a real solution only for x less than about -0.2 or so.
In
this range you could use FindRoot[].
In[1]:=
? FindRoot
In[2]:=
f[y_] :=
x /. FindRoot[y == (1 - x)/Log[x], {x,
1 + $MachineEpsilon, 10^6}]
In[3]:=
f[-2]
Out[3]=
3.51286
In[4]:=
f[-1]
Out[4]=
1.
In[5]:=
f[-7]
Out[5]=
22.9259
In[6]:=
!(f[(-10^4)])
Out[6]=
116672.
--
Curt Fischer
====
Yes, the .8equation you want to solve is transcendental, so the only ways
to
solve it are numerical.
The most simple way is to use FindRoot.
But first, don't forget to draw f(x)=(1-x)/Log(x)-y ! You have to see an
approximation of the root you are searching !
For example, let y = -2 :
In[1]:= Plot[(1 - x)/Log[x] + 2, {x, 0, 10},PlotRange -> {-4, 4}];
In[2]:= FindRoot[(1 - x)/Log[x] == -2, {x, 2}]
Meilleures salutations
Florian Jaccard
-----Message d'origine-----
Ë : mathgroup@smc.vnet.net
Objet : Log Equation
I 'm trying to find a way to solve the equation
y = (1-x)/ Log(x)
How can I find x when y is known ?
Is there a numerical method ?
with series development?
--
Bernard Bour.8ee
bernard@bouree.net
====
Methinks I did something after I first installed Mathematica which
disable graphics. AFter Plot.. I get Bad Command or Filename
and the --Graphics-- indicator.
- = -
Vasos-Peter John Panagiotopoulos II, Columbia'81+, Bio$trategist
BachMozart ReaganQuayle EvrytanoKastorian
http://ourworld.compuserve.com/homepages/vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
====
> I 'm trying to find a way to solve the equation
> y = (1-x)/ Log(x)
> How can I find x when y is known ?
Have you tried either NSolve or Solve? With no values assigned to either y
or x, you can use
Solve[y==(1-x)/Log@x,x]
which will return
{{x->y ProductLog[Exp[1/y]/y]}}
or with a real value assigned to y you can use
NSolve[y==(1-x)/Log@x,x]
--