×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

solving nonlinear equations system

solving nonlinear equations system

solving nonlinear equations system

(OP)
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!

RE: solving nonlinear equations system

try this

>syms x y
>
>eq1=['(x-' num2str(Xg) ')^2+(y-' num2str(Yg) ')^2=102.9^2']
>eq2=['((x-' num2str(Xd(i)) ')^2+(y-' num2str(Yd(i)) ')^2)^(1/2)=rod']
>
>
>S=solve(eq1,eq2)

M

RE: solving nonlinear equations system

(OP)
Thanks a lot MikeyP!

Do you know a good ressource (biiks, websites...) to get better in Matlab??

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources