extra variables
2 ビュー (過去 30 日間)
古いコメントを表示
I have an equation I am working with where I am altering the equation to solve for certain variables within the equation. I have used the syms function in the past and have never had a problem with it until today. I set up my equation and then ask it to solve for a certain variable. When it spits out the new equation Matlab has added two new variables to the mix. I've tried it 4 or 5 different ways and it continues to do the same thing. Does anyone know what is going on or why that is happening?
回答 (2 件)
Walter Roberson
2011 年 7 月 12 日
i or I represent the square root of negative 1. "i" is used at the MATLAB level, and "I" is used in symbolic forms.
2 件のコメント
Walter Roberson
2011 年 7 月 13 日
Was it in the context of a RootOf() ? RootOf() introduces a dummy variable.
Kai Gehrs
2011 年 7 月 13 日
Hi Jason,
two things come to my mind which could be helpful.
First: defining P0 and afterwards using it in a character string, will not trigger any evaluation. A simple example is a = 2 and then using the input 'x^2 = a' as an equation for 'solve'. The value for 'a' will not be plugged into the equation. You would need to use something like ['x^2 = ' char(a)] to build the equation. The char command should trigger the evaluation.
Second: the solver uses new variables to parameterize solutions. E.g. something like k*pi as the solution of 'sin(x) = 0'. In the current version of the Symbolic Math Toolbox you will get a warning that the solutions are parameterized and it tells you something about which sets are used for that (e.g. the integers, the reals, certain intervals etc.).
As a workaround, you could try to use the 'evalin(symengine,cmd)' command, where cmd is a character string with a MuPAD command:
evalin(symengine,'solve(P0=(((1-g)/2)*(-cd*.6847*a*(((r*T)^.5)/V)*P1^k*t)+P1^k)^((2*g)/(1-g)),T)')
Hope this helps a bit,
-- Kai
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!