[metapost] solving equatiosn with metapost

Daniel H. Luecking luecking at uark.edu
Wed Mar 20 19:15:35 CET 2013


 On Mar. 20, 2013, Yogeshwarsing Calleecharan [yogeshwarsing.calleecharan at ltu.se]
wrote:

>I am interested in Metapost's ability to solve equations.
>Consider this code "second.mp":
>
>a/b=(a+3)/(b+8);
>a=-3;
>show a,b;

You have already found out what is wrong, but I would 
like to point out that these equations have no solution.
The first one becomes
  -3/b = 0  
after putting in a=-3. And then 0=-3 after multiplication by b.

Dan

--  

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, Arkansas

________________________________________
From: metapost [metapost-bounces at tug.org] on behalf of Yogeshwarsing Calleecharan [yogeshwarsing.calleecharan at ltu.se]
Sent: Wednesday, March 20, 2013 2:55 AM
To: MetaPost List
Subject: [metapost] solving equatiosn with metapost

Hello,
           I am interested in Metapost's ability to solve equations.
Consider this code "second.mp":

a/b=(a+3)/(b+8);
a=-3;
show a,b;

When I run the code, however I get mistake(s):

mpost second.mp
This is MetaPost, version 1.504 (kpathsea version 6.0.1)
(mpost.mp (c:/texlive/2011/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.004)) (./second.mp
 >> a
 >> b
! Not implemented: (unknown numeric)/(unknown numeric).
<to be read again>
                    =
l.1 a/b=
         (a+3)/(b+8);
?


I would be grateful if someone would let me know:

(a) what I am doing wrong with this code?
(b) Say if the code is fixed and run well, what Metapost command to put
after show a,b; so that Metapost exits normally because it seems that I
get a * if the code runs well and then Metapost is still awaiting for
some other command(s)?



Thanks a lot...

Best Regards,
Y.Calleecharan

--
http://tug.org/metapost/



More information about the metapost mailing list