How to troubleshoot solver when wrong variable is showing up?

조회 수: 1 (최근 30일)
Suzie Oman
Suzie Oman 2017년 9월 11일
댓글: Rik 2017년 9월 12일
When using solver, I am getting a variable that is not in my equation in the solution. What should I troubleshoot?
I am solving an 5 degree polynomial with t as the only variable, and instead of one answer (there should only be one), there are five answers that include a 'z' (yes,'z', that's not a typo).
  댓글 수: 3
Suzie Oman
Suzie Oman 2017년 9월 11일
I am using the solve command. Below are the equations where x,y and Q are functions of t.
Q = (1543*t)/100 - 3993/1000; x = (27*t)/8 - 4503607640442835/5070602400912917605986812821504; y = (3641*t)/250 - 42321/1000;
rhs = p00 + p10*x + p01*y + p20*x.^2 + p11*x.*y + p02*y.^2 + p30*x.^3 + p21*(x.^2).*y + p12*x.*y.^2 + p03*y.^3 + p40*x.^4 + p31*(x.^3).*y + p22*(x.^2).*y.^2 + p13*x.*y.^3 + p04*y.^4 + p50*x.^5 + p41*(x.^4).*y + p32*(x.^3).*y.^2 + p23*(x.^2).*y.^3 + p14*x.*y.^4 + p05*y.^5;
tsoln = solve(lhs == rhs,t)
Rik
Rik 2017년 9월 12일
Are all those p values supposed to be syms as well? What code are you using to define your variables? A good strategy is to try to condens your problem to the smallest piece of code that reproduces the problem: a MWE (or MFE, minimal failing example). Then we can run your code and try to fix it that way (and see if we can reproduce it on our OS release combination).
(note that Q is unused and you haven't defined lhs in your comment above)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by