I have the code below that I am trying to solve with rSymPy. All of the variables in the equation are defined below, except for y -- which I am solving for.
How can I substitute the values for Q, n, m, g, k, and Sf simultaneously in the equation defined below and obtain the value of y?
Q <- 1.2
n <- 0.045
m <- 3.4
g <- 9.806
k <- 1
Sf <- 0.2
library(rSymPy)
sympy("solve( [ Eq(n*Q*(2*y*sqrt(1+m**2))**(2/3) - k*(m*y**2)**
(5/3)*sqrt(Sf), 0)], [y] )")
This is the error that I received from the function call:
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl, :
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'n' is not defined
sympyto also create the variables? - user3710546