1. You have a variable x and a function x. Are they related?
2. I think that you should use assignment, not function definition.
Then you could write:
t: acos(n1*2/(%pi*F));
xx:%pi*F/(2*n2); /* ? you have a variable x and a function x? I renamed
function x as xx */
bb: x/cos(t);
y: sqrt(b^2-x^2) ; /* or ?? */
....
1/xx^2+1/y.. =4.
solve(%,n2);
3. Solve does not consider any information given with assume.
I hope this helps.
_____
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Ken Johnson
Sent: Friday, August 29, 2008 2:17 PM
To: maxima at math.utexas.edu
Subject: Simple system of equations
I have a trivial system of nonlinear equations, which I can solve by hand,
but am curious how to manipulate maxima to do the work for me in a more
comprehensive manner. Namely the system has two degrees of freedom, and in
the typical case this is n1 and F. I can encode each equation as a function
of that variable, and then encode the final equation and solve as follows
t(n1,F):=acos(n1*2/(%pi*F));
b(x, t) := x / cos(t);
x(n2,F) := %pi * F / (2 * n2);
y(b, x) := sqrt(b^2 - x^2);
1 / x(n2,F)^2 + 1/y(b(x(n2,F),t(n1,F)), x(n2,F))^2 = 4;
solve(%, n2);
%[2];
grind(%);
The result is
n2 = sqrt(%pi^2*F^2-4*n1^2)
I am satisfied with the answer but I had to do a lot of things manually, for
instance create each relation as a function. Also it takes a while to do the
fifth equation rather than just stating x^-2 + y^-2 = 4. The solution can
take two forms, one negative and one positive, however the positive solution
is the only one possible and is isolated above with %[2]. If I add more
information about the system before the solve command, the results are the
same and the same manipulation of the output is necessary to isolate the
only possible solution.
assume(F*%pi >= 2*n1);
assume(n1 >= 0);
assume(n2 >= 0);
I've combed through tutorials and the manual and could not find an example
of this trivial type of problem or system setup. Basically, I expect to set
the assume commands and each of the relations without having to resort to
functions, and only the valid solution is presented. Is this asking too much
of a computer algebra system?
BTW I was curious and tried it in Math***tica with even less luck, though it
might be unfair since I've used it less too.
Thanks