IT training extension of mathematica system functionality aladjev 2015 06 05

390 2 0
  • Loading ...
1/390 trang
Tải xuống

Thông tin tài liệu

Ngày đăng: 05/11/2019, 14:59

VictorAladjev,VjacheslavVaganov ExtensionofMathematicasystem functionality Tallinn–2015 ExtensionofMathematicasystemfunctionality:VictorAladjev,VjacheslavVaganov.– Tallinn:TRGPress,563p.,2015 Systemsofcomputermathematicsfindmoreandmorebroadapplicationinanumberof natural,economicalandsocialfields Thesesystemsareratherimportanttoolsfor scientists,teachers,researchersandengineers,verywellcombiningsymbolicalmethods withadvancedcomputingmethods Oneofleadersamongmeansofthisclassundoubtedly istheMathematicasystem Thebookfocusesononeimportantaspect–modular programmingsupportedbyMathematica Thegivenaspectisofparticularimportancenot onlyforappendicesbutalsoaboveallitisquiteimportantinthecreationoftheuser meansthatexpandthemostfrequentlyusedstandardmeansofthesystemand/oreliminate itsshortcomings,orcomplementthenewfacilities Softwaretoolspresentedinthebookcontainanumberofratherusefulandeffective methodsofproceduralandfunctionalprogramminginMathematicasystemthatextendthe systemsoftwareandallowsometimesmuchmoreefficientlyandeasilytoprogramthe objectsforvariouspurposesfirstofallwearingsystemcharacter Theabovesoftware toolsratheressentiallydilatetheMathematicafunctionalityandcanbeusefulenoughfor programmingofmanyapplicationsaboveallofsystemcharacter Furthermore,thebookis providedwithfreewarepackageAVZ_Packagecontainingmorethan680procedures, functions,globalvariablesandotherprogramobjects Thepresentbookisorientedona wideenoughrangeofusersofsystemsofthecomputermathematics,teachersand studentsofuniversitiesatcoursesofcomputerscience,mathematicsandother naturalsciencedisciplines Inthecourseofpreparationofthepresentbookthelicensereleases8ữ10of theMathematicasystemprovidedbyWolframResearchInc havebeenused âVictorAladjev,VjacheslavVaganov Allrightsreserved PrintedbyCreateSpace,An Amazon.comCompany Contents Preface5 Chapter1 AdditionalmeansininteractivemodeoftheMathematica13 Chapter2 AdditionaltoolsofprocessingofexpressionsintheMathematicasoftware26 Chapter3 Additionalmeansofprocessingofsymbolsandstringstructuresin theMathematicasystem58 Chapter4 AdditionalmeansofprocessingofsequencesandlistsintheMathematica software81 Chapter5 TheadditionalmeansexpandingthestandardMathematicafunctions,orits softwareasawhole101 5.1 ThecontrolbranchingstructuresandcyclicstructuresintheMathematicasystem123 5.2 ThecycliccontrolstructuresoftheMathematicasystem127 Chapter6 ProblemsofproceduralprogrammingintheMathematicasoftware130 6.1 DefinitionofproceduresintheMathematicasoftware130 6.2 DefinitionoftheuserfunctionsandpurefunctionsinsoftwareoftheMathematica system146 6.3 MeansoftestingofproceduresandfunctionsintheMathematicasoftware154 6.4 HeadingsofproceduresandfunctionsintheMathematicasystem182 6.5 Formalargumentsofproceduresandfunctions;themeansofprocessingthemin theMathematicasoftware207 6.6 Localvariablesofmodulesandblocks;themeansofmanipulationbythemin theMathematicasoftware235 6.7 Globalvariablesofmodulesandblocks;themeansof manipulationbythemintheMathematicasoftware259 6.8 Attributes,optionsandvaluesbydefaultfortheargumentsoftheuserblocks, functionsandmodules;additionalmeans ofprocessingofthemintheMathematicasystem275 6.9 Someadditionalfacilitiesforoperatingwithblocks,functionsandmodulesin theMathematicasoftware292 Chapter7 Meansofinput–outputoftheMathematica354 7.1 MeansoftheMathematicaforworkwithinternalfiles354 7.2 MeansoftheMathematicasystemforworkwithexternalfiles369 7.3 MeansoftheMathematicasystemforprocessingofattributesofdirectoriesand datafiles385 7.4 Additionalmeansofprocessingofdatafilesanddirectories396 7.5 Certainspecialmeansofprocessingofdatafilesanddirectories420 Chapter8 ThemanipulationsorganizationwiththeuserpackagesintheMathematica software431 8.1 Conceptofthecontext,anditsuseinthesoftwareofthe Mathematicasystem432 8.1.1 InterconnectionofcontextsandpackagesinthesoftwareoftheMathematicasystem 437 8.2 Definitionoftheuserpackages,andtheirusageinthe Mathematicasoftware440 8.3 AdditionalmeansofoperatingwithpackagesintheMathematica473 8.4 TheorganizationoftheusersoftwareintheMathematicasystem534 8.5 ApackagefortheMathematicasystem550 References553 Monographs,textbooksandbooksoncomputerscience, theoryofgeneralstatistics,cellularautomatatheoryand computermathematicssystems,preparedandpublishedbymembersoftheBaltic Branchduring1995–2015558 AbouttheAuthors563Mathematica2,5÷10–trademarksofWolframResearchInc Preface Systemsofcomputermathematics(SCM)findmoreandmorewideapplicationina numberofnatural,economicalandsocialsciencessuchas:informatics,chemistry, mathematics,physics,technologies,education,economics,sociology,etc Suchsystems asMathematica,Maple,REDUCE,MuPAD,Derive,Magma,Axiom,Maxima,GAP, MathPiperandothersaremoreandmoredemandedforlearningofthemathematically orienteddisciplines,invariousscientificresearchesandtechnologies Thesesystemsare themaintoolsforteachers,scientists,researchers,andengineers Researchesonthebasis oftechnologySCM,asarule,wellcombinealgebraicmethodswithadvancedcomputing methods InthissenseofSCM–interdisciplinaryareabetweeninformaticsand mathematicsinwhichresearchesareconcentratedondevelopmentofalgorithmsfor algebraical(symbolical)andnumericalcalculationsanddataprocessing,andoncreationof programminglanguagesalongwithprogramenvironmentforrealizationofthiskindof algorithmsandtasksofdifferentpurposewhicharebasedonthem Solutionofapplieduserproblemsinoneortheotherfieldofappendicesissupported bypackagesofappliedprograms(PAPorsimplypackages)ofspecial,highlyspecialized orgeneralpurpose Classificationandcharacteristicofsuchclassofsoftwarecanbefound inourpreviousbooks[3–5] Naturally,thequalifieduserwellowningoneofeffective programminglanguages(forexample,Basic,C,Fortran,PL/1,Pascal,Lisp,Prolog,etc.) inanumberofcasesforthesolutionofowntaskscanindependentlywriteanddebuga separateprogramoracomplexofprogramsallowingtorealizealgorithmofitstasksona personalcomputer Insomecasessuchapproachcanbemoreeffective,thanuseforthese purposesofreadysoftwaresincethesoftwaredeveloperatthesametimewellowns specificsofthesolvedtaskandconditionsofitsoperation However,suchapproach demandsasaruleofseriouscostsandatpresentabundanceofvarioustypeandpurposeof meansforapersonalcomputerbecomesconsiderablyinexpedient Atthesametime, developedPAParesuppliedwithownbuiltinprogramminglanguageofoneorotherlevel ofcomplexityallowingtoprogramthewholetasksortheirseparatefragmentswhichmay beintheenvironmentofapackageareinefficiently,inexpedient,andinsomecasesandis impossibletorealizebythestandardmeansofapackage Thisbookisdevotedtotheclassofsoftwarecalledbysystemsofcomputermathematics which,firstofall,areintendedforthesolutionofproblemsofmathematicalcharacter, and,firstofall,toleadersinthisclasstosystemsMathematicaandMaple Moreover,only theindirectattentionconcerningcomparisonofsystemsoncertainseparatemomentsis paidtothesecondsystemwhereasquitedevelopedtheircomparativeanalysiscanbe foundinourbooks[28-30] Atthat,muchattentionwaspaidbothonexperiencewith describedmeans,andfeaturesoftheirusage,andalsorecommendationsfortheuser followingfromthem Asfaraspossible,themosteffectivetechniqueofapplicationof thesemeansforthesolutionofthoseorotherappliedusertaskshavebeenoffered Moreover,inbook[33]wepresentedanexcursusinhistoryofcomputeralgebrasystems thatrepresentsacertaininterestfortheuserofthisclassofsoftware Ratherdetailed characteristicofthisseriesofbookscanbefound,inparticular,in[30-33]andinthe presentbookisn’tconsidered Ouroperatingexperiencewithsystemsofcomputeralgebra, firstofall,MathematicaandMapleallowednotonlytocarryoutacomparativeanalysisof thesemeans,torevealdeficienciesinherenttothem,andalsotocreateanumberofthe meansexpandingtheirfunctionalityandeliminatingtheirsomedefects Allthese questionsincludingquestionsofterminologicalcharacterwithvariousextentofdetailing havebeenconsideredinaseriesofourbooksandpapers[1-48] TheMathematicasystemalongwiththeabove–mentionedMaplesystemisoneofthe mostknownandpopularSCM,itcontainsaratherlargenumberoffunctionsforproviding assymbolicaltransformations,andfornumericalcalculations TheMathematicasystem fortodayismultipurposemeansthatincludesalargenumberofopportunitiesforthe solutionofquitewiderangeofproblems Naturally,forthesemeanscan`tbegivena ratherfullanalysiswithintheframeworkofthegivenbook Furthermore,thetargetofthe bookconsistsinother–inthebooktheattentionisfocusedonlyononeaspectofsystem– opportunitiesofherprogramenvironmentforsolutionofspecialproblemsofmassand systemcharacter Thisaspecthasthespecialimportancenotonlyforsolutionofappliedtasksbutaboveall itisquiteimportantatcreationofthesoftwareexpandingoftenusedsystemmeansand/or eliminatingtheirdefects,orsupplementingthesystemwithnewmeans Inthiscontext possibilitiesofbuilt–inlanguageofthesystemoncreationofsuchkindofproceduresor functionsareofspecialinterest So,programminginthesystemisamultifacetedsubject andinitwefocusattentiononlyonquestionsofrealizationofprocedures/functionsthat representmainprogramobjectsbothforthemostoftenusedmeansoftheuser,andforthe meansexpandingandimprovingstandardsystemmeansinthesystemsoftware,i.e realizedbymeansofthebuilt–inlanguageofthesystem(Mathlanguage) Inthiscontextit isalsopossibletoestimateinquitefullmeasuretheMathematicasystemsoftware,without regardingtosomesubjectivemoments,firstofall,theuserpreferencesandhabits Naturally,thesemomentsplayaratheressentialpartfortheuserwhichhasacertain experienceofworkwithprogramlanguagesofproceduraltypewhereasforabeginner theystandnotsosharplybecauseoflackofsuchexperience So,consideringorientation ofthegivenbook,forconsciousacquaintancewithitscontentstheknowledge ofMathlanguageatthelevelabovetheinitialissupposed,forexample,withintheworks [29-33,51,52,55,57,60,62,64,66,71] Sincethe10thversionMath–languageiscalledas WolframLanguagewhat,inouropinion,isresultofcertainpainfulambitionssimilarto thosethatareassociatedwithbook”ANewKindofScience”alongwithafairshareof self–advertisementofallegedlynewmeans ThegivenbookaffectsaratherextensivematerialonMathematicasoftwareinthecontext ofitsopportunitiesinproceduralandfunctionalprogramming Meanwhile,mainpurpose ofthisbooklaidasidethequestionswhichareofinterest,firstofall,toreaderswhoarein ownactivityatthefirststagesofanmasteringoftheMathematicasystem Forbeginnersit isrecommendedtoaddressoneselftothecorrespondingeditionswhoselistisrather extensive,aboveall,theEnglish-language TheMathematicasystemisconsideredandin Russian–languageliterature,howeverEnglish–languageeditions,inouropinion,are representedtousmorepreferable Ingeneral,itispossibletofamiliarizeoneselfwith literatureonthewebsitewww.wolfram.com/books,quiteusefulsourcescanbefoundinthe representedreferences,includingaratherusefulreferencesintheInternet Thus,thegivenbookrepresentsacertainsetoftheselectedsystemproblemswhose purposenotonlytoexpandormakemoreeffectivetheMathematicasystem,butalsoto givecertainhelptothoseusersoftheMathematicawhowouldliketomovefromthe user’sleveltoaleveloftheprogrammerortothosewhowhenusingMathematicaalready facedsomeitsrestrictionsandwanttoimproveitsprogramenvironment Atthat,the skilledMathematicaprogrammersprobablywillalsobeabletofindforthemselvesinour bookaratherusefulinformationandofappliedcharacter,andtoreflection Therefore illuminationonlyofsomequestionsessencewithouttheirratherdetaileddiscussion, certainnuancesandconsiderationofadjacentquestionsthatareofteninterestingand importantperseoftentakesplace Moreover,thesystemmeanspresentedinthebookcan beusedasratherusefulmeansatdevelopingownapplicationsintheenvironment ofMathematica Inouropinion,ananalysisofthesourcecodesofthemeanspresentedin thisbookwhichusebotheffective,andnonstandardmethodsofprogrammingalongwith quitecertainpracticalinterestwillallowtomastertheenvironmentofMathematica systemmoredeeply Forconvenienceoftheiruseinthegivenqualitythereaderhas possibilityoffreedownloadofAVZ_PackagepackageforMathematicasystemof versions8÷10whichcontainsthesemeans[48] Themeansconsideredthroughoutthe presentbookanswerfullythemaingoaloftheofferedbookwhichcanbecharacterizedby thefollowing2maindirections,namely: (1)representationofanumberofusefulenoughmeansofsystemcharacterthatexpand andsupplementstandardmeansoftheMathematicasystem;(2)illustrationontheir exampleofreceptionsandmethods,enoughusefulinproceduralandfunctional programming,alongwithanumberofessentialenoughfeaturesofthisparadigmof programmingintheconditionsoftheprogramenvironmentoftheMathematicasystem Hereisquiteappropriatetonoteaquitenaturalmechanismofformationofownsoftware meansoftheuserworkinginsomeprogramenvironment Incourseofprogrammingof oneorothermeans,orthewholeprojectacertainsituationisquiterealwhenisrather expedienttoprogramsomeadditionaltoolsthatareabsentamongstandardmeans,either theyaremoreeffective,ortheyaremoreconvenientthanstandardmeans Inmany importantcasestheapplicabilityofthesemeanscanhavemassenoughcharacter,allowing toformprogramtoolkitofquitewiderangeofapplicability Exactlyinmanyrespectsthankstothedescribedmechanismwehavecreatedquitefamous libraryUserLibforMaplealongwithpackageAVZ_PackageforMathematicawhich containmorethan850and680meansrespectively[47,48] Allabove-mentionedmeansare suppliedwithFreeWarelicenseandhaveopenprogramcode Suchapproachto programmingofmanyprojectsbothinMathematica,andinMaplealsosubstantially promotedemergenceofanumberofsystemmeansfromabove–mentionedlibraryand package,whendevelopmentofsoftwareforsimplificationofitsrealizationrevealed expediencyofdefinitionofthenewaccompanyingtoolsofsystemcharacterthatarerather frequentlyusedbothinappliedandinsystemprogramming So,opennessof theAVZ_Packagepackagecodeallowsbothtomodifythemeanscontaininginit,andto programontheirbasisownmeans,ortousetheircomponentsinvariousappendices In ouropinion,tasksandmeansoftheirrealizationinMathematicawhicharepresentedin theabovepackagecanberatherusefulatdeepermasteringofsystemandinanumberof caseswillallowtosimplifyrathersignificantlyprogrammingofappendicesinit,firstof all,thesystemproblems Atthat,themethodologicalconsiderationsrepresentedinour previousbooks[29-33]fullyremaininforceandrelativetothepresentbook MeansofAVZ_Packagepackagehavedifferentcomplexityoforganizationandused algorithms;incertaincases,theyuseeffectiveandnonstandardreceptionsof programminginMathematica Thegivenmeanscanbeusedasindividually(forthe decisionofvariousproblemsorforcreationontheirbasisofnewmeans),andinstructure ofAVZ_PackagepackageextendingstandardtoolsoftheMathematica,eliminatinga numberofitsdefectsandmistakes,raisingitscompatibilityrelativelytoitsreleasesand raisingeffectivenessofprogrammingofproblemsinMathematica Atoolrepresentedin thebookissuppliedwithdescriptionandexplanations,containsthesourcecodeandthe moretypicalexamplesofitsapplication Asrequired,adescriptionhassuppliedby necessaryconsiderations,concerningpeculiaritiesofprogramexecutionin theMathematicaenvironment Thegivenbookconsiderscertainprincipalquestionsofprocedure–functional programminginMathematica,notonlyforthedecisionofvariousappliedproblems,but, firstofall,forcreationofthesoftwareexpandingfrequentlyusedfacilitiesofthesystem and/oreliminatingtheirdefectsorexpandingthesystemwithnewfacilities Thesoftware presentedinthisbookcontainsaseriesofusefulandeffectivereceptionsofprogramming inMathematicasystem,andextendsitssoftwarewhichenablesmoresimplyand effectivelytoprogrammeinthesystemMathematicatheproblemsofvariouspurpose The representedmonograph,ismostlyforpeoplewhowantthemoredeepunderstandingin theMathematicaprogramming,andparticularlythoseMathematicauserswhowouldlike tomakeatransitionfromtheusertoaprogrammer,orperhapsthosewhoalreadyhave certainlimitedexperienceinMathematicaprogrammingbutwanttoimprovetheir possibilitiesinthesystem WhereastheexpertMathematicaprogrammerswillalso probablyfindanusefulenoughinformationforyourself Atthat,itshouldbenotedthatthesourcecodesofmeansgiveninthisbookcontaincalls ofnon–standardtoolsthatdidn’tfindreflectioninthepresentbookinanumberofcases, butarepresentedinourpackage[48] Therefore,theirdetailedanalysisrequires acquaintancewiththesetools,atleast,atthelevelofusagesonthem Meanwhile,the mainalgorithmofmanymeansofthepresentedbookisratherwelllookedthroughand withoutacquaintancewithsimilarmeanswhilerealuseofthesemeansperhapsonlyafter loadingofthispackageintothecurrentsession Alongwiththeillustrativepurposesthe meansrepresentedinthismonographquitecanbeusedandasenoughusefulmeans extendingtheprogramMathematicaenvironmentthatrathersignificantlyfacilitate programmingofawiderangeoftheproblemsfirstofallhavingthesystemcharacter Our experienceofconductingofthemasterclassesofvariouslevelinsystems andMathematica,andMapleconfirmsexpediencyofapplicationincommonwith standardmeansofbothsystemsandsomeusertoolscreatedinthecourseofprogramming ofappendices Toolsrepresentedinthebookincreasetherangeandefficiencyofusageof MathematicaonWindowsplatformowingtotheinnovationsinthreebasicdirections, namely:(1)eliminationofaseriesofbasicdefectsandshortcomings,(2)extendingof capabilitiesofaseriesofstandardtools,and(3)replenishmentofthesystembynewmeans whichincreasecapabilitiesofitsprogramenvironment,includingthemeanswhich improvethelevelofcompatibilityofreleases7–10 Atlast,withorganizationoftheuser softwareandprogrammingoflarge-scalesystemsinMathematicasoftwarealongwithour standpointonaquestion:MathematicaorMaple?theinterestedreadercanfamiliarizein [29–33] Atlast,anumberofmeansrepresentedintheabovebooksisintendedfora extensionofstandardmeansofthesystemsMathematicaandMaplealongwith eliminationoftheirshortcomingsandmistakes Thesemeansnotonlymoreaccurately accentdistinctionsofbothsystems,butalsotheirproblemsofcommoncharacter Andin thisrelationtheyallowtolookfromdifferentpointsofviewontheseorotherboth advantages,andshortcomingsofbothsystems Inthepresentbookwepresentanumber ofmeansofsimilartypeconcerningtheMathematicasystem Atthat,itshouldbenoted thatamassoptimizationofprocedureshavenotbeenperformed,proceduresinmany caseshavebeenwritten,astheysayon’sheet‘;ontheotherhand,numerousprocedures havebeenoptimizedusingboththestandardmeansandnewlycreatedtoolsofsystem character Inthiscontextherethereisamagnificentexperimentalfieldforincreasingof professionalismoftheuseratoperatingwiththeMathematicasoftware Inclusionofsourcecodesoftheproceduresandfunctionspresentedinthisbookwiththeir shortcharacteristicdirectlyinthebooktextallowstoworkwiththemwithoutcomputer, consideringahabitofconsiderablenumberoftheusersoftheseniorgenerationtooperate withprogramlistingsbeforeexittothecomputerwhatinaseriesofcasespromotedbetter programminginduetimeatprogramminginbatchmode Inouropinion,skilltooperate withprogramlistingsisaratherimportantcomponentoftheprogrammerculture,allowing bettertofeeltheusedprogramenvironment Inacertainmeasureitissimilarto possessionofthemusicianbythesheetmusic Moreover,manylistingsoftherepresentedmeanshavearathersmallsize,allowingto analyzethemoutsideoftheMathematicaenvironmentintheassumptionthatthereaderis sufficientlyfamiliarwithitssoftware Now,atmassexistenceofpersonalcomputersof varioustypethementionedvisualanalysisoftheprogramlistingswasreplacedwiththe modeofinteractiveprogramming,howeverit’snotthesame,andinthefirstcasethe processofprogrammingseemstousmorebetterandefficient Meanwhile,eventoolswith smallsourcecodeoftenareusefulenoughatprogrammingofvariousapplications,in particular,ofsystemcharacter Whereasothersdemandfortheunderstandingofserious enoughelaboration,includingacquaintancewithourpackageAVZ_Package[48] Asshowsourexperience,theprogrammingintheabovemodeslightlymoreslowly,than directlyonthecomputer,howeveritallowstoconcentrateourbetteronanobjectof programminganditisbettertothinkoveraproblemandawayofitsdecision,rather,than methodofitsdecisionintheso-calledinteractivemode Eveninthepresenceof thepersonalcomputer(PC)wegotusedthebasicskeletonofaprogramtowriteonpaper andonlythentopasstodebuggingontothepersonalcomputerintheinteractivemode So, inouropinion,suchapproachallowstowriteprogramsmorethoughtfully;atthat, followingtheoldhabittowriteoptimalenoughcodesfortheirsubsequentperformanceon quitelimitedcomputingresourcesofthecomputers20–30yearsago However,inmany respectsthisismatterofhabit,howeveryoushouldn’tforgetthattheoldisn’talways worsethannewoneand,gettingnewopportunities,we,often,losetheoldskillsimportant forwork Hereandinthiscase,havingreceivedveryconvenientmeansof communication,we,sometimes,losesightofefficiencyofaprogramcode,creatingit withoutespecialdifficultiesintheinteractivemodewiththeonlypurposetoreceivethe demandedresult,often,ignoringquality Ofcourse,thereisnoonlybestwayofcreationofеруprograms Differenttechnologies andparadigmsarerequiredfortheprogrammingofdifferentproblemsandtheirlevelsof complexity So,intheelementarycasesisquiteenoughoftheknowingofelementsof structuralwritingofprograms Whileforcreationofcomplexprogramprojectsisrequired notonlytobefluentinaprogramminglanguageinratherfullvolume,butalsotohave notionoftheprinciplesofelaborationanddebuggingofprograms,opportunitiesofboth standardandotherlibrariesofoneortheothersoftware,etc Asarule,thantheproblemismorecomplex,themoretimeisrequiredformasteringof thetoolsnecessaryforitsdecision Inthiscontextthesoftware (procedures/functions/globalvariables)whichispresentedinthepresentbookcontaina numberofratherusefulandeffectivemethodsofprogrammingintheMathematica environmentandextendsitsprogramenvironment,theygiveopportunitymoresimplyand effectivetoprogramdifferentproblems Thesemeansintheprocessofapplicationof theAVZ_Packagepackageareupdated,takingintoaccountboththenewmeans,andthe optimizationofalreadyexistingmeans Inmanyproblemsofdifferentpurposethe packageAVZ_Packageshoweditselfasarathereffectivetoolkit Thepackageonthe freewareconditionsisattachedtothepresentbook[48] Chapter1 Additionalmeansininteractivemodeofthe Mathematicasystem FurtherwewilldistinguishtwomainoperatingmodeswithMathematica–interactive andprogram Underthefirstmodestep-by-stepperformancewithaMathematica document,i.e fromaninputIn[n]uptooutputOut[n]willbeunderstoodwhileunder theprogrammodetheoperatingwithinablockoramoduleisunderstood Inthepresent chaptersomeadditionalmeansratherusefulatworkwithMathematicaininteractivemode areconsidered Inthecourseofoperatingininteractivemodeinmanycasesthereisaneed ofuseofearliercalculatedexpressionsinthepreviousIn-paragraphs Forthispurpose the%koperator{%,%%,%%…%%(ktimes)}serveswhichdefinesreturnofthelast, penultimateandkthpreviousresultofcalculationsinthecurrentsession Inaddition,it shouldbenotedthat%–operatorsinsystemsMathematicaandMapleareconceptually various Though,havingvariousrealareasofapplicabilityinMathematicaandMaple,at thesametime%–operatorspossessboththeshortcomings,andessentialadvantages[2833] TheMathematicasupports2ratherusefulpredeterminedglobalvariables: $Line–definesnumberofthelastInparagraphofthecurrentsession; $HistoryLength–definesnumberofthepreviousparagraphsInandOutkeptinthecurrent session Moreover,thesevariablesallowredefinitionsbysimpleassignmentofnewvalues For$HistoryLengthvariablevaluebydefaultistheinfinity(∞);butusingsmaller installationsforthevariable,itispossiblesignificantlytosavethesizeofRAMrequired forMathematicasystem Inturn,globalvariable$Line1unlikethestandardglobal variable$LinedeterminestotalnumberofOutparagraphsofthecurrentsession,including resultsofcalculationoftheuserpackagesloadedintothesessionfromfilesofformats {”cdf“,“nb”} In[500]:=$Line1:=Block[{a=””,c=“Out[“,k=1},For[k,k - Xem thêm -

Xem thêm: IT training extension of mathematica system functionality aladjev 2015 06 05 , IT training extension of mathematica system functionality aladjev 2015 06 05

Gợi ý tài liệu liên quan cho bạn