Azzera filtri
Azzera filtri

How to troubleshoot solver when wrong variable is showing up?

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Suzie Oman
Suzie Oman il 11 Set 2017
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 il 12 Set 2017
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)

Accedi per commentare.

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by