Items tagged with fsolve

Feed

I want write loop for this code:

V := 24;

eq := {Eq2, Eq3};

ans := fsolve(eq, {a1 = 0, a3 = 0});

r := 0;

W1 := rhs(ans[1])*phi11(r)+rhs(ans[2])*phi21(r)

V and W1 is Variable, I change V and solve eq and determinen a1 and a3 after i calculated W1

I want write Loop for this,

can you help me????????/ 

Hi, I'm trying to solve without success numerically the following system of 15 nonlinear equations. Could anyone help, please? Thanks
 

restart

n := 0.27231149e-1:

x := 0.5116034663e-1:

F := .1561816797:

eq1 := sigma*C0 = pgamma*W*H1*(1-E0-L0)/(1+n):

eq2 := sigma*C1 = W*H1*(1-L1):

eq3 := (1+R)*C0 = (1+rho)*exp(x)*C1:

eq4 := (1+R)*C1 = (1+rho)*exp(x)*C2:

eq5 := C1 = (1+phi)*C0:

eq6 := pgamma*L0+pgamma*(1+(1+n)*F/(pgamma*W*H1))*E0+L1 = (1+R)*(1+(1+n)*F/(pgamma*W*H1))/(ppsi*exp(x))-pgamma*(1+(1+n)*F/(pgamma*W*H1))/ppsi:

eq7 := 1 = pgamma*(1+ppsi*E0)/(1+n):

eq8 := exp(x)*A1 = pgamma*W*L0*H1/(1+n)+Epsilon1-C0-F*E0:

eq9 := exp(x)*A2 = W*L1*H1+(1+R)*A1-C1-(1+n)*Epsilon1:

eq10 := (1+R)*A2 = C2:

eq11 := Y = H^alpha*K^(1-alpha):

eq12 := alpha*Y = W*H:

eq13 := (1-alpha)*Y = (1+R)*K:

eq14 := K = A1/(1+n)+A2/(1+n)^2:

eq15 := H = (pgamma*L0+L1)*H1/(1+n):

eq := {eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11, eq12, eq13, eq14, eq15}:

vars := {A1, A2, C0, C1, C2, E0, H, H1, K, L0, L1, R, W, Y, Epsilon1}:

NULL

fsolve(eq, vars); 1; assign(%)

fsolve({1 = .6865382886+.1072247031*E0, C1 = 1.475639047*C0, H = .9734907289*(.7052335150*L0+L1)*H1, K = .9734907289*A1+.9476841993*A2, Y = H^.6874443*K^.3125557, (1+R)*A2 = C2, (1+R)*C0 = 1.121850394*C1, (1+R)*C1 = 1.121850394*C2, 1.052491643*A1 = .6865382886*W*L0*H1+Epsilon1-C0-.1561816797*E0, 1.052491643*A2 = W*L1*H1+(1+R)*A1-C1-1.027231149*Epsilon1, 5.171201776*C0 = .6865382886*W*H1*(1-E0-L0), 5.171201776*C1 = W*H1*(1-L1), .3125557*Y = (1+R)*K, .6874443*Y = W*H, .7052335150*L0+.7052335150*(1+.2274915796/(W*H1))*E0+L1 = 6.083468374*(1+R)*(1+.2274915796/(W*H1))-4.515468884-1.027231149/(W*H1)}, {A1, A2, C0, C1, C2, E0, H, H1, K, L0, L1, R, W, Y, Epsilon1})

(1)

``

 

Download DDGE.mw

hi.i am a problem with rule solve or fsolve in maple....please see attached file and say your comments

thanks

equ.mw

As part of a project, I am numerically estimating the roots of many large polynomials. Occasionally, "fsolve" fails with strange errors related to "fsolve/refine2". Searches for these error messages have turned up nothing.

I've inluded the code below that causes the error on Maple 18.02. I apologize for the polynomial in question being so long, it's the shortest example I have. The error it generates is:

    Error, (in fsolve/refine2) invalid input: evalf expects its 2nd argument, n, to be of type posint, but received undefined

Is this a bug? Or am I missing some fsolve option to prevent this? Note that it only happens when the "complex" flag is used.

=========

P := x^14-22702264347017701018473605850972699930097274504938699916055555261201515180511538865331807292689345943133521696082918467714371257277276696385067641909170155322906230250853577229812913946663078548646992393337618113886746876557117483839533553328895358682670189394678910311793504505447628428181885141769168591937690303328913335175451328463754619536253583902806843310134957600949886784187209785783810122275010505534415815566439121541947044486358488039865870455952098827525405324562601732796858645293515431747164008309785658410612354201118685855495413079021176507985235094746401708925593687656572387531020719291601076812080687859808747213536777976702071405128537760507468013438105233313663196919816564525291458692028177366393652501832447863872200682143768513389322886600569382594287138458765510827267842205096062437750804878586024353928794905249283675708441066101095406513448522689302522442783437142289641259057413952301148939774149714785/3195755849586795631956816504521213454239300164039404772924331154185577854140658969534719471406093912112781063157828311505891258148739680804289213024862131311540960306206602785748866445362483281617891374949555209869677857419473553982132073059025609434698683760348542259396937054082293168625919023158753310878489047944378154369352523436731294817697449949932655665007647918855300664365159027040571937825740235967492228453331261542499260943085539271304638576578246276634403350307801994081681247214869084246168101721298760198550961832560608341435638093413744839736250679074198753022491225840288065341597851066663786665723409977381822591654466626645542917017628998630902708076612502066607817250779545511895971357711983287763127653752300554550391349040027472903180009282594974618980021621163037989247901106508257414514187962209356325857887950302223210328647697948055097831009797738621154319922212951316644741457327450027692469090867369598*x^13+19088859498864751331345860430721481446264521641744903691362655800372349704990331481604867685549645823662978708926030541236042951546550966879612333115396628902751820387999904934599090760358886795430484312266737008386396041896213971568537362589851823779617430207078749426022658232278071527361264481524611089324107754031784837527081637219350016169914382322455035364613935875393571579561406195287363628553419822536428710010055920488818415526206620047517917895155637033562338042275152771173240104076821411360366799172066699958543868065037999702280159896040588223787643434915579465270491451613199185385049196526456210057933748521047167538262357063585093474544299142560492581751607753970282443057122762426600024763892341448332834018680513343674283251162037067303651651086278409136799357849452879897251530675098741236156640469815784447341282424004221641529187217962536022784563163918511210513153785881467158114512281634789894107114727680109/1065251949862265210652272168173737818079766721346468257641443718061859284713552989844906490468697970704260354385942770501963752716246560268096404341620710437180320102068867595249622148454161093872630458316518403289892619139824517994044024353008536478232894586782847419798979018027431056208639674386251103626163015981459384789784174478910431605899149983310885221669215972951766888121719675680190645941913411989164076151110420514166420314361846423768212858859415425544801116769267331360560415738289694748722700573766253399516987277520202780478546031137914946578750226358066251007497075280096021780532617022221262221907803325793940863884822208881847639005876332876967569358870834022202605750259848503965323785903994429254375884584100184850130449680009157634393336427531658206326673873721012663082633702169419138171395987403118775285962650100741070109549232649351699277003265912873718106640737650438881580485775816675897489696955789866*x^12-127688837609696458957114129756229560761957972259253280819996356067917173759565012901801561924391178368568146719627801670086606489531437386224078360185442651606983719684283163392876990522586784115059551865746707609765679864632874671595399416688286257053075135779925094175440416074968471245768830366824397599424731191899057489251725430472639828977416853808059394673266682604308077331301860791811476274942568803494246399367164616630866928631772760003749091917886558963952047434319195736393271420111064778587861639539510320744497931007588784407172972776901653630399291814617861650330433072614870207218474263898528043868017109168847074788133295715653324601280999334137328493510780499508083274179117783232296907665583279993325725716354393277745170409349317876378784871325009748734263290375761397883657890413900529632709410443413043575189427898559331856967020187201932742096158736566419271039506140015010172468151681141071869870925420155369/6391511699173591263913633009042426908478600328078809545848662308371155708281317939069438942812187824225562126315656623011782516297479361608578426049724262623081920612413205571497732890724966563235782749899110419739355714838947107964264146118051218869397367520697084518793874108164586337251838046317506621756978095888756308738705046873462589635394899899865311330015295837710601328730318054081143875651480471934984456906662523084998521886171078542609277153156492553268806700615603988163362494429738168492336203442597520397101923665121216682871276186827489679472501358148397506044982451680576130683195702133327573331446819954763645183308933253291085834035257997261805416153225004133215634501559091023791942715423966575526255307504601109100782698080054945806360018565189949237960043242326075978495802213016514829028375924418712651715775900604446420657295395896110195662019595477242308639844425902633289482914654900055384938181734739196*x^11+1941963889284143967630503461641384772639246155223080045213834947146248802376220874585881737054605033501866020180580996666713652795880193379326169002867732637532200447194534846339338413543240801939477478241099683412186213038204202290858666453453417846899586996164402928265510496311234255565224399736489137714957014062613618467711330149177700905620590617841256796029108309659216987574764436490494934048714919670190684046029243176314833939438755957046700890497104507387346236050782952954331963365980088907386124713398155694605596359102946980291494749083679360161061519037964676115079433007443504537411864172301459893087256329861985994656612965817883540871319790509064913361633903111901088284675188114992527367188875256164648035419067179258498467050438971237757123876227876902374176109894916835963212462977715488403210262610643862278435267351697867431486692646214503482828458653994117921039913207766285237066798400775441411774079610837/177541991643710868442045361362289636346627786891078042940240619676976547452258831640817748411449661784043392397657128416993958786041093378016067390270118406196720017011477932541603691409026848978771743052753067214982103189970752999007337392168089413038815764463807903299829836337905176034773279064375183937693835996909897464964029079818405267649858330551814203611535995491961148020286612613365107656985568664860679358518403419027736719060307737294702143143235904257466852794877888560093402623048282458120450095627708899919497879586700463413091005189652491096458371059677708501249512546682670296755436170370210370317967220965656810647470368146974606500979388812827928226478472337033767625043308083994220630983999071542395980764016697475021741613334859605732222737921943034387778978953502110513772283694903189695232664567186462547660441683456845018258205441558616546167210985478953017773456275073146930080962636112649581616159298311*x^10-8863297827898165839415750496524113595646716762121322844115735229732707054220168863570410233048901583522983420448394277638284549018035513758104914498710641607628947697242244219841860993879788358381735454419316105861594264938271360192839234405577377200072500528683390799739067094807744149646139901716484318789624752809347475833611242793680607929117314808486761679788190886930919706651326101755691947512243418216460237241769969836429891299366314558409971924025105037908119564861578530568458046073973392717591352587749276788404403969612641258746844907150027624513801294297807549646148499291417732004938891897241268904655286649579390754923163271693343760744341965406109121853934340673760793157027856466007930099451628400810185712964495614693463085689905135333950374874743558356849483930901197948196695521171654728867080261994068527012182974920030328883744764966738189985551194012023576203112120540148697524837372858043563451876509542849/3195755849586795631956816504521213454239300164039404772924331154185577854140658969534719471406093912112781063157828311505891258148739680804289213024862131311540960306206602785748866445362483281617891374949555209869677857419473553982132073059025609434698683760348542259396937054082293168625919023158753310878489047944378154369352523436731294817697449949932655665007647918855300664365159027040571937825740235967492228453331261542499260943085539271304638576578246276634403350307801994081681247214869084246168101721298760198550961832560608341435638093413744839736250679074198753022491225840288065341597851066663786665723409977381822591654466626645542917017628998630902708076612502066607817250779545511895971357711983287763127653752300554550391349040027472903180009282594974618980021621163037989247901106508257414514187962209356325857887950302223210328647697948055097831009797738621154319922212951316644741457327450027692469090867369598*x^9+2017798632508126214178032687554207106376957218619840832956662086046164665731840663616010195125899727795939076982732552766119787016500832211715921717230052496681979577432852310401087868502196643627732719648105718026988556567683519630485815400374479891004302010335606831102703848328584097945978508243431022893640963113656761657600197417501485533198377194139684052176343994472985299657953300469363286556184526802586584214755307697158247107887873091236237632599123600602905959806309348139033950376959229535155791803352079139955123963320105932227644780215619966766055108655288741020886209290486474711298006297607280189057416424593467478571219372613281308689321078436254551057742499063473864232694061267319983756694814398288262834174390168011042951364931686132193005284966871663010432330119034962795839890899090501481880553750048136836870884603174737258837536327019963547476613035420193242235958864072191310211266838717111661997427211841/12783023398347182527827266018084853816957200656157619091697324616742311416562635878138877885624375648451124252631313246023565032594958723217156852099448525246163841224826411142995465781449933126471565499798220839478711429677894215928528292236102437738794735041394169037587748216329172674503676092635013243513956191777512617477410093746925179270789799799730622660030591675421202657460636108162287751302960943869968913813325046169997043772342157085218554306312985106537613401231207976326724988859476336984672406885195040794203847330242433365742552373654979358945002716296795012089964903361152261366391404266655146662893639909527290366617866506582171668070515994523610832306450008266431269003118182047583885430847933151052510615009202218201565396160109891612720037130379898475920086484652151956991604426033029658056751848837425303431551801208892841314590791792220391324039190954484617279688851805266578965829309800110769876363469478392*x^8+595653463870329564049793978610653077784924147310081049725886229514496074424431896371139535290512513543370421669991943879022295484566837982193741714293063648577558130603631634766521328149129569969823197271545558633437311107596551672056665506079114364599202039865730405948002218769139583348447586421596752286092282439204649127363793862275710130284296695116082940485912870421340555598970364233037216088883415900477944075155274644931796851988347845481689494432787436457416213309975377477034435315885301330073984386960225656990818706334595431458471582550550165189482320607945492496296417100187628303765229872504055798768101834332864953805589825320224343693907336414200688255911370715097612333973794836212429385145521765825313810064172829130430532871221590834385381629229656091998869097712301634818490602700217107948854487937370243140870821241350717775059492175130737668904369695266161667460527553083982270988490551570900042454610585889/12783023398347182527827266018084853816957200656157619091697324616742311416562635878138877885624375648451124252631313246023565032594958723217156852099448525246163841224826411142995465781449933126471565499798220839478711429677894215928528292236102437738794735041394169037587748216329172674503676092635013243513956191777512617477410093746925179270789799799730622660030591675421202657460636108162287751302960943869968913813325046169997043772342157085218554306312985106537613401231207976326724988859476336984672406885195040794203847330242433365742552373654979358945002716296795012089964903361152261366391404266655146662893639909527290366617866506582171668070515994523610832306450008266431269003118182047583885430847933151052510615009202218201565396160109891612720037130379898475920086484652151956991604426033029658056751848837425303431551801208892841314590791792220391324039190954484617279688851805266578965829309800110769876363469478392*x^7-15113570599033390421079877152704282575760402634458053122854896745489277827307511104729555317925906225568214914439058228407909604233709303373800635755523163622556864164238666772567187619354483299953911709839860063588020162857990784248028866643232820765874877631054265552390768506568101602491000432124326227024341745780450739624272135251182271133507810838226637332261885858935760923125210938994349370924860536080811884391229918127119531006177386365479201266087848843332916814370814507988299037716701840225002363896766748196913932600780960329893902502167652386550281812383391521738502785942278676540705757260537410521405647255640494560579216704794939121721257870245415144651904709474211768371408204914862883986252875760943819790296200235921138992713190368600609580449924683146430563973244161071950255162230256773426228399168919888429747422610165410976294531879556935995391906949049683251359274465900646212494068580346654890616742327/25566046796694365055654532036169707633914401312315238183394649233484622833125271756277755771248751296902248505262626492047130065189917446434313704198897050492327682449652822285990931562899866252943130999596441678957422859355788431857056584472204875477589470082788338075175496432658345349007352185270026487027912383555025234954820187493850358541579599599461245320061183350842405314921272216324575502605921887739937827626650092339994087544684314170437108612625970213075226802462415952653449977718952673969344813770390081588407694660484866731485104747309958717890005432593590024179929806722304522732782808533310293325787279819054580733235733013164343336141031989047221664612900016532862538006236364095167770861695866302105021230018404436403130792320219783225440074260759796951840172969304303913983208852066059316113503697674850606863103602417785682629181583584440782648078381908969234559377703610533157931658619600221539752726938956784*x^6-56606911212746288531797425095670805062399424421101677717862600827392887966086570498590673119613746469165156337523381795636321677036991477302420753674709713686811882568078016975400881624969306258459062007649906773777809876859663876646222545569178638387083155806346202130570988684784830435390865363436508319229238598519437586054312503598853928438972636264615238650707643552964679259318243634317570183872115416681752259271751432389553718574295517207917784228757458885377537383478835886996256222286223854172678118278099547239528535908757605400918412542872093301940268914810937904361836991602742563582312675452630601354931494058266771375234065791092815667038632389781434772470040614489288147052306960907419599693648698532033457556243783702691074860973568369668485091260383950009098762596509973546964151952489551510210947116627078116642234793376887344063164400839769932275480710548974537201716359604788112690110055153211687060319915667/25566046796694365055654532036169707633914401312315238183394649233484622833125271756277755771248751296902248505262626492047130065189917446434313704198897050492327682449652822285990931562899866252943130999596441678957422859355788431857056584472204875477589470082788338075175496432658345349007352185270026487027912383555025234954820187493850358541579599599461245320061183350842405314921272216324575502605921887739937827626650092339994087544684314170437108612625970213075226802462415952653449977718952673969344813770390081588407694660484866731485104747309958717890005432593590024179929806722304522732782808533310293325787279819054580733235733013164343336141031989047221664612900016532862538006236364095167770861695866302105021230018404436403130792320219783225440074260759796951840172969304303913983208852066059316113503697674850606863103602417785682629181583584440782648078381908969234559377703610533157931658619600221539752726938956784*x^5+8803574970613871156806085396512138961742521948396413545070976399600915984183390805096731313217646981222548657773275592950616488668094770447693809833164459043946592009996136155728311094386907899766270966922695038949490311577603551489122618956774441280490375954836897874880872800831317477259323488993074897412948399841956182103363590355763668471507912443956969097316815558683861211173548132219642059999985419005273573000030449164050583320511714605312903276113074336198985650814714729654266427222607355408552351971127995723711943667875256201812876969068878200785868067258284670407922968682007482594553643052049155554750878922972932169341172726102387357444748432711229584365031020816215817387958789462262033872746673386146274342628377930132499351532652360977700457249013199924702013517630294342824985973844030539327838892887509452469632329879859377436506301311966132764081878323235415242489663285064434254301628330944024796246782645/25566046796694365055654532036169707633914401312315238183394649233484622833125271756277755771248751296902248505262626492047130065189917446434313704198897050492327682449652822285990931562899866252943130999596441678957422859355788431857056584472204875477589470082788338075175496432658345349007352185270026487027912383555025234954820187493850358541579599599461245320061183350842405314921272216324575502605921887739937827626650092339994087544684314170437108612625970213075226802462415952653449977718952673969344813770390081588407694660484866731485104747309958717890005432593590024179929806722304522732782808533310293325787279819054580733235733013164343336141031989047221664612900016532862538006236364095167770861695866302105021230018404436403130792320219783225440074260759796951840172969304303913983208852066059316113503697674850606863103602417785682629181583584440782648078381908969234559377703610533157931658619600221539752726938956784*x^4-523859084082833471446711755599121052886811016364975130659544060359420880174405546029952820794428450698789941159230333192978458494119123793478183362395347411263910209528686607499619732076210935923583757530528475415340759837176163831540648474842441088111430598419604346899579186230546208967364447721656454914767406049990213818512260948866882128853891871133892169918212832229057031510780243573302325692630372815883421975596513331009467248542883004381175675544983224650496679943101389848155364127861671314139401868335830005933182296640353260635533021407833519995789902759067978323853832610509380765976726389069758315717268633025536104645794437969501284514833324641003339055262908646594490675898481723072173169073269959496697492841280565500876977601579793290422081302241207973528760098915143648721380740535972297119460582597942660098036955825437773842971660604713909242648770501670101799996143752912217696962275386368069113806310933/25566046796694365055654532036169707633914401312315238183394649233484622833125271756277755771248751296902248505262626492047130065189917446434313704198897050492327682449652822285990931562899866252943130999596441678957422859355788431857056584472204875477589470082788338075175496432658345349007352185270026487027912383555025234954820187493850358541579599599461245320061183350842405314921272216324575502605921887739937827626650092339994087544684314170437108612625970213075226802462415952653449977718952673969344813770390081588407694660484866731485104747309958717890005432593590024179929806722304522732782808533310293325787279819054580733235733013164343336141031989047221664612900016532862538006236364095167770861695866302105021230018404436403130792320219783225440074260759796951840172969304303913983208852066059316113503697674850606863103602417785682629181583584440782648078381908969234559377703610533157931658619600221539752726938956784*x^3+2507277613118701025793992364166478343634113591260892474295326766388926595401380659553418488612372800473078429284383414164100295497618696922175584194648519640315288543669474665647481253042089841838880845698663503017597568567494036511285649062160850714939388491186949845790680376696816908809272981412907183537044694180946810281215322367828144494392069154586949731736984686662811664798321227156168742191864566896432033615316362529844704143667580907339601101101040983407725340793380960622046484034595588591168465069176540166697625520589666927661660285415510869031443183270437121086747446353056448389264226941586709914236711688346438937447603056458249768319677721039404318822571940087776493501534291441156924207226385372828419997653921508823109486892013281164698869726954506626852453903751862417478762888542286370388085783793727357089951716036021380037300853575906423073257325966464463919011630179868083502189793561658823882854823/5681343732598747790145451563593268363092089180514497374087699829663249518472282612506167949166389177089388556725028109343806681153314988096514156488643788998295040544367293841331318125088859167320695777688098150879427302079064095968234796549378861217242104462841852905594554762812965633112744930060005886006202751901116718878848930554188968564795466577658054515569151855742756736649171603627683445023538197275541739472588909408887575009929847593430468580583548936238939289436092433922988883937545038659854403060086684797423932146774414829218912166068879715086667873909686672039984401493845449496173957451846731850174951070901017940719051780703187408031340442010493703247311114785080564001385858687815060191487970289356671384448534319200695731626715507383431127613502177100408927326512067536440713078236902070247445266149966801525134133870619040584262574129875729477350751535326496568750600802340701762590804355604786611717097545952*x^2+409625955662068882951029126793688739518090138239218488984796795645801325262353406586076439055165056320023643100727785301142632216544301080743235707086824485890205950529700657617438269917459707919268974737411575302005751244657214481075183329087253965790410699412397427442839741206848483871370551438808586427029387351271518650463772184256590372936207478553171485915519400489218737299828282527927029698794411869349982447984333764576483854239683590209335608900236726346302994114690056427772581682505305971250477006390651418491364024408115184552516886617401858022820021648328348447629622760279509245058592997481694825738991388860444669425663371096552711454623191875274037228193231324209339530305072938805229134963657645497492583194974100090696050921013395443204011245764738501052755929663789410609492539391491688417079601608018345617616844409309669918907009896517735188492371103865855756475811783862809885417127411425999146175/25566046796694365055654532036169707633914401312315238183394649233484622833125271756277755771248751296902248505262626492047130065189917446434313704198897050492327682449652822285990931562899866252943130999596441678957422859355788431857056584472204875477589470082788338075175496432658345349007352185270026487027912383555025234954820187493850358541579599599461245320061183350842405314921272216324575502605921887739937827626650092339994087544684314170437108612625970213075226802462415952653449977718952673969344813770390081588407694660484866731485104747309958717890005432593590024179929806722304522732782808533310293325787279819054580733235733013164343336141031989047221664612900016532862538006236364095167770861695866302105021230018404436403130792320219783225440074260759796951840172969304303913983208852066059316113503697674850606863103602417785682629181583584440782648078381908969234559377703610533157931658619600221539752726938956784*x+19274602981612147290159524985559484093130831751480756525782715054667194973369495232408312165313759674110576759872392612089012272923859625516884268120491350321412487913144106351173483928355210063578761326082759699790669852993610922334255512904908344034497486576749204467479440080193445816812437124815705534871107288254095868559730608571611775333291508638854525168655723328657110979842065373668113720199606612577706540055748716804695554224139209569128003744375141059759616450648545383218233710479963101078863006113802889357950673977857921892481030024186104599766895886493039433820102404772715112824244120718747330555481069366856972350416806635004205386220265273799023113455715583543586661235789661857624566216488236144677299497354093058902257519792639035715396313400079080186425228931237501312897851917238249279942091650204339882709384865082513445071486731865811778705191906577495950612446972346017024882968602859856464/1597877924793397815978408252260606727119650082019702386462165577092788927070329484767359735703046956056390531578914155752945629074369840402144606512431065655770480153103301392874433222681241640808945687474777604934838928709736776991066036529512804717349341880174271129698468527041146584312959511579376655439244523972189077184676261718365647408848724974966327832503823959427650332182579513520285968912870117983746114226665630771249630471542769635652319288289123138317201675153900997040840623607434542123084050860649380099275480916280304170717819046706872419868125339537099376511245612920144032670798925533331893332861704988690911295827233313322771458508814499315451354038306251033303908625389772755947985678855991643881563826876150277275195674520013736451590004641297487309490010810581518994623950553254128707257093981104678162928943975151111605164323848974027548915504898869310577159961106475658322370728663725013846234545433684799:

fsolve(P,complex);

 

Let us define a piecewise-linear continuous function:

restart; VP := Vector[row](16, {(1) = 10, (2) = 177.9780267, (3) = 355.9560534, (4) = 533.9340801, (5) = 711.9121068, (6) = 889.8901335, (7) = 1067.868160, (8) = 1245.846187, (9) = 1423.824214, (10) = 1601.802240, (11) = 1779.780267, (12) = 1957.758294, (13) = 2135.736320, (14) = 2313.714347, (15) = 2491.692374, (16) = 2669.670400}); VE := Vector[row](16, {(1) = 5.444193931, (2) = .4793595141, (3) = .3166653569, (4) = .2522053489, (5) = .2123038784, (6) = .1822258228, (7) = .1544240625, (8) = .1277082078, (9) = .1055351619, (10) = 0.8639065510e-1, (11) = 0.6936612570e-1, (12) = 0.5388339810e-1, (13) = 0.3955702170e-1, (14) = 0.2612014630e-1, (15) = 0.1338216460e-1, (16) = 0.1203297900e-2}); for i to 15 do p[i] := VE[i+1] < x and x <= VE[i], (VP[i+1]-VP[i])*(x-VE[i])/(VE[i+1]-VE[i])+VP[i] end do; g := unapply(piecewise(seq(p[i], i = 1 .. 15)), x);

for i to 15 do print(fsolve(g(x) = VP[i])) end do;

Why doesn't the fsolve command work if i = 4, 7, 9, 11, 14? There are workarounds:

print(DirectSearch:-SolveEqutions(g(x) = VP[i]));

and/or

VP := convert(VP, rational); VE := convert(VE, rational); print(solve(g(x) = VP[i]));

 How to explain such behavior of the fsolve command? That was asked but not answered in http://forum.exponenta.ru/viewtopic.php?t=13524&sid=025a140e7e00b99803c86060a5c0c33c .

NULL

 

strange_behavior.mw

Edit. Replaced worksheet.

I know 1st root of a function locates in a small interval (by drawing plots of function).

but fsolve command uses unreasonable time to find roots.

Also NextZero dosent work.

Please help me.

Thanks for your attention.

--------------------------------------------------------------------------------------------------

restart; s := sqrt(n)*Pi*(sqrt(n)*Pi-tan(sqrt(n)*Pi))/(sqrt(n)*Pi*tan(sqrt(n)*Pi)+2*(1-sec(sqrt(n)*Pi)));

C := (tan(sqrt(n)*Pi)-sqrt(n)*Pi*sec(sqrt(n)*Pi))/(sqrt(n)*Pi-tan(sqrt(n)*Pi));

S := s*(-C^2+1);

Gamma[b] := E[b2]/E[b1];

Gamma[c] := E[c2]/E[c1];

alpha[b] := t[b1]*t[b2]/(t[b1]+t[b2])^2;

alpha[c] := t[c1]*t[c2]/(t[c1]+t[c2])^2;

EIb := b*E[b1]*(t[b1]^4+2*Gamma[b]*alpha[b]*(2-alpha[b])*(t[b1]+t[b2])^4+Gamma[b]^2*t[b2]^4)/(12*(Gamma[b]*t[b2]+t[b1]));

EIc := b*E[c1]*(t[c1]^4+2*Gamma[c]*alpha[c]*(2-alpha[c])*(t[c1]+t[c2])^4+Gamma[c]^2*t[c2]^4)/(12*(Gamma[c]*t[c2]+t[c1]));

b := 1;Lb := 2; Lc1 := 2.5; Lc2 := 3; E[b1] := 180; E[b2] := 200; t[b1] := 0.3e-1; t[b2] := 0.4e-1; E[c2] := 220; t[c1] := 0.5e-1; t[c2] := 0.2e-1;

for k from 0 by 10 to 100 do

E[c1] := 150+k; nce := (1/2)*(Lc1/Lc2)^2*n; nb := (1/2)*(Lb/Lc2)^2*n; q[k] := 1000*fsolve((subs(n = nce, C*s)*EIc/Lc1)^2/(S*EIc/Lc2+subs(n = nce, s)*EIc/Lc1+subs(n = nb, s*(1-C))*EIb/Lb)-subs(n = nce, s)*EIc/Lc1-2*EIb/Lb, n = 1.45 .. 1.56)*evalf(Pi^2)*EIc/(2*Lc2^2); print(q[k], k)

end do;

with(CurveFitting); F := PolynomialInterpolation([seq([10*i, q[10*i]], i = 0 .. 10)], z)

Hi, the fsolve works perfectly fine when otaining SOL2 below. However, as soon as I change the values of paramters (from 0 values in SOL2 to t_prof = .16, t_r = .16, t_w = .16 in SOL3) fsolve simplmy reproduces the eval results and would not solve! Please your help is highly appreciated. Thanks in advance!

restart;
eq1 := ((1-s)*w)^(1-gamma)*r^gamma-P_v = 0;
eq2 := (1-s)*w*H/M-(1-gamma)*P_v*q/phi = 0;
eq3 := r*(K+K_f)/M-gamma*P_v*q/phi = 0;
eq4 := prof-M*p_d*q+(1-s)*w*H+r*(K+K_f) = 0;
eq5 := -tau*y_x+q-y_d-y_g = 0;
eq6 := p_d-sigma*P_v/((sigma-1)*phi) = 0;
eq7 := y_d-M^(lambda-1)*Y*(p_d/P)^(-sigma) = 0;
eq8 := y_x-F_f*(tau*p_d)^(-sigma_x) = 0;
eq9 := y_f-M_f^(lambda-1)*Y*((1+z)*tau*p_f/P)^(-sigma) = 0;
eq10 := (G*alpha_g+Y)^(-alpha_c)/P-A*H^alpha_h/((1-t_w)*w) = 0;
eq11 := P*Y-(1-t_w)*w*H-(1-t_r)*r*K-(1-t_prof)*prof+T = 0;
eq12 := P*Y-M*p_d*y_d-M_f*(1+z)*tau*p_f*y_f = 0;
eq13 := (1-t_r)*r-r_f = 0;
eq14 := G-y_g*M^((lambda_g-1+sigma_g)/(sigma_g-1)) = 0;
eq15 := s*w*H+M*p_d*y_g-T-t_w*w*H-t_r*r*(K+K_f)-t_prof*prof-z*M_f*tau*p_f*y_f = 0;

SOL2 := fsolve(eval({eq1, eq10, eq11, eq12, eq13, eq14, eq15, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9}, [A = 7.716049383, K = 3.2, K_f = 0, alpha_c = .8, alpha_g = .2, alpha_h = 4, lambda = .5, p_f = 1, phi = .625, s = 0, sigma = 5, sigma_g = 5, sigma_x = 5, t_prof = 0, t_r = 0, t_w = 0, tau = 1.1, y_d = 1, y_f = 1, y_g = .4, y_x = 1, z = 0, lambda_g = .5, gamma = .25, gamma = .25]), {F_f, G, H, M, M_f, P, P_v, T, Y, p_d, prof, q, r, r_f, w}, {F_f = 2 .. 4, G = .1 .. .4, H = .4 .. .8, M = .4 .. .6, M_f = .3 .. .7, P = .8 .. 2, P_v = .4 .. .8, T = -.2 .. .3, Y = .7 .. 3, p_d = .9 .. 1.6, prof = .1 .. .4, q = 1.5 .. 2.7, r = 0.4e-1 .. 0.9e-1, r_f = 0.4e-1 .. 0.9e-1, w = .8 .. 3});

 

SOL3 := fsolve(eval({eq1, eq10, eq11, eq12, eq13, eq14, eq15, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9}, [A = 7.716049383, K = 3.2, K_f = 0, alpha_c = .8, alpha_g = .2, alpha_h = 4, lambda = .5, p_f = 1, phi = .625, s = 0, sigma = 5, sigma_g = 5, sigma_x = 5, t_prof = .16, t_r = .16, t_w = .16, tau = 1.1, y_d = 1, y_f = 1, y_g = .4, y_x = 1, z = 0, lambda_g = .5, gamma = .25, gamma = .25]), {F_f, G, H, M, M_f, P, P_v, T, Y, p_d, prof, q, r, r_f, w}, {F_f = 2 .. 4, G = .1 .. .4, H = .4 .. .8, M = .4 .. .6, M_f = .3 .. .7, P = .8 .. 2, P_v = .4 .. .8, T = -.2 .. .3, Y = .7 .. 3, p_d = .9 .. 1.6, prof = .1 .. .4, q = 1.5 .. 2.7, r = 0.4e-1 .. 0.9e-1, r_f = 0.4e-1 .. 0.9e-1, w = .8 .. 3});

If there is  an equation or are several equations, I need to obtain all the roots, how can I do???

 

fsolve ? rootfindings? or what?

 

If an examples of actual is given,  That will be perfect  !!!

 

Thanks 

Hi Everyone,

I have a bunch polynomial systems of equations (all form zero-dimensional ideals, i.e. there is a finite number of complex solutions), and I would like to get a real solution for each of them, if available.

fsolve would be the tool to use. But it lead to some strange behaviour for me. Among some other inputs, the input

fsolve({81*x3^12+72*x3^10-614*x3^9+16*x3^8-384*x3^7+1884*x3^6+480*x3^4-2760*x3^3+1600, 81*x2*x3^11+72*x2*x3^9-452*x2*x3^8+16*x2*x3^7-240*x2*x3^6+980*x2*x3^5+32*x2*x3^4-144*x2*x3^3-800*x2*x3^2-220*x3^3+160*x2^2+480*x2+520, 81*x3^11+72*x3^9-452*x3^8+16*x3^7-240*x3^6+980*x3^5+32*x3^4-144*x3^3-800*x3^2+160*x1+160*x2+480},{x1, x2, x3});

somehow outputs itself, i.e.

fsolve({81*x3^12+72*x3^10-614*x3^9+16*x3^8-384*x3^7+1884*x3^6+480*x3^4-2760*x3^3+1600, 81*x2*x3^11+72*x2*x3^9-452*x2*x3^8+16*x2*x3^7-240*x2*x3^6+980*x2*x3^5+32*x2*x3^4-144*x2*x3^3-800*x2*x3^2-220*x3^3+160*x2^2+480*x2+520, 81*x3^11+72*x3^9-452*x3^8+16*x3^7-240*x3^6+980*x3^5+32*x3^4-144*x3^3-800*x3^2+160*x1+160*x2+480},{x1, x2, x3})

I know that this system has no real solutions, but only complex ones. But wouldn't the expected output then be just nothing (as e.g. "solve" does)?

I am confused by this output. Furthermore, how can I "check" with Maple if the output was a solution? By checking the type? There must be less hacky solutions. Thank you all in advance for your help.

Albert

PS.: When I add the keyword "complex" to the function call, then I receive a complex solution; hence, the syntax at least is correct (if someonw might have doubted that).

When I use fsolve with equation 

-x^2 + 2*x + 5 + (x^2 + 2*x - 1)* sqrt(2 - x^2)=0

I got only one solution.

fsolve(-x^2 + 2*x + 5 + (x^2 + 2*x - 1)* sqrt(2 - x^2)=0,x);

In fact, it have two reals solutions.  

I posted at here

http://mathematica.stackexchange.com/questions/83985/does-the-equation-have-two-roots/83991#83991

 

Dear Colleges

I have a problem with the following code. As you can see, procedure Q1 converges but I couldn't get the resutls from Q2.

I would be most grateful if you could help me on this problem.

 

Sincerely yours

Amir

 

restart;

Eq1:=diff(f(x),x$3)+diff(f(x),x$2)*f(x)+b^2*sqrt(2*reynolds)*diff(diff(f(x),x$2)^2*x^2,x$1);
Eq2:=diff(g(x),x$3)+diff(g(x),x$2)*g(x)+c*a^2*sqrt(2*reynolds)*diff(diff(g(x),x$2)^2*x,x$1);
eq1:=isolate(Eq1,diff(f(x),x,x,x));
eq2:=subs(g=f,isolate(Eq2,diff(g(x),x,x,x)));
EQ:=diff(f(x),x,x,x)=piecewise(x<c*0.1,rhs(eq1),rhs(eq2));
Eq11:=diff(theta(x),x$2)+pr*diff(theta(x),x$1)*f(x)+pr/prt*b^2*sqrt(2*reynolds)*diff(diff(f(x),x$2)*diff(theta(x),x$1)*x^2,x$1);
Eq22:=diff(g(x),x$2)+pr*diff(g(x),x$1)*f(x)+pr/prt*a^2*c*sqrt(2*reynolds)*diff(diff(f(x),x$2)*diff(g(x),x$1)*x^1,x$1);
eq11:=isolate(Eq11,diff(theta(x),x,x));
eq22:=subs(g=theta,isolate(Eq22,diff(g(x),x,x)));
EQT:=diff(theta(x),x,x)=piecewise(x<c*0.1,rhs(eq11),rhs(eq22));
EQT1a:=eval(EQT,EQ):
EQT2:=eval(EQT1a,{f(x)=G0(x),diff(f(x),x)=G1(x),diff(f(x),x,x)=G2(x)}):
bd:=c;
a:=0.13:
b:=0.41:
pr:=1;
prt:=0.86;
reynolds:=12734151.135786774055543653356602;     #10^6;   #1.125*10^8:

c:=88.419896050808975395120916434619:
;
Q:=proc(pp2) local res,F0,F1,F2;
print(pp2);
if not type(pp2,numeric) then return 'procname(_passed)' end if:
res:=dsolve({EQ,f(0)=0,D(f)(0)=0,(D@@2)(f)(0)=pp2},numeric,output=listprocedure);
F0,F1,F2:=op(subs(subs(res),[f(x),diff(f(x),x),diff(f(x),x,x)])):
F1(bd)-1;
end proc;
fsolve(Q(pp2)=0,pp2=(0..1002));
se:=%;
res2:=dsolve({EQ,f(0)=0,D(f)(0)=0,(D@@2)(f)(0)=se},numeric,output=listprocedure):
G0,G1,G2:=op(subs(subs(res2),[f(x),diff(f(x),x),diff(f(x),x,x)])):
plots:-odeplot(res2,[seq([x,diff(f(x),[x$i])],i=1..1)],0..c);



Q2:=proc(rr2) local solT,T0,T1;
print(rr2);
if not type(rr2,numeric) then return 'procname(_passed)' end if:
solT:=dsolve({EQT2,theta(0)=1,D(theta)(0)=-rr2},numeric,known=[G0,G1,G2],output=listprocedure):
T0,T1:=op(subs(subs(res),[theta(x),diff(theta(x),x)])):
T0(bd);
end proc;
fsolve(Q2(rr2)=0,rr2=(0..100));


shib:=%;
sol:=dsolve({EQT2,theta(0)=1,D(theta)(0)=-shib},numeric,known=[G0,G1,G2],output=listprocedure):
plots:-odeplot(sol,[x,theta(x)],0..c);
#fsolve(Q2(pp3)=0,pp3=-2..2):

Amir

Hi,

we want to know what is the meaning of this statement?

We expect to have the following statement . But unfortunately we don,t get it

> with(difforms);
> sol := fsolve({diff(S, x) = 0, diff(S, y) = 0}, {x, y});


I do not take values above code.

Hello there

I'm quite an amature so please don't judge.  I'm trying to use fsolve to solve a system of non-linear equations but Maple is just "spitting" on me the equations with no intention to solve them:

> delta5 := P*(1+mu5)*((1-2*mu5)*x/(sqrt(x^2+zeq^2)*(sqrt(x^2+zeq^2)*x))+x*zeq/sqrt(x^2+zeq^2)^3)/(2*Pi*E5);
print(`output redirected...`); # input placeholder
> shrinkage := P*(1+mu5)*((1-2*mu5)*x/(sqrt(x^2+Zb^2)*(sqrt(x^2+Zb^2)*x))+x*Zb/sqrt(x^2+Zb^2)^3)/(2*Pi*E5)-P*(1+mu5)*((1-2*mu5)*x/(sqrt(x^2+Za^2)*(sqrt(x^2+Za^2)*x))+x*Za/sqrt(x^2+Za^2)^3)/(2*Pi*E5);
> eq10 := subs(x = 1800, delta5)+subs(x = 1800, Zb = z2, Za = z1, shrinkage)+subs(x = 1800, Zb = z3, Za = z2, shrinkage)+subs(x = 1800, Zb = z4, Za = z3, shrinkage)+subs(x = 1800, Zb = z5, Za = z4, shrinkage) = 36.7*10^(-3);
print(`output redirected...`); # input placeholder
> eq9 := subs(x = 1500, delta5)+subs(x = 1500, Zb = z2, Za = z1, shrinkage)+subs(x = 1500, Zb = z3, Za = z2, shrinkage)+subs(x = 1500, Zb = z4, Za = z3, shrinkage)+subs(x = 1500, Zb = z5, Za = z4, shrinkage) = 47.2*10^(-3);
print(`output redirected...`); # input placeholder
> eq8 := subs(x = 1200, delta5)+subs(x = 1200, Zb = z2, Za = z1, shrinkage)+subs(x = 1200, Zb = z3, Za = z2, shrinkage)+subs(x = 1200, Zb = z4, Za = z3, shrinkage)+subs(x = 1200, Zb = z5, Za = z4, shrinkage) = 63.8*10^(-3);
> eq7 := subs(x = 900, delta5)+subs(x = 900, Zb = z2, Za = z1, shrinkage)+subs(x = 900, Zb = z3, Za = z2, shrinkage)+subs(x = 900, Zb = z4, Za = z3, shrinkage)+subs(x = 900, Zb = z5, Za = z4, shrinkage) = 91.1*10^(-3);
print(`output redirected...`); # input placeholder
> eq6 := subs(x = 600, delta5)+subs(x = 600, Zb = z2, Za = z1, shrinkage)+subs(x = 600, Zb = z3, Za = z2, shrinkage)+subs(x = 600, Zb = z4, Za = z3, shrinkage)+subs(x = 600, Zb = z5, Za = z4, shrinkage) = 137.9*10^(-3);
> eq5 := subs(x = 450, delta5)+subs(x = 450, Zb = z2, Za = z1, shrinkage)+subs(x = 450, Zb = z3, Za = z2, shrinkage)+subs(x = 450, Zb = z4, Za = z3, shrinkage)+subs(x = 450, Zb = z5, Za = z4, shrinkage) = 175.2*10^(-3);
> eq4 := subs(x = 300, delta5)+subs(x = 300, Zb = z2, Za = z1, shrinkage)+subs(x = 300, Zb = z3, Za = z2, shrinkage)+subs(x = 300, Zb = z4, Za = z3, shrinkage)+subs(x = 300, Zb = z5, Za = z4, shrinkage) = 230.9*10^(-3);
print(`output redirected...`); # input placeholder
> sys := {eq10, eq5, eq6, eq7, eq8, eq9};
print(`output redirected...`); # input placeholder
> fsolve(sys, {E1 = 1000 .. 2000, E2 = 0 .. 2000, E3 = 0 .. 2000, E4 = 0 .. 2000, E5 = 0 .. 2000, h4 = 100 .. 400});

and this is what Maple gives after the fsolve

 

fsolve({(3937.500000*(.2/(202500+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(450*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(202500+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.3888888889e-2/E5+(3937.500000*(.2/(202500+(650+h4)^2)+(450*(650+h4))/(202500+(650+h4)^2)^(3/2)))/E5 = .1752000000, (3937.500000*(.2/(360000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(600*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(360000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.2187500000e-2/E5+(3937.500000*(.2/(360000+(650+h4)^2)+(600*(650+h4))/(360000+(650+h4)^2)^(3/2)))/E5 = .1379000000, (3937.500000*(.2/(810000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(900*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(810000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.9722222220e-3/E5+(3937.500000*(.2/(810000+(650+h4)^2)+(900*(650+h4))/(810000+(650+h4)^2)^(3/2)))/E5 = 0.9110000000e-1, (3937.500000*(.2/(1440000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(1200*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(1440000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.5468750000e-3/E5+(3937.500000*(.2/(1440000+(650+h4)^2)+(1200*(650+h4))/(1440000+(650+h4)^2)^(3/2)))/E5 = 0.6380000000e-1, (3937.500000*(.2/(2250000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(1500*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(2250000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.3500000000e-3/E5+(3937.500000*(.2/(2250000+(650+h4)^2)+(1500*(650+h4))/(2250000+(650+h4)^2)^(3/2)))/E5 = 0.4720000000e-1, (3937.500000*(.2/(3240000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)+(1800*(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3)))/(3240000+(146.0507832*(E1/E5)^(1/3)+197.1094212*(E2/E5)^(1/3)+295.6641318*(E3/E5)^(1/3)+1.*h4*(E4/E5)^(1/3))^2)^(3/2)))/E5-0.2430555555e-3/E5+(3937.500000*(.2/(3240000+(650+h4)^2)+(1800*(650+h4))/(3240000+(650+h4)^2)^(3/2)))/E5 = 0.3670000000e-1}, {E1, E2, E3, E4, E5, h4}, {E1 = 1000 .. 2000, E2 = 0 .. 2000, E3 = 0 .. 2000, E4 = 0 .. 2000, E5 = 0 .. 2000, h4 = 100 .. 400})

Hi everyone,

 

i'm trying to find out the euler angles from a rotation matrix.

I have a matrix that contains the result of multpilying the 3 axis rotation R(z,c)*R(y,b)*R(x,a) without knowing the values of the angles a,c,b (that's what I want to find out), so there are sinus and cosinus everywhere. There is another matrix containing the expected values that each equation in the first matrix will match.

My problem is that I eventually will change the order of the multiplication of the axis (i.e. R(x,a)*R(z,c)*R(y,b)) and I'm try to make maple compute this for me.

I defined R(x,a), R(y,b) and R(z,c) as follows:

Rx := Matrix (3,3, [1,0,0,0,cos(a),-sin(a),0,sin(a),cos(a)]);    
Ry := Matrix (3,3, [sin(b), 0, cos(b), 0, 1, 0, -sin(b), 0, cos(b)]);
Rz := Matrix (3,3, [cos(c), -sin(c), 0, sin(c), cos(c), 0, 0, 0, 1]);
and
RT := Multiply(Multiply(Rx,Rz),Ry);

Since here is alright. Now I want to match RT to the solution matrix.

g1 := RT[1,1] = mat[1,1];
g2 := RT[1,2] = mat[1,2];
g3 := RT[1,3] = mat[1,3];
g4 := RT[2,1] = mat[2,1];
g5 := RT[2,2] = mat[2,2];
g6 := RT[2,3] = mat[2,3];
g7 := RT[3,1] = mat[3,1];
g8 := RT[3,2] = mat[3,2];
g9 := RT[3,3] = mat[3,3];

soll := fsolve({g1,g2,g3,g4,g5,g6,g7,g8,g9},{a,b,c});

At this point I'm getting an error. I know that there are more equations than variables but the system is solvable anyway.
What maple trick can I do to solve this system or to find the good 3 equations?

 

Extra question:

Is there any method to match RT to mat without all those gX equations?

 

Thank you everyone.

3 4 5 6 7 8 9 Last Page 5 of 13