new to mupad help

조회 수: 1 (최근 30일)
Andy
Andy 2015년 6월 10일
댓글: Andy 2015년 6월 17일
I thought I would try to learn mupad by solving a slightly confounded quadratic equation, which results after an equation substitution. My problem is, the answer mupad is giving me includes the variable that should have been eliminated. Could you look at the attached file and show to how to give the desired solution; it is probably simple for an experienced mupad user? I hard coded the desired equation at the bottom of the file; it does not include the eliminated variable. Thanks.
  댓글 수: 4
Andy
Andy 2015년 6월 14일
Sorry for not including the problem file; it must have been too late at night. Anyway, here it is now. Also, in case it is not clear, the variable that needs to be eliminated is Pavg. I looked at it again this morning, and I still can't figure out how to control mupad to give what should be a simple answer. Thanks.
Walter Roberson
Walter Roberson 2015년 6월 14일
Sorry, I can't read MuPad Notebooks. Screen capture please (and text form of the formula would be good)

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

답변 (1개)

Martin Brown
Martin Brown 2015년 6월 17일
Hi, I think there are a couple of problems with the attached notebook
1) When I executed the individual commands (notebook - evaluate all), the Pavg in the final solution disappears, so it looks like you've got some previous working in the attached notebook. Just re-evaluate the commands
2) solve isn't giving a very helpful output. For some reason, it thinks your "eqn" variable is actually a relation, not an equation.
testtype(eqn, Type::Equation)
When you specify the equation as part of the solve command like
simplify(solve(-353/10*`Delta;P`*(`Delta;P`/2-P1)/Tavg = c, `Delta;P`));
You get roughly the answer you want. Putting decimals in gives the result in floating point format.
  댓글 수: 1
Andy
Andy 2015년 6월 17일
Thanks a 1e+6. My first observation is, mupad behavior is not consistent. Sometims it acts like a Relation, but sometimes 'isolate" actually solves as expected it would with an Equation. I'll have to learn the mupad difference between and Equation and Relation, and how to control which is which. And, I just learned of the 'testtype' function.

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

카테고리

Help CenterFile Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by