Re: programming in mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg42412] Re: [mg42389] programming in mathematica
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Sat, 5 Jul 2003 03:10:57 -0400 (EDT)
- References: <200307040533.BAA10454@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
First, a point on syntax: multiplication requires inserting a "*" or leaving an empty space between factors. Second, if I understand correctly, you wish to substitute the variable z by a - h? In that case, use ReplaceAll (/.), e.g. In[2]:= g*(z^h/(a*z^b + c*z^d + e*z^f)) /. z -> a - h Out[2]= (g*(a - h)^h)/(a*(a - h)^b + c*(a - h)^d + e*(a - h)^f) This may be applied to any expression, in your case the sum of all the fractions at the same time. Tomas Garza Mexico City ----- Original Message ----- From: "Pickard Laura R" <LRPICKARD at mail.dstl.gov.uk> To: mathgroup at smc.vnet.net Subject: [mg42412] [mg42389] programming in mathematica > Hi all, > > I cannot view the newsgroup as I am stuck behind a firewall here, but if you > could email me any help with this, it would be much appreciated. > > I am new to using mathematica (currently I have version 4.1, should be > getting a trial copy of version 5 soon, my os is winNT). I have been > attempting to do some programming and need to automate a calculation, to be > done far too many times to attempt it manually. > > A previous calculation outputs a sum of fractions in terms of z, all are of > the form gz^h/(az^b+cz^d+ez^f). I need to do a calculation involving the > numbers a-h. I would like to be able to input the fraction, automatically > assign the correct numbers from it to the variables a-h, then do the > calculation and output the result. Ideally, if I could input the sum of all > the fractions directly as output from the previous calculation and do this > for each one, then output an answer which is the sum of the results for each > fraction that would be best. I have found my way around programming in > basic functions, but am unsure as to how to input a standard form of > equation and automatically assign the values to the variables for > calculation. > > Any help would be greatly appreciated. > > Thanks, > > Laura Pickard. > > "This e-mail is intended for the recipient only. If you are not the > intended recipient you must not use, disclose, distribute, copy, print, > or rely upon this e-mail. If an addressing or transmission error has > misdirected this e-mail, please notify the author by replying to this e-mail." > > "Recipients should note that all e-mail traffic on MOD systems is > subject to monitoring and auditing." >
- References:
- programming in mathematica
- From: Pickard Laura R <LRPICKARD@mail.dstl.gov.uk>
- programming in mathematica