MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how do I solve for this

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117629] Re: how do I solve for this
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 29 Mar 2011 06:49:53 -0500 (EST)

Sure, no problem, other than there being 3 rather complicated branches of  
v:

D[v /. Solve[p == n*kb*t/(v - n*b) - a*n^2/v^2, v], t]

{(kb n)/(3 p) + (2^(
      1/3) (3 a n^2 p - (-b n p - kb n t)^2) (-9 a kb n^3 p +
        6 b^2 kb n^3 p^2 + 12 b kb^2 n^3 p t +
        6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
              12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
           24 kb n (-b n p -
              kb n t) (3 a n^2 p - (-b n p -
                kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
                2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
                6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
              4 (3 a n^2 p - (-b n p -
                   kb n t)^2)^3))))/(9 p (18 a b n^3 p^2 +
        2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
        6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(
      4/3)) + (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 + 12 b kb^2 n^3 p t +
      6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
            12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
            2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
            6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
         24 kb n (-b n p -
            kb n t) (3 a n^2 p - (-b n p -
              kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
            4 (3 a n^2 p - (-b n p - kb n t)^2)^3)))/(9 2^(1/3)
       p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 - 9 a kb n^3 p t +
        6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(2/3)) - (2 2^(1/3)
       kb n (-b n p - kb n t))/(3 p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
        9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(1/3)), (kb n)/(
   3 p) - ((1 +
        I Sqrt[3]) (3 a n^2 p - (-b n p - kb n t)^2) (-9 a kb n^3 p +
        6 b^2 kb n^3 p^2 + 12 b kb^2 n^3 p t +
        6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
              12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
           24 kb n (-b n p -
              kb n t) (3 a n^2 p - (-b n p -
                kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
                2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
                6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
              4 (3 a n^2 p - (-b n p - kb n t)^2)^3))))/(9 2^(2/3)
       p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 - 9 a kb n^3 p t +
        6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(
      4/3)) - ((1 - I Sqrt[3]) (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
        12 b kb^2 n^3 p t +
        6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
              12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
           24 kb n (-b n p -
              kb n t) (3 a n^2 p - (-b n p -
                kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
                2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
                6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
              4 (3 a n^2 p - (-b n p - kb n t)^2)^3))))/(18 2^(1/3)
       p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 - 9 a kb n^3 p t +
        6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(2/3)) + (2^(
      1/3) (1 + I Sqrt[3]) kb n (-b n p -
        kb n t))/(3 p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
        9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(1/3)), (kb n)/(
   3 p) - ((1 -
        I Sqrt[3]) (3 a n^2 p - (-b n p - kb n t)^2) (-9 a kb n^3 p +
        6 b^2 kb n^3 p^2 + 12 b kb^2 n^3 p t +
        6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
              12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
           24 kb n (-b n p -
              kb n t) (3 a n^2 p - (-b n p -
                kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
                2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
                6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
              4 (3 a n^2 p - (-b n p - kb n t)^2)^3))))/(9 2^(2/3)
       p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 - 9 a kb n^3 p t +
        6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(
      4/3)) - ((1 + I Sqrt[3]) (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
        12 b kb^2 n^3 p t +
        6 kb^3 n^3 t^2 + (2 (-9 a kb n^3 p + 6 b^2 kb n^3 p^2 +
              12 b kb^2 n^3 p t + 6 kb^3 n^3 t^2) (18 a b n^3 p^2 +
              2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
              6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3) +
           24 kb n (-b n p -
              kb n t) (3 a n^2 p - (-b n p -
                kb n t)^2)^2)/(2 \[Sqrt]((18 a b n^3 p^2 +
                2 b^3 n^3 p^3 - 9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
                6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
              4 (3 a n^2 p - (-b n p - kb n t)^2)^3))))/(18 2^(1/3)
       p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 - 9 a kb n^3 p t +
        6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(2/3)) + (2^(
      1/3) (1 - I Sqrt[3]) kb n (-b n p -
        kb n t))/(3 p (18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
        9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t + 6 b kb^2 n^3 p t^2 +
        2 kb^3 n^3 t^3 + \[Sqrt]((18 a b n^3 p^2 + 2 b^3 n^3 p^3 -
             9 a kb n^3 p t + 6 b^2 kb n^3 p^2 t +
             6 b kb^2 n^3 p t^2 + 2 kb^3 n^3 t^3)^2 +
           4 (3 a n^2 p - (-b n p - kb n t)^2)^3))^(1/3))}

You might choose a nicer or more specific form using the following (if you  
have ranges for the constants):

Reduce[p == n*kb*t/(v - n*b) - a*n^2/v^2, v]

(p == 0 && n == 0 &&
    t v != 0) || (p !=
     0 && (v ==
       Root[-a b n^3 + a n^2 #1 + (-b n p - kb n t) #1^2 + p #1^3 &,
        1] || v ==
       Root[-a b n^3 + a n^2 #1 + (-b n p - kb n t) #1^2 + p #1^3 &,
        2] || v ==
       Root[-a b n^3 + a n^2 #1 + (-b n p - kb n t) #1^2 + p #1^3 &,
        3]) && b n v - v^2 != 0) || (p == 0 &&
    kb n t !=
     0 && (v == (a n - Sqrt[a] n Sqrt[a - 4 b kb t])/(2 kb t) ||
      v == (a n + Sqrt[a] n Sqrt[a - 4 b kb t])/(2 kb t)) &&
    a b n - a v + b kb t v != 0) || (t == 0 && p == 0 && n == 0 &&
    v != 0) || (p == 0 && n t != 0 && kb == 0 && a == 0 &&
    b n v - v^2 != 0) || (t == 0 && p == 0 && n != 0 && a == 0 &&
    b n v - v^2 != 0)

Bobby

On Thu, 24 Mar 2011 06:31:55 -0500, thinktank1985 <dibya at umich.edu> wrote:

> Say I have
>
> p=N*kb*T/(V-N*b)-a*N^2/V^2
>
> I want to evaluate the derivative of V with respect to T, keeping  
> p,N,kb,b,a constant.
>
> I understand that this can be done by hand. I just want to know whether  
> this can be done by using mathematica. I couldnt understand how to use  
> Solve to do this. maybe there is something else I am not aware of
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Why Mathematica does not issue a warning when the calculations
  • Next by Date: Re: Why Mathematica does not issue a warning when the calculations
  • Previous by thread: Re: how do I solve for this
  • Next by thread: ConvexHull returns cflist error