mountainman
Mechanical
- Jan 5, 2003
- 4
I've been trying the following code to find the solutions of a two-equation system.
>syms x y
>
>eq1='(x-Xg)^2+(y-Yg)^2=102.9^2'
>eq2='((x-Xd(i))^2+(y-Yd(i))^2)^(1/2)=rod'
>
>
>S=solve(eq1,eq2)
Where Xg and Yg are declared variables and Xd and Yd are vectors. I want to use the solve in a loop so I need to be able to change the Xd and Yd values, hence the use of vectors and (i). The problem is that when I test the code with constant values instead of variables it works like a charm, and when I use it like you see it doesn't use the declared variables' values.
Is it possible to use this code or I'm using the wrong method??
Thanks for the answers!
>syms x y
>
>eq1='(x-Xg)^2+(y-Yg)^2=102.9^2'
>eq2='((x-Xd(i))^2+(y-Yd(i))^2)^(1/2)=rod'
>
>
>S=solve(eq1,eq2)
Where Xg and Yg are declared variables and Xd and Yd are vectors. I want to use the solve in a loop so I need to be able to change the Xd and Yd values, hence the use of vectors and (i). The problem is that when I test the code with constant values instead of variables it works like a charm, and when I use it like you see it doesn't use the declared variables' values.
Is it possible to use this code or I'm using the wrong method??
Thanks for the answers!