How to solve 3 equation 2 variable system?

I'm trying to solve these equations:
((((4330-4158)*0.000173-0)*x)+(((4330-4158)*0.000173-0)^(2)*y))28316.85=4.09945
((((4340-4158)*0.000173-0)*x)+(((4340-4158)*0.000173-0)^(2)*y))28316.85=4.1565
((((4513-4158)*0.000173-0)*x)+(((4513-4158)*0.000173-0)^(2)*y))28316.85=7.6936
But when I go with
[x y]=solve('((((4330-4158)*0.000173-0)*x)+(((4330-4158)*0.000173-0)^(2)*y))28316.85=4.09945', '((((4340-4158)*0.000173-0)*x)+(((4340-4158)*0.000173-0)^(2)*y))28316.85=4.1565', '((((4513-4158)*0.000173-0)*x)+(((4513-4158)*0.000173-0)^(2)*y))28316.85=7.6936')
I get and error message about my solve argumentL --> Check for missing argument or incorrect argument data type in call to function 'solve'.

 Accepted Answer

b = [4.09945; 4.1565; 7.6936]./28316.85;
A = [((4330-4158)*0.000173-0) ((4330-4158)*0.000173-0)^2;
((4340-4158)*0.000173-0) ((4340-4158)*0.000173-0)^2;
((4513-4158)*0.000173-0) ((4513-4158)*0.000173-0)^2];
c = A\b % x=c(1), y=c(2)
c = 2×1
0.0051 -0.0110
btw, your expressions are missing a "*" before the 28316.85.

4 Comments

I was missing the * and typed it in and it still didn't work by that linear method.
So I calculated with the matrix, but when replacing the values, I'm still not getting the correct answer on my equations.
Again, I used this formula first then the matrix you suggested
[x y]=solve('((((4330-4158)*0.000173-0)*x)+(((4330-4158)*0.000173-0)^(2)*y))*28316.85=4.09945', '((((4340-4158)*0.000173-0)*x)+(((4340-4158)*0.000173-0)^(2)*y))*28316.85=4.1565', '((((4513-4158)*0.000173-0)*x)+(((4513-4158)*0.000173-0)^(2)*y))*28316.85=7.6936')
BTW I'm new to MatLab. Bare with me.
In 20b, which you indicate you are using, the recommended way of setting up solve is like this:
syms x y
eq1 = (((4330-4158)*0.000173-0)*x + ((4330-4158)*0.000173-0)^2*y)*28316.85 == 4.09945;
eq2 = (((4340-4158)*0.000173-0)*x + ((4340-4158)*0.000173-0)^2*y)*28316.85 == 4.1565;
eq3 = (((4513-4158)*0.000173-0)*x + ((4513-4158)*0.000173-0)^2*y)*28316.85 == 7.6936;
[X Y]=solve([eq1, eq2, eq3],[x y])
X = Empty sym: 0-by-1 Y = Empty sym: 0-by-1
However, as you can see, it is unable to find a solution. I did try vpasolve as well but got the same result. You may need someone who is better at using solve than me. However, my original reply does show how to get a solution using linear algebra. This is equivalent to using linsolve.
Ok, I see.
I need to investigate how to plot eq then to analyze the data and get the correct solution. I just did a 20 minute video about overdetermined systems and I believe this one is inconsistent. If I plot the eq, I can then narrow my search for values.
Thanks!
I am so sorry! I misintepreted a value. Turns out the first answer you gave was the corret one.

Sign in to comment.

More Answers (0)

Products

Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!