matlab中solve函數的用法。懸賞20分

博主:adminadmin 2023-01-03 22:36:01 條評論
摘要:solveSymbolicsolutionofalgebraicequations.solve('eqn1','eqn2',...,'eqnN')solve('eqn1','eqn2',...,'eqnN','var1,var2,....
鋼百科 usteel.net

  solveSymbolicsolutionofalgebraicequations.

matlab中solve函數的用法。懸賞20分

  solve('eqn1','eqn2',...,'eqnN')

  solve('eqn1','eqn2',...,'eqnN','var1,var2,...,varN')

  solve('eqn1','eqn2',...,'eqnN','var1','var2',...'varN')

  Theeqnsaresymbolicexpressionsorstringsspecifyingequations.The

  varsaresymbolicvariablesorstringsspecifyingtheunknownvariables.

  solveseekszerosoftheexpressionsorsolutionsoftheequations.

  Ifnotspecified,theunknownsinthesystemaredeterminedbySYMVAR.

  Ifnoanalyticalsolutionisfoundandthenumberofequationsequals

  thenumberofdependentvariables,anumericsolutionisattempted.

  Threedifferenttypesofoutputarepossible.Foroneequationandone

  output,theresultingsolutionisreturned,withmultiplesolutionsto

  anonlinearequationinasymbolicvector.Forseveralequationsand

  anequalnumberofoutputs,theresultsaresortedinlexicographic

  orderandassignedtotheoutputs.Forseveralequationsandasingle

  output,astructurecontainingthesolutionsisreturned.

  solve(...,'IgnoreAnalyticConstraints',VAL)controlsthelevelof

  mathematicalrigortouseontheanalyticalconstraintsofthesolution

  (branchcuts,divisionbyzero,etc).TheoptionsforVALareTRUEor

  FALSE.SpecifyFALSEtousethehighestlevelofmathematicalrigor

  infindinganysolutions.ThedefaultisFALSE.

  solve(...,'PrincipalValue',VAL)controlswhethersolveshouldreturn

  multiplesolutions,includingparameterizedinfinitesolutionsets

  (ifVALisFALSE),orjustasinglesolution(whenVALisTRUE).

  ThedefaultisFALSE.

  solve(...,'IgnoreProperties',VAL)controlsifsolveshouldtake

  assumptionsonvariablesintoaccount.VALcanbeTRUEorFALSE.

  ThedefaultisFALSE(i.e.,takeassumptionsintoaccount).

  solve(...,'Real',VAL)allowstoputthesolverinto"realmode."

  In"realmode,"onlyrealsolutionssuchthatallintermediatevalues

  oftheinputexpressionarerealaresearched.VALcanbeTRUE

  orFALSE.ThedefaultisFALSE.

  solve(...,'MaxDegree',n)controlsthemaximumdegreeofpolynomials

  forwhichexplicitformulaswillbeusedduringthecomputation.

  nmustbeapositiveintegersmallerthan5.Thedefaultis3.

  Examples:

  solve('psin(x)r')chooses'x'astheunknownandreturns

  ans

  asin(r/p)

  pi-asin(r/p)

  [x,y]solve('x^2+xy+y3','x^2-4x+30')returns

  x

  1

  3

  y

  1

  -3/2

  Ssolve('x^2y^2-2x-10','x^2-y^2-10')returns

  thesolutionsinastructure.

  S

  x:[8x1sym]

  y:[8x1sym]

  [u,v]solve('au^2+v^20','u-v1')regards'a'asa

  parameterandsolvesthetwoequationsforuandv.

  Ssolve('au^2+v^2','u-v1','a,u')regards'v'asa

  parameter,solvesthetwoequations,andreturnsS.aandS.u.

  [a,u,v]solve('au^2+v^2','u-v1','a^2-5a+6')solves

  thethreeequationsfora,uandv.

  Ssolve('x^(5/2)8^(10/3)')returnsallthreecomplexsolutions:

  S

  16

  -45^(1/2)-4+42^(1/2)(5-5^(1/2))^(1/2)i

  -45^(1/2)-4-42^(1/2)(5-5^(1/2))^(1/2)i

  Ssolve('x^(5/2)8^(10/3)','PrincipalValue',true)selectsoneofthese:

  S

  -45^(1/2)-4+42^(1/2)(5-5^(1/2))^(1/2)i

  Ssolve('x^(5/2)8^(10/3)','IgnoreAnalyticConstraints',true)

  ignoresbranchcutsduringinternalsimplificationsand,inthiscase,

  alsoreturnsonlyonesolution:

  S

  16

  symstpositive

  solve(t^2-1)

  ans

  1

  solve(t^2-1,'IgnoreProperties',true)

  ans

  1

  -1

  solve(x^3-1)returnsallthreecomplexroots:

  ans

  1

  -1/2+(3^(1/2)i)/2

  -1/2-(3^(1/2)i)/2

  solve(x^3-1,'Real',true)onlyreturnstherealroot:

  ans

  1

  這是具體的用法,注意變量的選取。。。

  蘇州東锜公司始終堅持質量求生存、用戶至上的信念和“追求卓越、打造精品”的經營理念,誠信、實力和產品質量獲得業界的認可。以優質的產品、合理的價格,竭誠為廣大客戶提供優良的服務并和大家取得更好的經濟效益,歡迎各界朋友蒞臨參觀、指導和業務洽談,我們將竭誠為你服務,共創美好的未來。

鋼百科 usteel.net