Message Boards Message Boards

Error in numerically solving a system of equations

Posted 2 years ago

Hello, I am having difficulties solving a system of equations with the NSolve Function in Mathematica. I have four sets of equations and attempted to combine several into one equation to enhance the ability to solve the problem, but it did not work. Here are much simplified versions of the equations I used as well as the formatting I used for NSolve. Is there a limit to the amount of equations I can use? Is there a better command I can use to solve this problem I want the value of x:

Simplified Equations
eq.1) 1=(1/n)(g/4)exp(g/4)
eq.2) n=(4/3)pir^2
eq.3) r=2x^3
eq.4) g=3/4x^3
For simplification, we can assume "eq.y" is a fully written out version of one of the above equations and all equalities have a "==" rather than just "="
Formatting*

NSolve[{eq.1,eq.2,eq.3,eq.4},x]
POSTED BY: Avery Ansbro
4 Replies

The question, as written, has no code that can be copy-pasted for others to try out. Writing the equations is not an issue of legibility, it's a matter of providing them in a format others can use without having to type them in from scratch.

Also, it looks similar to a post in Mathematica StackExchange. If that is indeed the case, please add cross-post links to both so readers in one forum will know to check the other for responses before they put work into this.

POSTED BY: Daniel Lichtblau

You will need to format these correctly as Mathematica input. Also note that symbol names cannot have a dot in them, so you cannot use e.g. eq.1 as a symbol. In any case, it is the job of the poster to post full code.

POSTED BY: Daniel Lichtblau
Posted 2 years ago

The "eg.1" in the quoted piece was purely so I didn't have to re-write out the equations/to make my question more legible. In Mathematica, what I placed there in my input are just the equations, not the "eq.y" notation.

Which aspect of the formatting is off, the notation style for NSolve or the equations themselves?

POSTED BY: Avery Ansbro
Posted 2 years ago

Avery,

Please learn how to format code in posts, read the post editor and code formatting sections here.

There are several syntax errors in the equations e.g. Exp[g/4], not exp(g/4), Pi, not pi, ..., read this.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract