Page 1 of 1

impose a long constraint in nonlin

Posted: Mon Oct 23, 2017 12:59 am
by Catife
Dear Tom,

I just have a question about how to impose a long constraint in nonlin. For example, I want to impose the following constraint after declaring parameters

Code: Select all

nonlin(parmset=test) a b c d e f g (a^b^c^d^e^f^g+c+f*g $     * suppose this row has no more space
                       - c^100)/c^5==(a^b^c^d^e^f^g+c+f*g)    
I will get an error:

Code: Select all

## SX20. Expected )
    >>>>+c+f*g <<<<
I guess the problem is from the incomplete bracket and I can not shorten the constraint. Could you please let me know how to deal with this situation? Thank you very much.

Regards

Re: impose a long constraint in nonlin

Posted: Mon Oct 23, 2017 7:36 am
by TomDoan
Parmset fields are separated by spaces, so once you have that space, it's assumed to be done. Can't you just rearrange it to

nonlin(parmset=test) a b c d e f g $
(a^b^c^d^e^f^g+c+f*g-c^100)/c^5==(a^b^c^d^e^f^g+c+f*g)

putting the $ between fields rather than in the middle.

Re: impose a long constraint in nonlin

Posted: Mon Oct 23, 2017 1:28 pm
by Catife
Thank you for the reply. The actual constraint is longer than the example so that I could not fix that by rearranging it. I think I will try to simplify the constraint. Thank you very much.

Re: impose a long constraint in nonlin

Posted: Mon Oct 23, 2017 1:41 pm
by TomDoan
You can go up to 256 characters on a line. However, I would be really concerned about getting a constraint that's that long input properly. You can simplify your sample to something like

nonlin(parmset=test) a b c d e f g powers=a^b^c^d^e^f^g $
(powers+c+f*g-c^100)/c^5==(powers+c+f*g)