Results 1 to 7 of 7

Math Help - Solve system in Mathematica in terms of parameters

  1. #1
    Junior Member
    Joined
    Apr 2010
    Posts
    39

    Solve system in Mathematica in terms of parameters

    Hello all,

    I am new to mathematica... I have a system of several equations (with as many endogenous variables) and several other parameters. I want to solve this system for each endogenous variable in terms of these parameters. Where do I even start doing this? Whenever I hit solve it just rewrites the same equation and will only do something if I assign numerical values to these parameters. Any help, no matter how little, would be greatly appreciated,

    Nick
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Can you please post the equations you're trying to solve?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Apr 2010
    Posts
    39
    Hi Adrian,

    Thanks for your response. Unfortunately, the thing I am working with is a complete mess (12 equations, all of which are horrendously ugly... which is why I am hoping mathematica can give me an analytical solution... but as I said I don't know much about it). But as a simple example, lets just say its supply and demand where Q=a+bP and Q=c-dP and I want to solve for P and Q in terms of a,b,c,d.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Then your command would be as follows:

    Solve[{Q==a+b P,Q==c-d P},{P,Q}]

    The result I get is as follows:

    \left\{\left\{P\to-\dfrac{a-c}{b+d},Q\to-\dfrac{-b c-a d}{b+d}\right\}\right\}.

    A few important comments: Mathematica understands implied multiplication. However, if you have two letters right next to each other, with no space, it'll likely interpret that as one variable. That is, AB = the variable with name "AB", but A B equals the variable A times the variable B.

    Second, make absolutely sure that you use the double-equals symbol, NOT the single equals symbol: "=". The latter is an assignment operation, and not appropriate for this setting.

    Thirdly, don't use reserved variable names like N, D, and so on. Simple way to avoid that: use multiple letters for a variable name (see note above).

    Finally, Mathematica is pretty good at solving systems of equations of the size you're talking about. However, if the system is nonlinear in any of the variables for which you wish to solve, Mathematica might or might not be able to solve. If it's linear, Mathematica can usually handle it just fine.

    Make sense?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Apr 2010
    Posts
    39
    very helpful, thank you Adrian.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Junior Member
    Joined
    Apr 2010
    Posts
    39
    One more question if thats okay... how might I define my equations as some name to make this simpler..... That is, let A be Q=a+bP and B be Q=c-dP then I can just write solve Solve[{A, B},{P,Q}]. I think that might make it all a bit more manageable no? Thanks again,

    Nick
    Follow Math Help Forum on Facebook and Google+

  7. #7
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    Interesting idea. I've never thought of doing that before. But I just tried the following and it worked:

    A=(x==7 y+3)
    Solve[A,y]

    Result:

    \left\{\left\{y\to\dfrac{1}{7}(-3+x)\right\}\right\}.

    Note the careful use of single and double equals signs.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 9
    Last Post: April 4th 2011, 11:20 AM
  2. Not solvable system of linear equations in Mathematica
    Posted in the Math Software Forum
    Replies: 8
    Last Post: November 5th 2010, 10:22 AM
  3. Mathematica - ODE system solving problem
    Posted in the Math Software Forum
    Replies: 8
    Last Post: November 29th 2009, 01:07 PM
  4. Replies: 4
    Last Post: November 25th 2009, 03:57 AM
  5. Finding parameters in a ODE system
    Posted in the Differential Equations Forum
    Replies: 4
    Last Post: June 25th 2009, 04:02 AM

Search Tags


/mathhelpforum @mathhelpforum