[metapost] solving equatiosn with metapost

Yogeshwarsing Calleecharan yogeshwarsing.calleecharan at ltu.se
Wed Mar 20 09:23:56 CET 2013


Ok thanks for the information.

Best Regards,
YC

On 3/20/2013 8:11 AM, Aditya Mahajan wrote:
> On Wed, 20 Mar 2013, Yogeshwarsing Calleecharan wrote:
>
>> 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?
>
> MP can only solve *linear* equations.
>
> 8a = 3b;
> a=-3;
> show a,b;
> end;
>
>> (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)?
>
> end;
>
> Adiya
> -- 
> http://tug.org/metapost/





More information about the metapost mailing list