symbolic math - Using MATLAB's solve function to find solution to system of equations -
i having trouble solving system of equations. have 3 equations known solution , 3 unknowns in each equation. however, when use solve function in matlab, returns error have 6 equations , 3 variables.
a snippet of code:
syms v0 t0 x0 a=(g*x0/(2*v0^2*cos(t0)^2)-tan(t0))==a; b=(tan(t0)-g*x0/(v0^2*cos(t0)^2))==b; c=(-g/(2*v0^2*cos(t0)^2))==c; soln=solve([a,b,c],[v0,t0,x0]); i have calculated scalar values a, b, , c. g constant. not sure why returning have 6 equations.
v0^2 means quadratic equation. solve v0^2 variable. set v0^2 = j0 , solve j0 instead.
soln=solve([a,b,c],[j0,t0,x0]); then 3 linear equations 3 variables.
once value of j0, need solve v0^2 = j0.
Comments
Post a Comment