Re: Assigning (really dumb question)

• To: mathgroup at smc.vnet.net
• Subject: [mg61005] Re: Assigning (really dumb question)
• From: Peter Pein <petsie at dordos.net>
• Date: Fri, 7 Oct 2005 03:37:49 -0400 (EDT)
• References: <di2ml8\$8h0\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```vjp2.at at at.BioStrategist.dot.dot.com schrieb:
> What the heck am I doing wrong? I've been away from Mathematica for a while.
>
> I can't get it to evaluate the expressions at the solved values.
>
> I feel so stupid.
>
> r[q_] := 1800 q - .006 q^2
> c[q_] := 12100000 + 800 q + .004 q ^2
>
> qa = Solve[ D[ r[q]-c[q] , q] == 0, q]
> r[q] /. q -> qa
> c[q] /. q -> qa
> r[q]-c[q] /. q -> qa
> D[r[q],q] /. q -> qa
> D[c[q],q] /. q -> qa
>
> qm = Solve[ c[q]/q - D[c[q] , q] == 0, q] []
> r[qm] /. q -> qm
> c[qm] /. q -> qm
> r[qm]-c[qm] /. q -> qm
> D[r[q],q] /. q -> qm
> D[c[q],q] /. q -> qm
>
>
> (PS, a while back I was asking how to fix DOS 2.2.2 when it wasn't
> doing graphics and I was told it was no longer supported. Well, 2yrs
> later, dumbo me, realised I just had to cd into the math directory and
> all was fine.)
>
>
> 				- = -
>     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]
>  [Fooey on GIU,{MS,X}Windows 4 Bimbos] [Cigar smoke belongs in veg food group]
>

Hello,

what do you expect, when you replace q by a List of a list of Rules as in
r[q] /. q -> {{Britannia \[Rule] theWaves}}?

Or when calling r with a list of list of rules as parameter an applying
the list of rules to the result?

Try r[q]/.qa etc., but I would prefer

qa=First[q/.Solve[r'[q]==c'[q]]] and
qm=First@Select[q/.Solve[c[q]==q*c'[q]],#>0&].

Then you can evaluate r[qa], c'[qm] etc directly.

Peter

```

• Prev by Date: Re: Assigning (really dumb question)
• Next by Date: Re: Re: Help with output form?
• Previous by thread: Re: Assigning (really dumb question)
• Next by thread: MathML, Mozilla, fonts and Mathematica 5.2
{"ft_lang_label":"__label__en","ft_lang_prob":0.8303541,"math_prob":0.8257177,"size":1952,"snap":"2022-27-2022-33","text_gpt3_token_len":683,"char_repetition_ratio":0.118583165,"word_repetition_ratio":0.056657225,"special_character_ratio":0.38473362,"punctuation_ratio":0.18284424,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.952847,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-14T03:20:11Z\",\"WARC-Record-ID\":\"<urn:uuid:9eff58f2-e760-4986-be78-c0ca19a0460f>\",\"Content-Length\":\"45711\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e40edac7-5e42-458b-9aac-eb3af620a83f>\",\"WARC-Concurrent-To\":\"<urn:uuid:f9c59d98-fbcf-47a9-8e03-136e3ef11799>\",\"WARC-IP-Address\":\"140.177.205.73\",\"WARC-Target-URI\":\"https://forums.wolfram.com/mathgroup/archive/2005/Oct/msg00142.html\",\"WARC-Payload-Digest\":\"sha1:JYTD635ZVKWGUZPQSZHJVR22XO7B2NSK\",\"WARC-Block-Digest\":\"sha1:DSYFD34FXLAO7A4Y7OXSZLACL5PSNVDY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882571993.68_warc_CC-MAIN-20220814022847-20220814052847-00241.warc.gz\"}"}