Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35909 > unrolled thread
| Started by | Usama Khan <usamazohad@gmail.com> |
|---|---|
| First post | 2013-01-01 11:02 -0800 |
| Last post | 2013-01-02 09:27 +1100 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.lang.python
how to solve complex equation? Usama Khan <usamazohad@gmail.com> - 2013-01-01 11:02 -0800
Re: how to solve complex equation? jt@toerring.de (Jens Thoms Toerring) - 2013-01-01 21:49 +0000
Re: how to solve complex equation? someone <newsboost@gmail.com> - 2013-01-02 04:55 +0100
Re: how to solve complex equation? Gary Herron <gherron@digipen.edu> - 2013-01-01 14:46 -0800
Re: how to solve complex equation? alex23 <wuwei23@gmail.com> - 2013-01-01 14:57 -0800
Re: how to solve complex equation? Usama Khan <usamazohad@gmail.com> - 2013-01-01 15:08 -0800
Re: how to solve complex equation? Chris Angelico <rosuav@gmail.com> - 2013-01-02 09:27 +1100
| From | Usama Khan <usamazohad@gmail.com> |
|---|---|
| Date | 2013-01-01 11:02 -0800 |
| Subject | how to solve complex equation? |
| Message-ID | <cf2440ec-d94b-4831-b5ad-cc786cbeb7dc@googlegroups.com> |
how to solve complex equation in pyhton? and then use it to make a program. . i have created new post as my last post is i guessed ranked as a cheater. .:( i know very litle about python as well as programing. . which equation am taliking u will be thinking. . i am giving u the link kindly c that equation. . n kindly let me know the way. . https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.python/cxG7DLxXgmo
[toc] | [next] | [standalone]
| From | jt@toerring.de (Jens Thoms Toerring) |
|---|---|
| Date | 2013-01-01 21:49 +0000 |
| Message-ID | <akh403Fd872U1@mid.uni-berlin.de> |
| In reply to | #35909 |
Usama Khan <usamazohad@gmail.com> wrote:
> how to solve complex equation in pyhton? and then use it to make a program.
> . i have created new post as my last post is i guessed ranked as a cheater.
> .:(
> i know very litle about python as well as programing. .
> which equation am taliking u will be thinking. . i am giving u the link
> kindly c that equation. . n kindly let me know the way. .
> https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.python/cxG7DLxXgmo
First of all, the equation given there is unusable (even the number
of parentheses doesn't match up). Propbably it's meant to be the
one someone else posted a link to:
http://classes.engr.oregonstate.edu/cce/winter2012/ce492/Modules/06_structural_design/06-3_body.htm
This thingy can't be solved on paper so you need some iterative
algorithm to find the solution. So waht you do is modify the equa-
tion so that you have 0 on one side and then consider the other
side to be a function of SN+1. Now the problem you're left with
is to find the value(s) of SN+1 (and thus of SN) where the func-
tion has a zero-crossing. A commonly use algorithms for finding
zero-crossings is Newton's method. You can find lots of sites on
the internet describing it in all neccessary detail. It boils
down to start with some guess for the result and then calculate
the next, better approximation via
xn+1 = xn - f(xn) / f'(xn)
where f(xn)n) is the value of the function at point xn and
f'(xn) the value of the derivative of f (with respect to x)
also at xn. You repeat the process until the difference be-
tween xn an the next, better approximation, xn+1, has become
as small as you need it.
So it's very simple to implement and the ugliest bit is pro-
bably calculating the required derivative of the function with
respect to SN+1 (wbich you can take to be x).
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
[toc] | [prev] | [next] | [standalone]
| From | someone <newsboost@gmail.com> |
|---|---|
| Date | 2013-01-02 04:55 +0100 |
| Message-ID | <kc0b3l$t41$1@dont-email.me> |
| In reply to | #35919 |
On 01/01/2013 10:49 PM, Jens Thoms Toerring wrote: > Usama Khan <usamazohad@gmail.com> wrote: >> how to solve complex equation in pyhton? and then use it to make a program. >> . i have created new post as my last post is i guessed ranked as a cheater. >> .:( > >> i know very litle about python as well as programing. . > >> which equation am taliking u will be thinking. . i am giving u the link >> kindly c that equation. . n kindly let me know the way. . > >> https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.python/cxG7DLxXgmo > > First of all, the equation given there is unusable (even the number > of parentheses doesn't match up). Propbably it's meant to be the > one someone else posted a link to: > > http://classes.engr.oregonstate.edu/cce/winter2012/ce492/Modules/06_structural_design/06-3_body.htm > > This thingy can't be solved on paper so you need some iterative > algorithm to find the solution. So waht you do is modify the equa- > tion so that you have 0 on one side and then consider the other > side to be a function of SN+1. Now the problem you're left with > is to find the value(s) of SN+1 (and thus of SN) where the func- > tion has a zero-crossing. A commonly use algorithms for finding > zero-crossings is Newton's method. You can find lots of sites on > the internet describing it in all neccessary detail. It boils > down to start with some guess for the result and then calculate > the next, better approximation via > > xn+1 = xn - f(xn) / f'(xn) > > where f(xn)n) is the value of the function at point xn and > f'(xn) the value of the derivative of f (with respect to x) > also at xn. You repeat the process until the difference be- > tween xn an the next, better approximation, xn+1, has become > as small as you need it. > > So it's very simple to implement and the ugliest bit is pro- > bably calculating the required derivative of the function with > respect to SN+1 (wbich you can take to be x). Exactly. I think a 5th semester engineering student should know this. If not, it's not the python-skills that is the problem. It's the (lack of) mathematical insight. I think maybe the OP should not demand people here to "show the solution", but begin with something much simpler and then as he becomes better and better with python, he can move towards more programmatically advanced code. The basic idea about an iterating loop, defining an objective function etc is not really advanced python. But I think the OP should start out with something more simple than what he tries to do here. Just starting out by iteratingly finding the solution to x^2-9 = 0 is a great starting place. After having studied, googled python examples on the internet, I think most people should be able to solve x^2-9=0 in a day for a guy who knows about programming in an arbitrary programming language other than python. It looks like laziness, when we don't see any attempts to show what has been tried to do, from the OP's point of view. The best way to get good feedback (IMHO) is to post some code and then post any errors/warnings that python is giving back. Don't just write: "Give me the code for doing this".
[toc] | [prev] | [next] | [standalone]
| From | Gary Herron <gherron@digipen.edu> |
|---|---|
| Date | 2013-01-01 14:46 -0800 |
| Message-ID | <mailman.1535.1357080905.29569.python-list@python.org> |
| In reply to | #35909 |
On 01/01/2013 11:02 AM, Usama Khan wrote: > how to solve complex equation in pyhton? and then use it to make a program. . i have created new post as my last post is i guessed ranked as a cheater. .:( > > i know very litle about python as well as programing. . > > which equation am taliking u will be thinking. . i am giving u the link kindly c that equation. . n kindly let me know the way. . > > https://groups.google.com/forum/?fromgroups=#!topic/comp.lang.python/cxG7DLxXgmo Please STOP asking this question, and try to understand the answers you have already been given. Short answer: This is NOT a python question, and you can't solve it in Python. Longer answer: This is a math question. Some equations can be solved with algebra, and some can't, in which case perhaps you need some sort of a technique for numerical approximation. Other's have indicated that your problem probably falls into the later category. What YOU need to do is investigate iterative techniques for numerical solutions and pick one. (And this Python list is CERTAINLY the wrong place for such math questions.) Once you know what solution technique you want to use, you could then come back to this group and ask for help implementing it. P.S. I have implemented several such techniques, and I have taught college courses involving such techniques, and I'll say this: What you ask is the subject of AT LEAST several hours of lectures and possibly several semesters worth of study. No one is going to put that kind of time into answering your question here. -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418
[toc] | [prev] | [next] | [standalone]
| From | alex23 <wuwei23@gmail.com> |
|---|---|
| Date | 2013-01-01 14:57 -0800 |
| Message-ID | <f0d44a69-0939-4605-ac04-c7b1c822aa29@s6g2000pby.googlegroups.com> |
| In reply to | #35909 |
On Jan 2, 5:02 am, Usama Khan <usamazo...@gmail.com> wrote: > i have created new post as my last post is i guessed ranked as a cheater. .:( Don't do this. Starting new threads on the same subject because you're not happy with the response you're getting elsewhere is a surefire way to end up in a lot of killfiles. > i know very litle about python as well as programing. . Then please stop asking people to write your code for you. For many of us. this is our *profession*. Generally, we're here to help others & ourselves understand Python better, not to work for free. If you don't have the time or the ability to produce what you want, and it has value to you, then offer to *pay* someone for their time & effort in writing the code for you.
[toc] | [prev] | [next] | [standalone]
| From | Usama Khan <usamazohad@gmail.com> |
|---|---|
| Date | 2013-01-01 15:08 -0800 |
| Message-ID | <408a21de-d22d-4d20-88de-981863f46a50@googlegroups.com> |
| In reply to | #35925 |
thanks :) no issues. . :) sorry for wasting ur precious time. . .sorry once again. . its mine problem now. . neither python. .nor the algebra. . . sorry guys. dont mind. .:) dont get me wrong. .
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-01-02 09:27 +1100 |
| Message-ID | <mailman.1542.1357085113.29569.python-list@python.org> |
| In reply to | #35909 |
On Wed, Jan 2, 2013 at 6:02 AM, Usama Khan <usamazohad@gmail.com> wrote:
> how to solve complex equation in pyhton? and then use it to make a program. . i have created new post as my last post is i guessed ranked as a cheater. .:(
1) Do you mean complex or complicated? Be strict with your language,
lest you get completely wrong answers. Python *does* have support for
complex numbers, but I don't think you need them here. (I may be wrong
(again), though.)
2) Put some more thought into your posts. You're coming across
sounding very sloppy. We're all on the internet, so we know how to
read through typos, but a proliferation of them in a message with no
capitalization, SMS abbreviations ("u" for "you"... congrats, you
saved two whole keystrokes there - four, since you did that twice),
etc, adds up to an overall picture of someone who cares little about
how the posts come across.
3) We are all volunteers. Python-list gets a goodly amount of traffic
every day. If you want a response, you need to make your post look
interesting, fun, or productive (preferably more than one of the
above). Make it look like we're going to spend a huge amount of time
helping a black hole is one of the best ways to get ignored.
http://www.catb.org/esr/faqs/smart-questions.html
Since you haven't read that link from last time I posted it, I'll take
the liberty of quoting a portion of its introduction.
"""If you give us an interesting question to chew on we'll be grateful
to you; good questions are a stimulus and a gift. ...What we are,
unapologetically, is hostile to people who seem to be unwilling to
think or to do their own homework before asking questions. People like
that are time sinks — they take without giving back, and they waste
time we could have spent on another question more interesting and
another person more worthy of an answer. We call people like this
“losers” (and for historical reasons we sometimes spell it
“lusers”)."""
If you want a response, don't look like a loser.
ChrisA
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web