WassimTenachi/PhySO

n3 expression

shan-zhong opened this issue · 4 comments

can I just add 'n3' into op_names, it looks like the formula is limited at n2 order. It can't give a result as y=x^3.

Hi @shan-zhong,

That is weird, n3 is implemented so yes you can just add n3 in the list of operators like so:

expression, logs = physo.SR(
	...
	op_names = ["mul", "add", "sub", "div", "inv", "n2",  "n3", "sqrt", "neg", "exp", "log", "sin", "cos"]
	...
)

Does this resolve your problem ?

Cheers.
Wassim

PS: Usually physo finds orders 3-4 by itself by multiplying lower orders $x.x^2 = x^3$

Thanks Wassim, it may just need a long fitting time, so physo itself could try $x \cdot x^2$.
And I don't well understand the role of fixed constant value. If I want a result as $x(1-x)$, do I need to set a fixed constant value of 1? My wanted equation is $k \frac{\phi^3}{s^2 \cdot (1-\phi)^2 \cdot \tau^2}$, in which $k$ is free constant value that is unknown.

Yes, in your case I would recommend using a fixed constant of value equal to 1 and a free parameter k !
In all cases I think it is usually good to allow for a fixed constants of 1, it is extremely useful in many situations !

I'm gonna a close this issue now but feel free to re-open it if you need further assistance !