Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #12300
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'ok.': 0.04; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:log': 0.09; 'examples': 0.11; 'argument': 0.15; '(lambda': 0.16; 'bieber': 0.16; 'declaimed': 0.16; 'defer': 0.16; 'email addr:ix.netcom.com': 0.16; 'email name:wlfraed': 0.16; 'from:addr:ix.netcom.com': 0.16; 'from:addr:wlfraed': 0.16; 'from:name:dennis lee bieber': 0.16; 'installed,': 0.16; 'received:66.245': 0.16; 'received:dsl.mindspring.com': 0.16; 'received:mindspring.com': 0.16; 'received:wlfraed': 0.16; 'subject:function': 0.16; 'symbolic': 0.16; 'url:netcom': 0.16; 'url:wlfraed': 0.16; 'wulfraed': 0.16; '>>>': 0.18; 'trying': 0.21; 'url:home': 0.21; 'maybe': 0.21; "doesn't": 0.22; 'itself,': 0.23; 'aug': 0.24; 'function': 0.27; 'skip:[ 10': 0.27; 'raise': 0.28; 'lee': 0.28; 'expressions': 0.29; 'example': 0.30; 'sun,': 0.30; 'typeerror:': 0.30; 'list': 0.32; 'there': 0.33; 'to:addr :python-list': 0.33; '???': 0.34; 'header:X-Complaints-To:1': 0.35; 'subject:How': 0.35; 'charset:us-ascii': 0.36; 'but': 0.37; 'subject:can': 0.38; 'received:org': 0.38; 'subject:: ': 0.39; 'ok,': 0.39; 'header:Mime-Version:1': 0.39; 'define': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'show': 0.67; 'subject:like': 0.67; 'online': 0.71; 'dennis': 0.77; 'below:': 0.80; 'exp,': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
| Subject | Re: How can I solve a equation like solve a function containint expressions like sqrt(log(x) - 1) = 2 and exp((log(x) - 1.5)**2 - 3) = 5 |
| Date | Sat, 27 Aug 2011 13:53:20 -0700 |
| Organization | > Bestiaria Support Staff < |
| References | <CADx86fGCVe_r+hXiGpmT8hK7=GsOh82ckHupxAah2rX1bYoURQ@mail.gmail.com> <CADx86fFDnG4+9_E2wu84YQHToN7S1dxBdHFiSwrFuHMEdr-mKw@mail.gmail.com> <CADx86fExq4QSwHH43_254G0iA22xCi4hK6eh_zMX8XzFMtFFZA@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | user-11fb6hj.dsl.mindspring.com |
| X-Newsreader | Forte Agent 3.3/32.846 |
| X-No-Archive | YES |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.484.1314478507.27778.python-list@python.org> (permalink) |
| Lines | 38 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1314478507 news.xs4all.nl 2402 [2001:888:2000:d::a6]:51817 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:12300 |
Show key headers only | View raw
On Sun, 28 Aug 2011 03:24:33 +0800, Xiong Deng <dbigbear@gmail.com>
declaimed the following in gmane.comp.python.general:
> >>>solve(x * ((1.0 / sqrt(2 * pi) * x * sigma) * exp(-0.5 * (log(x) - mu)**2
> / sigma**2)) + 0.5 * erfc((mu - log(x)) / (sigma * sqrt(2))) - 1, x)
>
<snip>
> raise TypeError("cannot create mpf from " + repr(x))
> TypeError: cannot create mpf from x
>
> But sqrt, log, exp, itself is OK, as shown as below:
>
> >>> solve((1.0 / sqrt(2 * pi) * x * sigma) - 1, x)
> [0.626657068657750]
>
> SO, How can I solve an equation containint expressions like sqrt(log(x) -
> 1)=0 or exp((log(x) - mu)**2 - 3) = 0??? If there are any other methods
> without Sympy, it is still OK.
>
Trying a WAG... Perhaps you need to defer execution of said
functions within the equation... Maybe with lambda?
(lambda x=x: log(x))(x)
???
I don't have sympy installed, and the online example of .solve()
doesn't show any examples with nested functions (that is, where 'x' is
an argument to a function that is itself an argument to a function in
the equation).
Or perhaps you need to define log() as a symbolic function itself,
and include it in the list of variables?
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: How can I solve a equation like solve a function containint expressions like sqrt(log(x) - 1) = 2 and exp((log(x) - 1.5)**2 - 3) = 5 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-08-27 13:53 -0700
csiph-web