Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3053 > unrolled thread
| Started by | Mariano Pierantozzi <mariano.pierantozzi@gmail.com> |
|---|---|
| First post | 2011-06-10 10:39 +0000 |
| Last post | 2011-06-11 10:50 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
How to make the same two expressions Mariano Pierantozzi <mariano.pierantozzi@gmail.com> - 2011-06-10 10:39 +0000
Re: How to make the same two expressions Peter Breitfeld <phbrf@t-online.de> - 2011-06-11 07:58 +0000
Re: How to make the same two expressions "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-06-11 10:50 +0000
| From | Mariano Pierantozzi <mariano.pierantozzi@gmail.com> |
|---|---|
| Date | 2011-06-10 10:39 +0000 |
| Subject | How to make the same two expressions |
| Message-ID | <isss9i$jg1$1@smc.vnet.net> |
Hi everyone, i've this problem with Mathemtica: i've got 2 expression depending on a and b: expr1= -1.0019 - 1. Log[0.00190438 - 0.0249519 b] + (0.000040093 a Log[0.152644/(0.152644 + 2 b)])/b expr2=-1.00004 - 1. Log[0.0000378969 - 0.0249519 b] + (0.000040093 a Log[0.0030376/(0.0030376 + 2 b)])/b I want to make the same this two expressions. The problem is that if i try to solve this is one equation in two parameter: a and b. So i think to put inside some value of a and b so i make equal the two expression less than 10^-12 (for example) I've to do a list of value: b can vary beetwen -0.0015188 < b < 0.0015188 (the domain of logarithmic function) and a must vary for example -2000 to 2000. I can not find a waydo it. I try with list, and put the value inside, but i've some problem. if anyone can help I would be grateful... Thank you! Mariano Pierantozzi PhD student
[toc] | [next] | [standalone]
| From | Peter Breitfeld <phbrf@t-online.de> |
|---|---|
| Date | 2011-06-11 07:58 +0000 |
| Message-ID | <isv77c$6l$1@smc.vnet.net> |
| In reply to | #3053 |
Mariano Pierantozzi wrote:
> Hi everyone,
> i've this problem with Mathemtica:
> i've got 2 expression depending on a and b:
> expr1= -1.0019 - 1. Log[0.00190438 - 0.0249519 b] + (0.000040093 a
> Log[0.152644/(0.152644 + 2 b)])/b
> expr2=-1.00004 - 1. Log[0.0000378969 - 0.0249519 b] + (0.000040093 a
> Log[0.0030376/(0.0030376 + 2 b)])/b
> I want to make the same this two expressions.
> The problem is that if i try to solve this is one equation in two parameter:
> a and b.
> So i think to put inside some value of a and b so i make equal the two
> expression less than 10^-12 (for example)
> I've to do a list of value:
> b can vary beetwen -0.0015188 < b < 0.0015188 (the domain of logarithmic
> function) and a must vary for example -2000 to 2000.
> I can not find a waydo it. I try with list, and put the value inside, but
> i've some problem.
> if anyone can help I would be grateful...
> Thank you!
>
> Mariano Pierantozzi
> PhD student
You may use FindInstance:
lsg=FindInstande[expr1==expr2, {a,b}, Reals]
Out= {{a -> 76.1255, b -> -0.00105906}}
expr1-expr2/.lsg
Out= {-8.88178*10^-16}
-0.0015188 < b < 0.0015188 /. lsg
Out= {True}
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2011-06-11 10:50 +0000 |
| Message-ID | <isvh8s$1tg$1@smc.vnet.net> |
| In reply to | #3053 |
If you solve the equation expr1==expr2 for a, then you get a function
af[b_] which tells you for each value of b (within the range of
definition) the value a which makes the two expressions equal.
(* your expressions *)
expr1 = -1.0019 - 1. Log[0.00190438 - 0.0249519 b] + (0.000040093 a
Log[0.152644/(0.152644 + 2 b)])/b;
expr2 = -1.00004 - 1. Log[0.0000378969 - 0.0249519 b] + (0.000040093 a
Log[0.0030376/(0.0030376 + 2 b)])/b;
(* the equation *)
eq = expr1 == expr2;
(* solving for a *)
af[b_] = a /. Solve[eq, a][[1]]; // Chop
(* now some values *)
bmin = -0.0015188;
bmax = -bmin;
db = (bmax - bmin)/10;
Table[{b, af[b]}, {b, bmin + db, bmax - db, db}]
{{-0.00121504, 63.6567}, {-0.00091128, 86.9868}, {-0.00060752,
108.195}, {-0.00030376, 129.314}, {0., Indeterminate}, {0.00030376,
175.787}, {0.00060752, 203.935}, {0.00091128, 239.29}, {0.00121504,
292.055}}
Here I have omitted some error messages connected with b=0.
For b->0 we find
Limit[af[b], b -> 0]
151.47
You can also depict the function graphically
Plot[af[b], {b, bmin, bmax}];
to see that the whole range a>0 is covered.
Hope this helps.
Regards,
Wolfgang
"Mariano Pierantozzi" <mariano.pierantozzi@gmail.com> schrieb im
Newsbeitrag news:isss9i$jg1$1@smc.vnet.net...
> Hi everyone,
> i've this problem with Mathemtica:
> i've got 2 expression depending on a and b:
> expr1= -1.0019 - 1. Log[0.00190438 - 0.0249519 b] + (0.000040093 a
> Log[0.152644/(0.152644 + 2 b)])/b
> expr2=-1.00004 - 1. Log[0.0000378969 - 0.0249519 b] + (0.000040093 a
> Log[0.0030376/(0.0030376 + 2 b)])/b
> I want to make the same this two expressions.
> The problem is that if i try to solve this is one equation in two
> parameter:
> a and b.
> So i think to put inside some value of a and b so i make equal the
> two
> expression less than 10^-12 (for example)
> I've to do a list of value:
> b can vary beetwen -0.0015188 < b < 0.0015188 (the domain of
> logarithmic
> function) and a must vary for example -2000 to 2000.
> I can not find a waydo it. I try with list, and put the value inside,
> but
> i've some problem.
> if anyone can help I would be grateful...
> Thank you!
>
> Mariano Pierantozzi
> PhD student
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web