Ìèíèñòåðñòâî îáðàçîâàíèÿ Ðåñïóáëèêè Áåëàðóñü Ó÷ÐÅÆÄÅÍÈÅ ÎÁÐÀÇÎÂÀÍÈ «ÃÐÎÄÍÅÍÑÊÈÉ ÃÎÑÓÄÀÐÑÒÂÅÍÍÛÉ ÓÍÈÂÅÐÑÈÒÅÒ ÈÌÅÍÈ ßÍÊÈ ...
11 downloads
162 Views
1MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Ìèíèñòåðñòâî îáðàçîâàíèÿ Ðåñïóáëèêè Áåëàðóñü Ó÷ÐÅÆÄÅÍÈÅ ÎÁÐÀÇÎÂÀÍÈ «ÃÐÎÄÍÅÍÑÊÈÉ ÃÎÑÓÄÀÐÑÒÂÅÍÍÛÉ ÓÍÈÂÅÐÑÈÒÅÒ ÈÌÅÍÈ ßÍÊÈ ÊÓÏÀËÛ»
Ã.×. Øóøêåâè÷, Ñ.Â. Øóøêåâè÷
Ââåäåíèå â MàthCAD 2000 Ó÷åáíîå ïîñîáèå
Ãðîäíî 2001
1
ÓÄÊ ÁÁÊ Ø 98 Ðåöåíçåíòû: çàâ. êàôåäðîé èíôîðìàöèîííûõ òåõíîëîãèé Èíñòèòóòà ïîñëåäèïëîìíîãî îáðàçîâàíèÿ, êàíäèäàò òåõíè÷åñêèõ íàóê Â.Ã.Ðîä÷åíêî; äîöåíò êàôåäðû ÔÀ è ÈÓ, ïðèêëàäíîé ìàòåìàòèêè ÃðÃÓ, êàíäèäàò ôèçèêî-ìàòåìàòè÷åñêèõ íàóê Í.Í.Èâàíîâ.
Ðåêîìåíäîâàíî ñîâåòîì ìàòåìàòè÷åñêîãî ôàêóëüòåòà ÃðÃÓ èìåíè ßíêè Êóïàëû.
Øóøêåâè÷ Ã.×. Ââåäåíèå â MathCAD 2000: Ó÷åá. ïîñîáèå / Ã.×.Øóøêåâè÷, Ø98 Ñ.Â.Øóøêåâè÷. Ãðîäíî: ÃðÃÓ, 2001. 138 ñ. ISBN
ÓÄÊ ÁÁÊ
ISBN
© Øóøêåâè÷ Ã.×., Øóøêåâè÷ Ñ.Â., 2001
2
ÂÂÅÄÅÍÈÅ Ìèëëèîíû ëþäåé çàíèìàþòñÿ ìàòåìàòè÷åñêèìè ðàñ÷åòàìè, èíîãäà â ñèëó âëå÷åíèÿ ê òàèíñòâàì ìàòåìàòèêè è åå âíóòðåííåé êðàñîòå, à ÷àùå â ñèëó ïðîôåññèîíàëüíîé èëè èíîé íåîáõîäèìîñòè. Íè îäíà ñåðüåçíàÿ ðàçðàáîòêà â ëþáîé îòðàñëè íàóêè è ïðîèçâîäñòâà íå îáõîäèòñÿ áåç òðóäîåìêèõ ìàòåìàòè÷åñêèõ ðàñ÷åòîâ. Âíà÷àëå ýòè ðàñ÷åòû âûïîëíÿëèñü íà ïðîãðàììèðóåìûõ ìèêðîêàëüêóëÿòîðàõ èëè ñ ïîìîùüþ ïðîãðàìì íà óíèâåðñàëüíûõ ÿçûêàõ ïðîãðàììèðîâàíèÿ, òàêèõ, êàê Áåéñèê, Ïàñêàëü. Ïîñòåïåííî äëÿ îáëåã÷åíèÿ ðàñ÷åòîâ áûëè ñîçäàíû ñïåöèàëüíûå ìàòåìàòè÷åñêèå êîìïüþòåðíûå ñèñòåìû. Ñèñòåìà MathCAD çàíèìàåò îñîáîå ìåñòî ñðåäè ìíîæåñòâà òàêèõ ñèñòåì, êàê Eureka, MatLAB, Mathematica, Maple è äðóãèõ, è ïî ïðàâó ìîæåò íàçûâàòüñÿ ñàìîé ñîâðåìåííîé, óíèâåðñàëüíîé è ìàññîâîé ìàòåìàòè÷åñêîé ñèñòåìîé. Åå íàçâàíèå ïðåäñòàâëÿåò ñîáîé àááðåâèàòóðó âûðàæåíèÿ Mathematical Computer Aided Design (ìàòåìàòè÷åñêîå àâòîìàòèçèðîâàííîå ïðîåêòèðîâàíèå), ÷òî ãîâîðèò î íàçíà÷åíèè ñèñòåìû ðåøåíèå ðàçëè÷íûõ âû÷èñëèòåëüíûõ çàäà÷. Îíà ïîçâîëÿåò âûïîëíèòü êàê ÷èñëåííûå, òàê è àíàëèòè÷åñêèå (ñèìâîëüíûå) âû÷èñëåíèÿ, èìååò óäîáíûé ìàòåìàòèêî-îðèåíòèðîâàííûé èíòåðôåéñ è ïðåêðàñíûå ñðåäñòâà ãðàôèêè. Íîâàÿ âåðñèÿ MathCAD 2000 ðàáîòàåò ïîä óïðàâëåíèåì Windows 95/98/2000/NT. Ñèñòåìà MathCAD èçíà÷àëüíî ñîçäàâàëàñü äëÿ ÷èñëåííîãî ðåøåíèÿ ìàòåìàòè÷åñêèõ çàäà÷ (1988), è òîëüêî íà÷èíàÿ ñ 1994 ã. â íåå èíòåãðèðîâàíû èíñòðóìåíòû ñèìâîëüíîé ìàòåìàòèêè èç ñèñòåìû Maple, ÷òî ïîñòåïåííî ïðåâðàòèëî MathCAD â óíèâåðñàëüíûé èíñòðóìåíò ðåøåíèÿ ìàòåìàòè÷åñêèõ çàäà÷. Ñèñòåìû êëàññà MathCAD ïðåäîñòàâëÿþò óæå ïðèâû÷íûå, ìîùíûå, óäîáíûå è íàãëÿäíûå ñðåäñòâà îïèñàíèÿ àëãîðèòìîâ ðåøåíèÿ ìàòåìàòè÷åñêèõ çàäà÷. Ïðåïîäàâàòåëè è ñòóäåíòû âóçîâ ïîëó÷èëè âîçìîæíîñòü ïîäãîòîâêè ñ èõ ïîìîùüþ íàãëÿäíûõ è êðàñî÷íûõ îáó÷àþùèõ ïðîãðàìì â âèäå ýëåêòðîííûõ êíèã ñ äåéñòâóþùèìè â ðåàëüíîì âðåìåíè ïðè3
ìåðàìè. Íîâåéøàÿ ñèñòåìà MathCAD 2000 PRO íàñòîëüêî ãèáêà è óíèâåðñàëüíà, ÷òî ìîæåò îêàçàòü íåîöåíèìóþ ïîìîùü â ðåøåíèè ìàòåìàòè÷åñêèõ çàäà÷ êàê øêîëüíèêó, ïîñòèãàþùåìó àçû ìàòåìàòèêè, òàê è àêàäåìèêó, ðàáîòàþùåìó ñî ñëîæíåéøèìè íàó÷íûìè ïðîáëåìàìè. Ñèñòåìà èìååò äîñòàòî÷íûå âîçìîæíîñòè äëÿ âûïîëíåíèÿ íàèáîëåå ìàññîâûõ ñèìâîëüíûõ (àíàëèòè÷åñêèõ) âû÷èñëåíèé è ïðåîáðàçîâàíèé. Áîëåå 1500000 çàðåãèñòðèðîâàííûõ ïîëüçîâàòåëåé âëàäåþò ðàííèìè âåðñèÿìè ñèñòåìû MathCAD âî âñåì ìèðå, à ñ âûõîäîì íîâûõ âåðñèé ñèñòåìû ýòî ÷èñëî íàâåðíÿêà çàìåòíî óâåëè÷èòñÿ. Î ñèñòåìå ñ òàêîé âû÷èñëèòåëüíîé ìîùüþ, êàê ó MathCAD 2000 PRO, åùå ïàðó äåñÿòêîâ ëåò íàçàä íå ìîãëè ìå÷òàòü äàæå ðàçðàáîò÷èêè óíèêàëüíîé íàó÷íîé è êîñìè÷åñêîé àïïàðàòóðû. Íî ýòà ìîùü íèñêîëüêî íå çàòðóäíÿåò óäèâèòåëüíî ïðîñòîå è èíòóèòèâíî ïðåäñêàçóåìîå îáùåíèå ñ ñèñòåìîé íà îáùåïðèíÿòîì ÿçûêå ìàòåìàòè÷åñêèõ ôîðìóë è ãðàôèêîâ. Èñêëþ÷èòåëüíî âåëèêà ðîëü ñèñòåì êëàññà MathCAD â îáðàçîâàíèè. Îáëåã÷àÿ ðåøåíèå ñëîæíûõ ìàòåìàòè÷åñêèõ çàäà÷, ñèñòåìà ñíèìàåò ïñèõîëîãè÷åñêèé áàðüåð ïðè èçó÷åíèè ìàòåìàòèêè. Ãðàìîòíîå ïðèìåíåíèå ñèñòåì â ó÷åáíîì ïðîöåññå îáåñïå÷èâàåò ïîâûøåíèå ôóíäàìåíòàëüíîñòè ìàòåìàòè÷åñêîãî è òåõíè÷åñêîãî îáðàçîâàíèÿ, ñîäåéñòâóåò ïîäëèííîé èíòåãðàöèè ïðîöåññà îáðàçîâàíèÿ â íàøåé ñòðàíå è íàèáîëåå ðàçâèòûõ çàïàäíûõ ñòðàíàõ, ãäå ïîäîáíûå ñèñòåìû ïðèìåíÿþòñÿ óæå äàâíî. Íîâûå âåðñèè MathCAD ïîçâîëÿþò ãîòîâèòü ýëåêòðîííûå óðîêè è êíèãè ñ èñïîëüçîâàíèåì íîâåéøèõ ñðåäñòâ ìóëüòèìåäèà, âêëþ÷àÿ ãèïåðòåêñòîâûå è ãèïåðìåäèà-ññûëêè, èçûñêàííûå ãðàôèêè. Íàø îïûò ïîêàçûâàåò, ÷òî ñèñòåìó MathCAD ìîæíî óñïåøíî èñïîëüçîâàòü ïðè ïðîâåäåíèè ëàáîðàòîðíûõ çàíÿòèé ïî êóðñàì «×èñëåííûå ìåòîäû», «Ìàòåìàòè÷åñêîå ìîäåëèðîâàíèå», «Ìåòîäû ìàòåìàòè÷åñêîé ôèçèêè». Àâòîðû âûðàæàþò áëàãîäàðíîñòü ôèðìå MathSoft Inc. (USA) çà ïðåäîñòàâëåííóþ âîçìîæíîñòü èñïîëüçîâàòü MathCAD 2000 Professional (¹ PN902006DP0980T) ïðè íàïèñàíèè ó÷åáíîãî ïîñîáèÿ. 4
1. Èíòåðôåéñ MathCAD 2000 Ïîñëå èíñòàëÿöèè MathCAD 2000 Professional è ñîçäàíèÿ íà ðàáî÷åì ñòîëå ÿðëûêà ìîæíî çàïóñòèòü ïàêåò íà âûïîëíåíèå. Äâîéíîé ùåë÷îê ëåâîé êíîïêîé ìûøè ïî çíà÷êó âûâîäèò íà ýêðàí ìîíèòîðà çàñòàâêó ïàêåòà (ðèñ. 1.1), êîòîðàÿ íàõîäèòñÿ íà ýêðàíå ìîíèòîðà äî òåõ ïîð, ïîêà ïðîèçâîäèòñÿ àâòîìàòè÷åñêàÿ çàãðóçêà ïðîãðàììû.
Ðèñ. 1.1. Çàñòàâêà MathCAD 2000 Professional
Çàòåì íà ýêðàíå ìîíèòîðà ïîÿâëÿåòñÿ îêíî MathCAD 2000 Professional (ðèñ. 1.2).  öåíòðå îêíà ðàñïîëîæåíî îêíî Tip of the Day (Ïîëåçíûå ñîâåòû), êîòîðîå ïîçâîëÿåò áûñòðî îçíàêîìèòü ïîëüçîâàòåëÿ ñ âîçìîæíîñòÿìè MathCAD 2000 (èíôîðìàöèÿ íà àíãëèéñêîì ÿçûêå). Äëÿ ïåðåêëþ÷åíèÿ òåì ñëóæèò êíîïêà Next Tip (Ñëåäóþùàÿ òåìà), à äëÿ ïåðåõîäà ê ðàáîòå ñ MathCAD 2000 êíîïêà Close (Çàêðûòü). Åñëè ïîÿâëåíèå îêíà Tip of the Day ïðè ïîñëåäóþùèõ çàïóñêàõ MathCAD 2000 íåæåëàòåëüíî, òî ñëåäóåò îòêëþ÷èòü ôëàæîê Show tips on startup. 5
Ðèñ. 1.2. Îêíî MathCAD 2000 Professional
 îêíå ïðîãðàììû âåðõíÿÿ ñòðîêà ñòðîêà çàãîëîâêà, íèæå ðàçìåùàþòñÿ ñòðîêà ìåíþ è ïàíåëè èíñòðóìåíòîâ.  ëåâîé ÷àñòè ñòðîêè çàãîëîâêà íàõîäèòñÿ êíîïêà óïðàâëåíèÿ îêíîì MathCAD 2000. Ùåë÷îê ëåâîé êíîïêîé ìûøè ïî ýòîé êíîïêå âûâîäèò íà ýêðàí ìåíþ ñ íàçâàíèÿìè êîìàíä, ïîçâîëÿþùèìè ìàíèïóëèðîâàòü îêíîì ïàêåòà. Çà êíîïêîé óïðàâëåíèÿ îêíîì ñëåäóþò èìÿ Windows ïðèëîæåíèÿ MathCAD Professional è èìÿ ôàéëà, â êîòîðîì ñîõðàíÿþòñÿ ðåçóëüòàòû ðàáîòû. Ïî óìîë÷àíèþ èìÿ ôàéëà Untitled:1.  ïðàâîé ÷àñòè ñòðîêè çàãîëîâêà íàõîäÿòñÿ òðè êíîïêè äëÿ ðàáîòû ñ îêíîì ïðîãðàììû: Ñâåðíóòü, Ðàçâåðíóòü íà ïîëíûé ýêðàí è Çàêðûòü îêíî ïðèëîæåíèÿ. Âòîðàÿ ñòðîêà ñâåðõó ñòðîêà ãëàâíîãî ìåíþ MathCAD 2000 Professional. Îíà ñîäåðæèò ñëåäóþùèå ïóíêòû: · File (Ôàéë) ðàáîòà ñ ôàéëàìè; · Edit (Ïðàâêà) îáðàáîòêà ôðàãìåíòîâ äîêóìåíòà; · View (Âèä) íàñòðîéêà ýëåìåíòîâ îêíà; · Insert (Âñòàâêà) âñòàâêà îáúåêòîâ è èõ øàáëîíîâ; · Format (Ôîðìàò) ôîðìèðîâàíèå ïàðàìåòðîâ ýëåìåíòîâ òåêñòà; 6
· Math (Ìàòåìàòèêà) óïðàâëåíèå ïðîöåññîì âû÷èñëåíèÿ; · Symbol (Ñèìâîëüíûå îïåðàöèè) âûáîð îïåðàöèè ñèìâîëüíîãî ïðîöåññîðà; · Window (Îêíî) óïðàâëåíèå îêíàìè MathCAD 2000; · Help (Ïîìîùü) ðàáîòà ñî ñïðàâî÷íîé ñèñòåìîé. Ùåë÷êîì ëåâîé êíîïêè ìûøè ïî îäíîìó èç ïóíêòîâ ãëàâíîãî ìåíþ îòêðûâàåòñÿ íèñïàäàþùåå ìåíþ ñî ñïèñêîì äîñòóïíûõ (÷åòêèé øðèôò) è íåäîñòóïíûõ êîìàíä (øðèôò â ôîíîâîì ðåæèìå ïîçâîëÿåò ïðî÷èòàòü íàçâàíèå êîìàíäû). Äàëåå ñëåäóþò ïàíåëè èíñòðóìåíòîâ. Òðàäèöèîííî â îêíå ïðîãðàììû ðàçìåùàþòñÿ Ñòàíäàðòíàÿ ïàíåëü èíñòðóìåíòîâ è ïàíåëü èíñòðóìåíòîâ Ôîðìàòèðîâàíèå. Ñòàíäàðòíàÿ ïàíåëü èíñòðóìåíòîâ (Toolbars Standard) ñîäåðæèò êíîïêè äëÿ áûñòðîãî âûïîëíåíèÿ íàèáîëåå ðàñïðîñòðàíåííûõ êîìàíä ãëàâíîãî ìåíþ. ×åòâåðòóþ ñòðîêó îêíà çàíèìàåò ïàíåëü Ôîðìàòèðîâàíèå (Toolbars Formatting), êîòîðàÿ ñëóæèò äëÿ âûáîðà ñòèëÿ è ðàçìåðîâ øðèôòîâ è ñïîñîáà âûðàâíèâàíèÿ òåêñòîâûõ êîììåíòàðèåâ.  îêíå MathCAD 2000 Professional ìîæåò íàõîäèòüñÿ òàêæå ïàíåëü ìàòåìàòè÷åñêèõ èíñòðóìåíòîâ (Math) c ïèêòîãðàììàìè,
Ðèñ. 1.3. Ïàíåëü ìàòåìàòè÷åñêèõ èíñòðóìåíòîâ Math
êîòîðûå îòêðûâàþò ñëåäóþùèå ïàíåëè èíñòðóìåíòîâ (ðèñ.1.3): ïàíåëü èíñòðóìåíòîâ Calculator (Êàëüêóëÿòîð). Íà ýòîé ïàíåëè íàõîäÿòñÿ êíîïêè àðèôìåòè÷åñêèõ îïåðàöèé, ýëåìåíòàðíûõ ôóíêöèé. Êíîïêà : = ïðåäíàçíà÷åíà äëÿ ââîäà îïåðàòîðà ïðèñâàèâàíèÿ, êíîïêà = äëÿ ÷èñëåííîãî âû÷èñëåíèÿ âûðàæåíèÿ, ïàíåëü èíñòðóìåíòîâ Graph (Ãðàôèêè) ñîäåðæèò èíñòðóìåíòû äëÿ ïîñòðîåíèÿ ãðàôèêîâ, ïàíåëü èíñòðóìåíòîâ Matrix (Ìàòðèöû). Èíñòðóìåíòû 7
ýòîé ïàíåëè ïðåäíàçíà÷åíû äëÿ ââîäà âåêòîðîâ è ìàòðèö, à òàêæå íåêîòîðûõ îïåðàöèé íàä íèìè, ïàíåëü èíñòðóìåíòîâ Evaluation (Âû÷èñëåíèå). Çäåñü íàõîäÿòñÿ ïèêòîãðàììû îïåðàòîðîâ ëîêàëüíîãî è ãëîáàëüíîãî ïðèñâàèâàíèÿ çíà÷åíèé ïåðåìåííûì è çàäàíèÿ ôóíêöèé, êíîïêè äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ âûðàæåíèé, ïàíåëü èíñòðóìåíòîâ Calculus (Èñ÷èñëåíèå). Èíñòðóìåíòû ýòîé ïàíåëè ïîçâîëÿþò ââîäèòü îïåðàòîðû èíòåãðèðîâàíèÿ, äèôôåðåíöèðîâàíèÿ, ïðåäåëîâ, ñóììû è ïðîèçâåäåíèÿ, ïàíåëü èíñòðóìåíòîâ Boolean (Áóëåâà). Ýòà ïàíåëü ñîäåðæèò êíîïêè äëÿ ââîäà ëîãè÷åñêèõ îïåðàòîðîâ è îïåðàòîðîâ ñðàâíåíèÿ, ïàíåëü èíñòðóìåíòîâ Programming (Ïðîãðàììèðîâàíèå), ïàíåëü èíñòðóìåíòîâ Greek (Ãðå÷åñêèé àëôàâèò). Ýòà ïàíåëü ïðåäíàçíà÷åíà äëÿ ââîäà ãðå÷åñêèõ áóêâ, ïàíåëü èíñòðóìåíòîâ Symbolic (Ñèìâîëû). Åñëè ïàíåëü ìàòåìàòè÷åñêèõ èíñòðóìåíòîâ îòñóòñòâóåò, ýòî îçíà÷àåò, ÷òî â ïîäìåíþ Toolbars (Ïàíåëè èíñòðóìåíòîâ) ìåíþ View (Âèä) îòêëþ÷åíà îïöèÿ Math è åå ñëåäóåò âêëþ÷èòü. Ïîä ñòðîêîé ïàíåëè Ôîðìàòèðîâàíèå íàõîäèòñÿ ðàáî÷åå îêíî äîêóìåíòà, â êîòîðîì ðàñïîëàãàþòñÿ òåêñòîâûå êîììåíòàðèè, ââåäåííûå êîìàíäû è ìàòåìàòè÷åñêèå âûðàæåíèÿ, âûâîäèìûå ðåçóëüòàòû âû÷èñëåíèé, ãðàôèêè. Âñþ èíôîðìàöèþ, ðàñïîëîæåííóþ â ðàáî÷åì îêíå, íàçûâàþò Math-äîêóìåíòîì. Ðàáî÷åå îêíî ñíàáæåíî äâóìÿ ïîëîñàìè ïðîêðóòêè âåðòèêàëüíîé è ãîðèçîíòàëüíîé. Ïîñëåäíÿÿ, íèæíÿÿ ñòðîêà îêíà ñòðîêà ñîñòîÿíèÿ.  íåé çàïèñàíû ðåêîìåíäàöèè ê äàëüíåéøèì äåéñòâèÿì, òåêóùåå ñîñòîÿíèå ïàêåòà, íîìåð îòîáðàæåííîé íà ýêðàíå ñòðàíèöû Math-äîêóìåíòà. Ïàíåëè èíñòðóìåíòîâ èìåþò ñëåâà âûïóêëóþ âåðòèêàëüíóþ ÷åðòó. Ïðè íàæàòîé ëåâîé êíîïêå ìûøè ìîæíî ïåðåòàùèòü ïàíåëü â ëþáîå ìåñòî îêíà.
8
2. Îñíîâíûå êîìàíäû ãëàâíîãî ìåíþ MathCAD 2000  ýòîé ãëàâå ïðåäñòàâëåí êðàòêèé îáçîð êîìàíä ãëàâíîãî ìåíþ MathCAD 2000 Professional. Áîëåå ïîäðîáíî êîìàíäû ìåíþ îïèñàíû â ñïðàâî÷íèêàõ [5, 15] è âî âñòðîåííîì ñïðàâî÷íèêå ïî ðàáîòå ñ MathCAD. 2.1. Ìåíþ File (Ôàéë) Ïîñëå ùåë÷êà ëåâîé êíîïêîé ìûøè ïî ïóíêòó File ãëàâíîãî ìåíþ áóäóò âûâåäåíû ñëåäóþùèå êîìàíäû (ðèñ. 2.1.): · New (Íîâûé) îòêðûòü îêíî äëÿ ñîçäàíèÿ íîâîãî Mathäîêóìåíòà;
Ðèñ. 2.1. Ìåíþ File
9
· Open (Îòêðûòü) îòêðûòü ñóùåñòâóþùèé Math-äîêóìåíò; · Close (Çàêðûòü) çàêðûòü òåêóùèé äîêóìåíò; · Save (Ñîõðàíèòü) ñîõðàíèòü íà äèñêå òåêóùèé äîêóìåíò. Åñëè ñîõðàíåíèå ïðîèçâîäèòñÿ âïåðâûå, ñëåäóåò óêàçàòü èìÿ ôàéëà; · Save as... (Ñîõðàíèòü êàê) ñîõðàíèòü íà äèñêå òåêóùèé äîêóìåíò ñ íîâûì èìåíåì. Ïàêåò ïîçâîëÿåò ñîõðàíèòü äîêóìåíò â ôîðìàòàõ MathCAD 8, 7, 6 è åùå â òðåõ ôîðìàòàõ, ïîìèìî ñòàíäàðòíîãî ôîðìàòà ïàêåòà ñ ðàñøèðåíèåì .mcd; · Send... (Îòïðàâèòü) îòïðàâèòü äîêóìåíò ïî ýëåêòðîííîé ïî÷òå; · Page Setup... (Ïàðàìåòðû ñòðàíèöû) îòêðûòü äèàëîãîâîå îêíî äëÿ óñòàíîâêè ïàðàìåòðîâ ñòðàíèöû; · Print Preview... (Ïðåäâàðèòåëüíûé ïðîñìîòð) ïðåäâàðèòåëüíûé ïðîñìîòð äîêóìåíòà ïåðåä ïå÷àòüþ; · Print... (Ïå÷àòü) ïå÷àòü äîêóìåíòà; · Exit (Âûõîä) çàâåðøèòü ðàáîòó ñ ïàêåòîì MathCAD. Ïåðåä ýòîé êîìàíäîé ìîæåò ïðèñóòñòâîâàòü ïåðå÷åíü èç íåñêîëüêèõ ôàéëîâ, ñ êîòîðûìè ðàáîòàëè â ïîñëåäíåå âðåìÿ, ÷òî ïîçâîëÿåò çàãðóçèòü ëþáîé èç íèõ áåç ïðåäâàðèòåëüíîãî ïîèñêà.  ïóíêòå ìåíþ File, êàê è â äðóãèõ ïóíêòàõ ìåíþ, ïîìèìî êîìàíä, ñëåâà îò êîìàíäû óêàçàíà êíîïêà ýòîé êîìàíäû â ïàíåëè èíñòðóìåíòîâ, åñëè îíà åñòü, à ñïðàâà êîìáèíàöèÿ êëàâèø, êîòîðàÿ ïîçâîëÿåò çàïóñòèòü ýòó êîìàíäó íà âûïîëíåíèå áåç âûçîâà ñîîòâåòñòâóþùåãî ðåæèìà ãëàâíîãî ìåíþ. Íåêîòîðûå ñòðîêè ïóíêòà ìåíþ File, êàê è â äðóãèõ ïóíêòàõ ìåíþ, èìåþò ïîñëå èìåíè êîìàíäû çíàê ... (ìíîãîòî÷èå). Îí îçíà÷àåò, ÷òî äàííàÿ êîìàíäà èìååò äèàëîãîâîå îêíî, êîòîðîå ïîÿâèòñÿ íà ýêðàíå ïîñëå âûçîâà êîìàíäû ùåë÷êîì ëåâîé êíîïêè ìûøè. 2.2. Ìåíþ Edit (Ïðàâêà) Áîëüøèíñòâî êîìàíä ýòîãî ïóíêòà ìåíþ ìîæíî èñïîëüçîâàòü, êîãäà â äîêóìåíòå âûäåëåíà îäíà èëè íåñêîëüêî îáëàñòåé. Ïîä îáëàñòüþ â äîêóìåíòå ïîäðàçóìåâàåòñÿ òåêñòîâàÿ 10
îáëàñòü, ãðàôè÷åñêèé îáúåêò, ìàòåìàòè÷åñêîå âûðàæåíèå (ôîðìóëà). Äëÿ âûäåëåíèÿ îáëàñòè â äîêóìåíòå ñëåäóåò ùåëêíóòü ëåâîé êíîïêîé ìûøè â ëåâîì âåðõíåì óãëó îáëàñòè è, óäåðæèâàÿ ëåâóþ êíîïêó ìûøè, ïåðåìåñòèòü êóðñîð ìûøè â ïðàâûé íèæíèé óãîë îáëàñòè. Çàòåì îòïóñòèòü êíîïêó ìûøè.  ðåçóëüòàòå îáëàñòü áóäåò çàêëþ÷åíà â ðàìêó, åñëè âûäåëåíà îäíà îáëàñòü, è â ïóíêòèðíóþ ðàìêó, åñëè â íåé íàõîäÿòñÿ íåñêîëüêî îáëàñòåé (ðèñ. 2.2).  ïóíêòå ìåíþ Edit ïðèñóòñòâóþò ñëåäóþùèå êîìàíäû (ðèñ. 2.2): · Undo (Îòìåíèòü èçìåíåíèÿ) îòìåíèòü ïîñëåäíþþ îïåðàöèþ ðåäàêòèðîâàíèÿ; · Redo (Ïîâòîðèòü) ïîâòîðèòü ïîñëåäíþþ îïåðàöèþ ðåäàêòèðîâàíèÿ; · Cut (Âûðåçàòü) ïåðåìåñòèòü âûäåëåííóþ îáëàñòü â áóôåð îáìåíà (Clipboard);
Ðèñ. 2.2. Ìåíþ Edit
11
· Copy (Êîïèðîâàòü) êîïèðîâàòü âûäåëåííóþ îáëàñòü â áóôåð îáìåíà, ïðè ýòîì âûäåëåííàÿ îáëàñòü íå óäàëÿåòñÿ èç îêíà ðåäàêòèðîâàíèÿ; · Paste (Âñòàâèòü) âñòàâèòü ñîäåðæèìîå áóôåðà îáìåíà â äîêóìåíò, íà÷èíàÿ ñ ïîçèöèè, â êîòîðîé óñòàíîâëåí êóðñîð; · Paste Special... (Ñïåöèàëüíàÿ âñòàâêà) âñòàâèòü â äîêóìåíò îáúåêòû, ñîçäàííûå â äðóãèõ ïðèëîæåíèÿõ. Íàïðèìåð, ìîæíî ñîçäàòü ðèñóíîê â ãðàôè÷åñêîì ðåäàêòîðå PaintBrush, ñêîïèðîâàòü åãî â áóôåð îáìåíà è âñòàâèòü â äîêóìåíò; · Delete (Óäàëèòü) óäàëèòü âûäåëåííóþ îáëàñòü, ïðè ýòîì äàííàÿ îáëàñòü â áóôåðå îáìåíà íå ñîõðàíÿåòñÿ. Óäàëåííóþ îáëàñòü íåâîçìîæíî âîññòàíîâèòü êîìàíäîé Undo; · Select All (Âûäåëèòü âñå) âûäåëèòü âñå îáëàñòè äîêóìåíòà ïóíêòèðíûì ïðÿìîóãîëüíèêîì; · Find... (Íàéòè) íàéòè çàäàííóþ òåêñòîâóþ èëè ìàòåìàòè÷åñêóþ ñòðîêó â äîêóìåíòå; · Replace... (Çàìåíèòü) íàéòè è çàìåíèòü òåêñòîâóþ èëè ìàòåìàòè÷åñêóþ ñòðîêó; · Go to Page... (Ïåðåéòè ê ñòðàíèöå) îñóùåñòâèòü ïåðåõîä íà ïåðâóþ, ïîñëåäíþþ èëè ñòðàíèöó ñ çàäàííûì íîìåðîì; · Check Speling... (Ïðîâåðêà îðôîãðàôèè) ïðîâåðèòü îðôîãðàôèþ (äëÿ àíãëîÿçû÷íûõ òåêñòîâ); · Links... (Ñâÿçè) ðàáîòà ñî âñòðîåííûìè ôàéëàìè, êîòîðûå áûëè âñòàâëåíû â äîêóìåíò ñ ïîìîùüþ êîìàíäû Paste Special ëèáî êîìàíäû Object (Îáúåêò) ìåíþ Insert (Âñòàâêà); · Object (Îáúåêò) ðåäàêòèðîâàòü âñòàâëåííûé â äîêóìåíò îáúåêò. Çäåñü íàäî îòìåòèòü î÷åðåäíîé êàçóñ ñîâìåñòíîé ðàáîòû àíãëîÿçû÷íîãî MathCAD ñ ðóññêîÿçû÷íîé îïåðàöèîííîé ñèñòåìîé Windows 95: ïîñëåäíÿÿ ïîçèöèÿ Object â ïîäìåíþ Edit çàïèñàíà íà ðóññêîì ÿçûêå! 2.3. Ìåíþ View (Âèä) Ýòîò ïóíêò ìåíþ ñîäåðæèò êîìàíäû íàñòðîéêè îêíà MathCAD (ðèñ. 2.3): 12
· Toolbars (Ïàíåëè èíñòðóìåíòîâ) âêëþ÷àåò / âûêëþ÷àåò îòîáðàæåíèå íà ýêðàíå ïàíåëè èíñòðóìåíòîâ Ñòàíäàðòíàÿ (Standard), ïàíåëè èíñòðóìåíòîâ Ôîðìàòèðîâàíèå (Formatting) è ìàòåìàòè÷åñêîé ïàíåëè (Math), à òàêæå ïàíåëåé: Calculator (Ââîä àðèôìåòè÷åñêèõ îïåðàöèé è íåêîòîðûõ ÷àñòî èñïîëüçóåìûõ ôóíêöèé), Graph (Ïîñòðîåíèå äâóõ- è òðåõìåðíûõ ãðàôèêîâ); Matrix (Ââîä è îáðàáîòêà âåêòîðîâ è ìàòðèö), Evaluation (Çàäàíèå îïåðàòîðîâ ïðèñâàèâàíèÿ); Calculus (Âû÷èñëåíèå ïðîèçâîäíûõ è ïåðâîîáðàçíûõ, ñóìì è ïðîèçâåäåíèé); Boolean (Çàäàíèå ëîãè÷åñêèõ îïåðàòîðîâ ñðàâíåíèÿ); Programming (Ïðîãðàììèðîâàíèå); Greek (Ââîä ãðå÷åñêèõ áóêâ); Symbolic (Çàäàíèå êëþ÷åâûõ ñëîâ, êîòîðûå ïðåäïèñûâàþò MathCAD ïðîèçâåñòè òîò èëè èíîé âèä ñèìâîëüíûõ âû÷èñëåíèé); Modifier (Äîïîëíèòåëüíûå óñòàíîâêè ñèìâîëüíûõ ïðåîáðàçîâàíèé), âõîäÿùèõ â ïàíåëü Math; · Status Bar (Ïàíåëü ñîñòîÿíèÿ) âêëþ÷èòü / âûêëþ÷èòü îòîáðàæåíèå íà ýêðàíå ñòðîêè ñîñòîÿíèÿ îêíà ïàêåòà, êîòîðàÿ íàõîäèòñÿ â íèæíåé ÷àñòè îêíà;
Ðèñ. 2.3. Ìåíþ View
· Ruler (Ëèíåéêà) âêëþ÷èòü / âûêëþ÷èòü îòîáðàæåíèå ãîðèçîíòàëüíîé ëèíåéêè äëÿ òî÷íîãî ðàçìåùåíèÿ îáúåêòîâ íà ñòðàíèöå; 13
· Regions (Îáëàñòè) âûäåëèòü áåëûì öâåòîì âñå îáëàñòè â äîêóìåíòå è îáåñïå÷èòü çàêðàñêó ïðîìåæóòêîâ ìåæäó íèìè ñåðûì öâåòîì. Êîìàíäà ïîëåçíà äëÿ îïðåäåëåíèÿ âçàèìíîãî ðàñïîëîæåíèÿ îáëàñòåé â äîêóìåíòå; · Zoom (Ìàñøòàá) èçìåíèòü ìàñøòàá èçîáðàæåíèÿ ðàáî÷åãî äîêóìåíòà íà ýêðàíå. Êîìàíäà âûâîäèò äèàëîãîâîå îêíî Zoom äëÿ âûáîðà ìàñøòàáà; · Refresh (Îáíîâèòü) îáíîâèòü ñîäåðæàíèå ýêðàíà. Ïðè ðåäàêòèðîâàíèè è ïåðåìåùåíèè îáëàñòåé â äîêóìåíòå ìîãóò îñòàâàòüñÿ èñêàæåíèÿ. Ýòà êîìàíäà ñòðîèò èçîáðàæåíèå íà ýêðàíå è óñòðàíÿåò íåäîñòàòêè; · Animate (Àíèìàöèÿ) ñîçäàòü àíèìàöèþ (îæèâëåíèå) ãðàôèêîâ. Ñ ïîìîùüþ ýòîé êîìàíäû ìîæíî, íàïðèìåð, èññëåäîâàòü çàâèñèìîñòü ïîâåäåíèÿ ôóíêöèè îò çàäàâàåìîãî ïàðàìåòðà; · Playback (Âîñïðîèçâåäåíèå) âîñïðîèçâåñòè àíèìàöèþ; · Preferences (Ïðåäâàðèòåëüíûå óñòàíîâêè) óñòàíîâêà ñëåäóþùèõ ðåæèìîâ ðàáîòû MathCAD: àâòîìàòè÷åñêèé ïîêàç Tip of the Day (Ñîâåòû äíÿ), Resource Center (Öåíòð ðåñóðñîâ) ïðè çàïóñêå ïàêåòà, óñòàíîâêà ñòàíäàðòíîé äëÿ Windows ðàñêëàäêè «ãîðÿ÷èõ» êëàâèø; ïàðàìåòðû íàñòðîéêè ïîäêëþ÷åíèÿ Internet. 2.4. Ìåíþ Insert (Âñòàâêà)  MathCAD ðåàëèçîâàíû ðàçëè÷íûå ìåõàíèçìû ïîìåùåíèÿ â Math-äîêóìåíò ìàòðèö, âñòðîåííûõ ôóíêöèé, òåêñòîâûõ è ãðàôè÷åñêèõ îáëàñòåé, ðèñóíêîâ, ñâÿçàííûõ îáúåêòîâ, ÷òî ïîçâîëÿåò ðåäàêòèðîâàòü èõ â ñàìîì Math-äîêóìåíòå. Êîìàíäû ýòîãî ìåíþ (ðèñ. 2.4): · Graph (Ãðàôèêè) ïîñòðîåíèå ðàçëè÷íûõ ãðàôèêîâ. Äëÿ ïîñòðîåíèÿ ãðàôèêîâ â ïàêåòå èìååòñÿ ãðàôè÷åñêèé ïðîöåññîð, äëÿ ïîñòðîåíèÿ ãðàôèêîâ ìîæíî èñïîëüçîâàòü øàáëîíû, ïåðå÷åíü êîòîðûõ ïðèâåäåí íà ðèñ. 2.4: X-Y Plot (Ãðàôèê â äåêàðòîâûõ êîîðäèíàòàõ) ñîçäàòü øàáëîí äëÿ ïîñòðîåíèÿ äâóõìåðíîãî ãðàôèêà â äåêàðòîâîé ñèñòåìå êîîðäèíàò; Polar Plot (Ãðàôèê â ïîëÿðíûõ êîîðäèíàòàõ) ñîçäàòü øàáëîí äëÿ ïîñòðîåíèÿ äâóõìåðíîãî ãðàôèêà â ïîëÿðíûõ êîîðäèíàòàõ; 14
3D Plot Wizard (Ìàñòåð òðåõìåðíûõ ãðàôèêîâ) âûçîâ ìàñòåðà äëÿ ïîñòðîåíèÿ òðåõìåðíûõ ãðàôèêîâ; Surface Plot (Ãðàôèê ïîâåðõíîñòè) ñîçäàòü øàáëîí äëÿ ïîñòðîåíèÿ ïîâåðõíîñòè â òðåõìåðíîì ïðîñòðàíñòâå; Contour Plot (Êàðòà ëèíèé óðîâíÿ) ñîçäàòü øàáëîí äëÿ êîíòóðíîãî ãðàôèêà òðåõìåðíîé ïîâåðõíîñòè; 3D Scatter Plot (Òî÷å÷íûé ãðàôèê) ñîçäàòü øàáëîí äëÿ òðåõìåðíîãî ãðàôèêà â âèäå òî÷åê; 3D Bar Plot (Òðåõìåðíàÿ ãèñòîãðàììà) ñîçäàòü øàáëîí äëÿ èçîáðàæåíèÿ äàííûõ â âèäå ñîâîêóïíîñòè ñòîëáèêîâ â òðåõìåðíîì ïðîñòðàíñòâå; Vector Field Plot (Âåêòîðíîå ïîëå) ñîçäàòü øàáëîí äëÿ îòîáðàæåíèÿ âåêòîðíîãî ïîëÿ íà ïëîñêîñòè; · Matrix (Ìàòðèöû) ñîçäàíèå ìàòðèöû (âåêòîðà) èëè èçìåíåíèå ðàçìåðà ìàòðèöû (âåêòîðà). Îãðàíè÷åíèå â ýòîé êîìàíäå â ìàññèâå ìîæåò áûòü íå áîëåå 100 ýëåìåíòîâ (10 ñòðîê è/èëè 10 ñòîëáöîâ) ( MathCAD ïîçâîëÿåò ðàáîòàòü ñ ìàòðèöàìè, ñîäåðæàùèìè äî 8 ìèëëèîíîâ ýëåìåíòîâ, åñëè õâàòàåò ïàìÿòè êîìïüþòåðà); · Function (Âñòàâèòü ôóíêöèþ) îòêðûâàåòñÿ äèàëîãîâîå îêíî ñ ïåðå÷íåì èìåþùèõñÿ âñòðîåííûõ ôóíêöèé;
Ðèñ. 2.4. Ìåíþ Insert
15
· Unit (Åäèíèöû) âñòàâèòü åäèíèöó èçìåðåíèÿ ðàçëè÷íûõ âåëè÷èí; · Picture (Ðèñóíîê) âñòàâèòü â äîêóìåíò ãðàôè÷åñêèé ôàéë ñ ðàñøèðåíèåì .bmp èç äðóãèõ ïðèëîæåíèé. Ïî ýòîé êîìàíäå ïîÿâèòñÿ çíà÷îê ðèñóíêà ñ ìàëåíüêèì ïîëåì ââîäà â ëåâîì íèæíåì óãëó, â êîòîðîì ñëåäóåò çàäàòü èìÿ ôàéëà. Èìïîðòèðîâàòü ôàéëû â äîêóìåíò ìîæíî è ÷åðåç áóôåð îáìåíà; · Area (Îáëàñòü) âñòàâèòü â MathCAD-äîêóìåíò ãðàíèöû íà÷àëà è êîíöà îáëàñòè, ê êîòîðîé ìîãóò áûòü ïðèìåíåíû êîìàíäû çàùèòû è çàêðûòèÿ, ðàñïîëîæåííûå â ìåíþ Format; · Math Region (Ìàòåìàòè÷åñêàÿ îáëàñòü) âñòàâèòü â òåêñòîâóþ îáëàñòü ìàòåìàòè÷åñêèå ôîðìóëû; · Text Region (Òåêñòîâàÿ îáëàñòü) âñòàâèòü â äîêóìåíò òåêñòîâûå êîììåíòàðèè (òåêñòîâóþ îáëàñòü); · Page Break (Ðàçìåòêà ñòðàíèö) âñòàâèòü â äîêóìåíò ïðèíóäèòåëüíûé ðàçðûâ ñòðàíèöû, êîòîðûé èçîáðàæàåòñÿ â âèäå ñïëîøíîé ëèíèè; · Hiperlink (Ãèïåðñâÿçü) âñòàâèòü â äîêóìåíò ãèïåðññûëêó äëÿ ñîçäàíèÿ îáó÷àþùèõ ïðîãðàìì è ñïðàâî÷íûõ ñèñòåì. Äëÿ ñîçäàíèÿ ãèïåðññûëêè íóæíî ñîçäàòü òåêñòîâóþ îáëàñòü, âûäåëèòü â íåé íåêîòîðóþ îáëàñòü, çàòåì âûïîëíèòü êîìàíäó Hiperlink. Ïîÿâèòñÿ äèàëîãîâîå îêíî Insert Hiperlink (ðèñ. 2.5), â êîòîðîì ñëåäóåò çàäàòü íåîáõîäèìûå ïàðàìåòðû: Ïîñòðîèòü ãðàôèê â äåêàðòîâîé ñèñòåìå êîîðäèíàò
Ðèñ. 2.5. Ñîçäàíèå ãèïåðññûëêè
16
 âåðõíåì ïîëå ââîäà óêàçûâàåòñÿ èìÿ ôàéëà. Åñëè òî÷íîå èìÿ ôàéëà íåèçâåñòíî, ùåë÷êîì ïî êíîïêå Browse âûçûâàåì îêíî äëÿ ïîèñêà íóæíîãî ôàéëà.  íèæíåå ïîëå ââîäà ìîæíî ââåñòè ñîîáùåíèå, êîòîðîå áóäåò ïîÿâëÿòüñÿ â ñòðîêå ñîñòîÿíèÿ ïðè ïîìåùåíèè óêàçàòåëÿ ìûøè íà ãèïåðññûëêó. Ïðè óñòàíîâêå ôëàæêà Display as pop-up document âûçûâàåìûé äîêóìåíò âûâîäèòñÿ âíóòðè èñõîäíîãî, â ïðîòèâíîì ñëó÷àå îí çàìåíÿåò èñõîäíûé; · Reference (Ññûëêà) îáðàùåíèå ê çàäàííîìó ôàéëó ïóòåì ñîçäàíèÿ ñâÿçàííîãî ñ íèì ãðàôè÷åñêîãî îáúåêòà êíîïêè ñî ñòðåëêîé è èìåíåì ôàéëà:
· Component (Êîìïîíåíòà) âñòàâêà â äîêóìåíò ñ ïîìîùüþ Component Wizard (Ìàñòåð êîìïîíåíò) íîâûõ êîìïîíåíò (ìîäóëåé), êîòîðûå ïåðå÷èñëåíû â äèàëîãîâîì îêíå (ðèñ. 2.6):
Ðèñ. 2.6. Îêíî Component Wizard (Ìàñòåð êîìïîíåíò)
· Object (Îáúåêò) âñòàâêà â äîêóìåíò ðàçëè÷íûõ îáúåêòîâ èç äðóãèõ Windows-ïðèëîæåíèé. Ýòà êîìàíäà âûâîäèò îêíî ñ ïåðå÷èñëåíèåì ïðèëîæåíèé, ñ êîòîðûìè îñóùåñòâëÿåòñÿ îáúåêòíàÿ ñâÿçü. 17
2.5. Ìåíþ Format (Ôîðìàò) Ïîëüçîâàòåëüñêèé èíòåðôåéñ MathCAD îðèåíòèðîâàí íà èíòåðôåéñ Windows-ïðèëîæåíèé, è âñå êîìàíäû, ïðåäíàçíà÷åííûå äëÿ çàäàíèÿ ïàðàìåòðîâ, îïðåäåëÿþùèõ âíåøíåå ïðåäñòàâëåíèå ÷èñåë, ôîðìóë, àáçàöåâ, êîëîíòèòóëîâ è ò.ä., îáúåäèíåíû â ïóíêòå Format ãëàâíîãî ìåíþ (ðèñ. 2.7): · Equation (Óðàâíåíèÿ) çàäàòü äëÿ ïåðåìåííûõ, ÷èñåë è äðóãèõ ñèìâîëîâ â ìàòåìàòè÷åñêèõ âûðàæåíèÿõ ïàðàìåòðû øðèôòà, ðàçìåðà è íà÷åðòàíèÿ. Ýòà êîìàíäà âûâîäèò äèàëîãîâîå îêíî Equation Format (Ôîðìàò óðàâíåíèÿ) (ðèñ. 2.8), êîòîðîå ïîçâîëÿåò âûáðàòü îáúåêò â ìàòåìàòè÷åñêèõ âûðàæåíèÿõ: ïåðåìåííûå (Variables), êîíñòàíòû (Constants) è îáúåêòû ïîëüçîâàòåëÿ (User N, N íîìåð ãðóïïû îò 1 äî 7). Êíîïêà Modify (Èçìåíèòü) â äèàëîãîâîì îêíå îáåñïå÷èâàåò çàäàíèå íóæíîãî øðèôòà, íà÷åðòàíèÿ, ðàçìåðà è öâåòà (ðèñ. 2.9);
Ðèñ. 2.7. Ìåíþ Format
18
Ðèñ. 2.8. Îêíî Equation Format
· Result (Ðåçóëüòàò) çàäàòü ðåçóëüòàòû âû÷èñëåíèé â îïðåäåëåííîì ôîðìàòå. Ýòà êîìàíäà âûâîäèò äèàëîãîâîå îêíî Result Format (Ôîðìàò ðåçóëüòàòà), â êîòîðîì èìåþòñÿ ÷åòûðå âêëàäêè: Number Format (Ôîðìàò ÷èñåë), Display Options (Ïàðàìåòðû îòîáðàæåíèÿ), Unit Display (Åäèíèöû îòîáðàæåíèÿ), Tolerance (Äîïóñê). Íà âêëàäêå Number Format (ðèñ. 2.10) çàäàþò ïàðàìåòðû ôîðìàòà ïðåäñòàâëåíèÿ ÷èñåë: General (Îáùèé), Decimal (Äåñÿòè÷íûé), Scientific (Íàó÷íûé), Engineering (Èíæåíåðíûé). Ïîëå Number of decimal places (Òî÷íîñòü îòîáðàæåíèÿ äåñÿòè÷íûõ ïîçèöèé) çàäàåò â äåñÿòè÷íûõ ÷èñëàõ êîëè÷åñòâî îòîáðàæàåìûõ çíàêîâ ïîñëå çàïÿòîé. Ïîëå Exponential threshold (Ýêñïîíåíöèàëüíûé ïîðîã) çàäàåò ïîêàçàòåëü ñòåïåíè 10, ïî äîñòèæåíèè êîòîðîãî ÷èñëî ïðåäñòàâëÿåòñÿ íà ýêðàíå â ýêñïîíåíöèàëüíîé ôîðìå: 1.045*10. Îïöèÿ Show trailing zeros (Ïîêàçàòü êîíå÷íûå íóëè). Íà âêëàäêå Display Options ìîæíî âûáðàòü ñèñòåìó ñ÷èñëåíèÿ Radix (Ñèñòåìà): Decimal (Äåñÿòè÷íàÿ), Binary (Äâîè÷íàÿ), Hexadecimal (øåñòíàäöàòåðè÷íàÿ), Octal (Âîñüìåðè÷íàÿ). Âêëàäêà Unit Display èñïîëüçóåòñÿ ïðè ðàáîòå ñ âåëè÷èíàìè, èìåþùèìè ðàçìåðíîñòü. Âêëàäêà Tolerance ñîäåðæèò ïîëÿ: Complex threshold (Êîìïëåêñíûé ïîðîã), Zero threshold (Íóëåâîé ïîðîã). 19
Ðèñ. 2.9. Îêíî äëÿ çàäàíèÿ øðèôòà, ðàçìåðà, íà÷åðòàíèÿ, öâåòà
Ðèñ. 2.10. Îêíî Number Format
· Text (Òåêñò) çàäàòü äëÿ âûäåëåííîãî òåêñòîâîãî ôðàãìåíòà â òåêñòîâîé îáëàñòè îïðåäåëåííûé øðèôò, åãî ðàçìåð è íà÷åðòàíèå. Ïðè âûáîðå ýòîé êîìàíäû ïîÿâëÿåòñÿ äèàëîãîâîå îêíî Text Format (Ôîðìàò òåêñòà) (ðèñ. 2.11). 20
Ðèñ. 2.11. Îêíî Text Format (Ôîðìàò òåêñòà)
Îíî ñîäåðæèò òðè ñïèñêà: Font (Øðèôò) ñïèñîê øðèôòîâ; Font Style (Ñòèëü) ñïèñîê íà÷åðòàíèÿ øðèôòîâ; Size (Ðàçìåð) ñïèñîê ðàçìåðîâ øðèôòîâ. Èìååòñÿ ðÿä ôëàæêîâ â ãðóïïå Effects (Ýôôåêòû): Strikeout (Çà÷åðêíóòûé) ïåðå÷åðêíóòûå ïîñåðåäèíå ñèìâîëû; Underline (Ïîä÷åðêíóòûé) ïîä÷åðêíóòûå ñíèçó ñèìâîëû; Subscript (Ïîäñòðî÷íûé) íèæíèé èíäåêñ; Superscript (Íàäñòðî÷íûé) âåðõíèé èíäåêñ.  ðàñêðûâàþùåìñÿ ñïèñêå Color (Öâåò) ìîæíî âûáðàòü íóæíûé öâåò äëÿ âûäåëåííîãî òåêñòîâîãî ôðàãìåíòà. Ïîëå Sample (Îáðàçåö) îòîáðàæàåò ðåçóëüòàòû ïðèìåíåíèÿ óñòàíîâëåííûõ ïàðàìåòðîâ. Êíîïêà OK äèàëîãîâîãî îêíà çàôèêñèðóåò, à êíîïêà Cancel îòìåíèò ñäåëàííûé âûáîð. · Paragraph (Àáçàö) ôîðìàòèðîâàòü àáçàö â òåêñòîâîì áëîêå. Ýòà êîìàíäà âûâîäèò äèàëîãîâîå îêíî Paragraph Format (Ôîðìàò àáçàöà).  ãðóïïå Indent (Îòñòóïû) ìîæíî çàäàòü 21
îòñòóïû.  ãðóïïå Alignment (Âûðàâíèâàíèå) ìîæíî âûáðàòü âèä âûðàâíèâàíèÿ, â ðàñêðûâàþùåìñÿ ñïèñêå Bullets ôîðìàòèðîâàíèå òåêñòîâûõ ñòðîê. · Tabs (Òàáóëÿöèÿ) çàäàòü ÷èñëî ïîçèöèé, íà êîòîðîå ïåðåìåùàåòñÿ òåêñòîâûé êóðñîð ñ ïîìîùüþ êëàâèøè Tab. · Style (Ñòèëü) óñòàíîâèòü ñòèëü äëÿ òåêñòîâûõ îáúåêòîâ. Ïîä ñòèëåì òåêñòîâîãî îáúåêòà ïîíèìàåòñÿ ñîâîêóïíîñòü ïàðàìåòðîâ øðèôòà çàãîëîâêîâ è îñíîâíîãî òåêñòà, à òàêæå ñïîñîáû âçàèìíîãî ðàñïîëîæåíèÿ ýëåìåíòîâ òåêñòà. · Properties (Ñâîéñòâà) çàäàòü öâåòîâîé ôîí äëÿ âûäåëåííîãî âûðàæåíèÿ è çàêëþ÷èòü åãî â ðàìêó. Âêëþ÷èòü îïöèþ, ïîçâîëÿþùóþ èãíîðèðîâàòü äàííîå âûðàæåíèå ïðè âû÷èñëåíèÿõ. · Graph (Ôîðìàò ãðàôèêà) èçìåíèòü ôîðìàò ïîñòðîåííûõ ãðàôèêîâ. Ýòî ïîäìåíþ ñîäåðæèò ñëåäóþùèå êîìàíäû: X-Y Plot (Ôîðìàò äâóõìåðíîãî ãðàôèêà) èçìåíèòü ãðàôèê â äåêàðòîâûõ êîîðäèíàòàõ; Polar Plot (Ôîðìàò ïîëÿðíîãî ãðàôèêà) èçìåíèòü ãðàôèê â ïîëÿðíûõ êîîðäèíàòàõ; 3D Plot (Ôîðìàò òðåõìåðíîãî ãðàôèêà) èçìåíèòü òðåõìåðíûé ãðàôèê; Trace (Òðàññèðîâêà) ÷òåíèå êîîðäèíàò íàïðÿìóþ èç âûäåëåííîãî ãðàôèêà (ðèñ. 2.12); Zoom... (Óâåëè÷åíèå...) óâåëè÷åííûé ïðîñìîòð ÷àñòè âûäåëåííîãî ãðàôèêà. · Color (Öâåò) èçìåíèòü öâåò. Ýòî ïîäìåíþ ñîäåðæèò ñëåäóþùèå êîìàíäû: Background... (Ôîí...) âûáîð öâåòà ôîíà äëÿ âñåãî äîêóìåíòà;
Ðèñ. 2.12. ×òåíèå êîîðäèíàòû èç ãðàôèêà
22
Highlight... (Ïîäñâåòêà...) èçìåíèòü öâåò ïîäñâåòêè âûðàæåíèÿ (ïðè âûáîðå Format/Properties/Highlight Region); Annotation... (Êîììåíòàðèé...) óñòàíîâèòü öâåò ïîäñâåòêè, ïîÿâëÿþùåéñÿ ïðè ðåäàêòèðîâàíèè ýëåêòðîííîé êíèãè; Use Default Palette (Ïàëèòðà ïî óìîë÷àíèþ...) èñïîëüçîâàòü öâåòà ïî óìîë÷àíèþ; Optimize Palette (Îïòèìèçèðîâàòü ïàëèòðó...) èñïîëüçîâàòü îïòèìàëüíîå ñî÷åòàíèå öâåòîâ äëÿ äàííîé ñèñòåìû. · Separate Regions (Ðàçäåëèòü îáëàñòè) àâòîìàòè÷åñêè ðàçäåëÿòü ïåðåêðûâàþùèåñÿ îáëàñòè â äîêóìåíòå. · Align Regions... (Âûðàâíèâàíèå ðåãèîíà...) âûðîâíÿòü âûäåëåííûå îáëàñòè. Ýòî ïîäìåíþ èìååò êîìàíäû: Across (Ãîðèçîíòàëüíî) âûðîâíÿòü ïî ãîðèçîíòàëè, ïðîõîäÿùåé ìåæäó ñàìûì âåðõíèì è ñàìûì íèæíèì ðåãèîíàìè äîêóìåíòà; Down (Âåðòèêàëüíî) âûðîâíÿòü ïî âåðòèêàëè, ïðîõîäÿùåé ìåæäó ñàìûì ïðàâûì è ñàìûì ëåâûì ðåãèîíàìè äîêóìåíòà. · Area... (Îáëàñòü...) ñîçäàòü ñêðûòûå è çàêðûòûå îáëàñòè â äîêóìåíòå, ñîçäàííûå ïî êîìàíäå Insert/Area. Ýòî ïîäìåíþ èìååò êîìàíäû: Lock... (Çàêðûòü îáëàñòü...) çàùèòèòü îò ðåäàêòèðîâàíèÿ âûáðàííóþ îáëàñòü. Çàùèòà ìîæåò áûòü ñ ïàðîëåì è áåç ïàðîëÿ; Unlock... (Îòêðûòü îáëàñòü) ðàçðåøèòü ðåäàêòèðîâàíèå çàáëîêèðîâàííîé îáëàñòè; Collapse (Çàõëîïíóòü) çàõëîïíóòü òåêóùóþ îáëàñòü; Expand (Ðàñêðûòü) ðàñêðûòü çàõëîïíóòóþ îáëàñòü. · Header/Footers
(Êîëîíòèòóëû) âíåñåíèå íåêîòîðîé èíôîðìàöèè â êîëîíòèòóëû. Ïðè ïå÷àòè äîêóìåíòîâ èíîãäà òðåáóåòñÿ âíåñòè â çàãîëîâîê (Header) èëè â íèæíþþ ñòðîêó (Footers) êàæäîé ñòðàíèöû äîêóìåíòà íåêîòîðóþ èíôîðìàöèþ, íàïðèìåð, èìÿ òåêóùåãî ôàéëà, íîìåð ñòðàíèöû, òåêóùóþ äàòó è âðåìÿ, çàãîëîâîê ê ðàçìåùåííîé íà ñòðàíèöå èíôîðìàöèè. Òàêèå íàäïèñè íàçûâàþòñÿ êîëîíòèòóëàìè. · Repaginate Now (Ïåðåíóìåðàöèÿ ñòðàíèö) ðàçáèåíèå òåêóùåãî äîêóìåíòà íà ñòðàíèöû (ðàçðûâ ñòðàíèöû íå ïåðåñåêàåò ôîðìóëû). 23
2.6. Ìåíþ Math (Ìàòåìàòèêà) Äëÿ óïðàâëåíèÿ âû÷èñëèòåëüíûì ïðîöåññîì â MathCAD èìåþòñÿ ñëåäóþùèå êîìàíäû (ðèñ. 2.13):
Ðèñ. 2.13. Ìåíþ Math (Ìàòåìàòèêà)
· Calculate (Âû÷èñëèòü) ïðîâåñòè ðàñ÷åòû ïî ôîðìóëàì âèäèìîé ÷àñòè äîêóìåíòà; · Calculate Worksheet (Ïåðåñ÷èòàòü âñå) ïðîâåñòè ðàñ÷åòû ïî âñåì ôîðìóëàì MathCAD-äîêóìåíòà; · Automatic Calculation (Àâòîìàòè÷åñêîå âû÷èñëåíèå) óñòàíîâèòü ðåæèì àâòîìàòè÷åñêîãî âû÷èñëåíèÿ. Åñëè ýòîò ðåæèì âêëþ÷åí, òî ñëåâà îò èìåíè êîìàíäû ïðèñóòñòâóåò çíà÷îê «ãàëî÷êà» (ðèñ. 2.13); · Optimization (Îïòèìèçàöèÿ) ïåðåêëþ÷àòåëü ðåæèìà îïòèìèçàöèè ÷èñëåííûõ ðàñ÷åòîâ; · Options
(Ïàðàìåòðû) äèàëîãîâîå îêíî, ñîäåðæàùåå ñëåäóþùèå âêëàäêè (ðèñ. 2.14):
24
Ðèñ. 2.14. Ìåíþ Math Options (Îïöèè)
Built-In variables (Âñòðîåííûå âåëè÷èíû) èçìåíèòü çíà÷åíèÿ âñòðîåííûõ âåëè÷èí (ïðèëîæåíèå 1); Calculation (Âû÷èñëåíèå) ñîäåðæèò äâå êíîïêè, ïîçâîëÿþùèå âêëþ÷èòü / âûêëþ÷èòü ðåæèì àâòîìàòè÷åñêèõ âû÷èñëåíèé (Recalculate automatically) è îïòèìèçàöèþ âûðàæåíèé ïåðåä âû÷èñëåíèÿìè (Optimize expressions before calculating); Display Unit system (Ñèñòåìà åäèíèö...) èçìåíèòü ñèñòåìó åäèíèö èçìåðåíèÿ (ïî óìîë÷àíèþ çàäàíà Ìåæäóíàðîäíàÿ ñèñòåìà ÑÈ); Dimentions (Åäèíèöû èçìåðåíèÿ...) èçìåíèòü íàçâàíèå åäèíèö èçìåðåíèÿ. Íàïðèìåð, âû ìîæåòå ïåðåèìåíîâàòü êã (kg) â êèëîãðàìì (kilogram). 2.7. Ìåíþ Symbolics (Ñèìâîëû) Êîìàíäû äàííîãî ìåíþ èñïîëüçóþòñÿ äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ ìàòåìàòè÷åñêèõ âûðàæåíèé. Ïðè îòêðûòèè ýòîãî ìåíþ ÷àñòü êîìàíä ìîæåò áûòü íåäîñòóïíà. ×òîáû âîñïîëüçîâàòüñÿ ýòèìè êîìàíäàìè, íåîáõîäèìî ñíà÷àëà âûäåëèòü ïåðåìåííóþ èëè âûðàæåíèå, ïîäëåæàùåå îáðàáîòêå (ðèñ. 2.15). 25
Ðèñ. 2.15
Ïîäìåíþ Evaluate (Âû÷èñëèòü) èìååò ñëåäóþùèå êîìàíäû: · Symbolically (Âû÷èñëèòü â ñèìâîëàõ) ñëóæèò äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ èíòåãðàëîâ, àíàëèòè÷åñêîãî äèôôåðåíöèðîâàíèÿ, âû÷èñëåíèÿ ñóììû èëè ïðîèçâåäåíèÿ. Ïåðåä âûáîðîì äàííîé êîìàíäû íåîáõîäèìî ïîìåñòèòü ãîëóáîé êóðñîð íà âû÷èñëÿåìîå âûðàæåíèå; · Floating Point... (Ñ ïëàâàþùåé òî÷êîé
) ýòà êîìàíäà çàìåíÿåò êîíñòàíòû â ðåçóëüòàòàõ ñèìâîëüíûõ âû÷èñëåíèé ÷èñëåííûìè çíà÷åíèÿìè ñ çàäàííûì êîëè÷åñòâîì çíàêîâ ïîñëå çàïÿòîé; · Complex ( êîìïëåêñíîì âèäå) ïðåîáðàçîâàíèå âûðàæåíèÿ ê êîìïëåêñíîìó âèäó. Êîìàíäû: · Simplify (Óïðîñòèòü) óïðîñòèòü âûäåëåííîå âûðàæåíèå, âûïîëíÿÿ àðèôìåòè÷åñêèå äåéñòâèÿ, ñîêðàùàÿ ïîäîáíûå ñëàãàåìûå, ïðèâîäÿ ê îáùåìó çíàìåíàòåëþ è èñïîëüçóÿ îñíîâíûå òðèãîíîìåòðè÷åñêèå òîæäåñòâà; · Expand (Ðàçëîæèòü ïî ñòåïåíÿì) ïðåäñòàâèòü âûðàæåíèå â âèäå ñóììû îòäåëüíûõ ÷ëåíîâ; · Factor (Ðàçëîæèòü íà ìíîæèòåëè) ïðèâåñòè ïîäîáíûå ÷ëåíû è ðàçëîæèòü íà ìíîæèòåëè; · Collect (Ðàçëîæèòü ïî ïîäâûðàæåíèþ) óïîðÿäî÷èòü âûðàæåíèå ïî âûäåëåííîé ïåðåìåííîé èëè ôóíêöèè. Ðåçóëü26
òàòîì áóäåò âûðàæåíèå, ïîëèíîìèàëüíîå îòíîñèòåëüíî âûáðàííîãî âûðàæåíèÿ; · Polynomial Coefficients (Ïîëèíîìèàëüíûå êîýôôèöèåíòû) ñëóæèò äëÿ íàõîæäåíèÿ êîýôôèöèåíòîâ ïîëèíîìà. · Ïîäìåíþ Variable (Ïåðåìåííûå) èìååò ñëåäóþùèå êîìàíäû: · Solve (Ðåøèòü îòíîñèòåëüíî ïåðåìåííîé) ðåøåíèå óðàâíåíèÿ èëè íåðàâåíñòâà ñèìâîëüíî îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé; · Substitute (Çàìåíèòü ïåðåìåííóþ) çàìåíèòü âûäåëåííóþ ïåðåìåííóþ âî âñåì âûðàæåíèè ñîäåðæèìûì Áóôåðà îáìåíà. Äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû ïðåæäå ñëåäóåò ïîìåñòèòü â Áóôåð îáìåíà âûðàæåíèå, êîòîðîå áóäåò ïîäñòàâëåíî âìåñòî âûäåëåííîé ïåðåìåííîé. Çàòåì âûäåëÿþò ïåðåìåííóþ â êàêîì-ëèáî ìåñòå âûðàæåíèÿ è âûïîëíÿþò ýòó êîìàíäó; · Differentiate (Äèôôåðåíöèðîâàòü ïî ïåðåìåííîé) âû÷èñëÿòü ñèìâîëüíî ïðîèçâîäíóþ ïî âûäåëåííîé ïåðåìåííîé. Îñòàëüíûå ïåðåìåííûå â âûðàæåíèè ðàññìàòðèâàþòñÿ êàê êîíñòàíòû; · Integrate (Èíòåãðèðîâàòü ïî ïåðåìåííîé) íàõîæäåíèå íåîïðåäåëåííîãî èíòåãðàëà îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé, ïðè÷åì ïåðâîîáðàçíàÿ îòîáðàæàåòñÿ áåç ïðîèçâîëüíîé ïîñòîÿííîé; · Expand to Series... (Ðàçëîæèòü â ðÿä...) íàéòè íåñêîëüêî ÷ëåíîâ ðàçëîæåíèÿ âûðàæåíèÿ â ðÿä Òåéëîðà ïî âûäåëåííîé ïåðåìåííîé. Äèàëîãîâîå îêíî ïîçâîëÿåò âûáðàòü êîëè÷åñòâî ÷ëåíîâ ðàçëîæåíèÿ; · Convert to Partial Fraction (Ðàçëîæèòü íà ýëåìåíòàðíûå äðîáè) ðàçëîæèòü íà ýëåìåíòàðíûå äðîáè âûðàæåíèå, êîòîðîå ðàññìàòðèâàåòñÿ êàê ðàöèîíàëüíàÿ äðîáü îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ïîäìåíþ Matrix (Ìàòðè÷íûå îïåðàöèè) ñîäåðæèò êîìàíäû äëÿ ðàáîòû ñ ìàòðèöàìè: · Transpose (Òðàíñïîíèðîâàòü) íàéòè òðàíñïîíèðîâàííóþ ìàòðèöó äëÿ âûäåëåííîé ìàòðèöû; · Invert (Îáðàòèòü) íàéòè îáðàòíóþ ìàòðèöó äëÿ âûäåëåííîé ìàòðèöû; · Determinant (Îïðåäåëèòåëü) âû÷èñëèòü îïðåäåëèòåëü âûäåëåííîé ìàòðèöû. 27
Ïîäìåíþ Transform (Ïðåîáðàçîâàíèÿ) ñîäåðæèò ñëåäóþùèå êîìàíäû: · Fourier (Ïðåîáðàçîâàíèå Ôóðüå) âû÷èñëÿòü ïðåîáðàçîâàíèå Ôóðüå îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé; · Inverse Fourier (Îáðàòíîå ïðåîáðàçîâàíèå Ôóðüå) âû÷èñëèòü îáðàòíîå ïðåîáðàçîâàíèå Ôóðüå îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ðåçóëüòàò ôóíêöèÿ îò ïåðåìåííîé t; · Laplace (Ïðåîáðàçîâàíèå Ëàïëàñà) âû÷èñëèòü ïðåîáðàçîâàíèå Ëàïëàñà îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ðåçóëüòàò ôóíêöèÿ îò ïåðåìåííîé s; · Inverse Laplace (Îáðàòíîå ïðåîáðàçîâàíèå Ëàïëàñà) âû÷èñëèòü îáðàòíîå ïðåîáðàçîâàíèå Ëàïëàñà îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ðåçóëüòàò ôóíêöèÿ îò ïåðåìåííîé t; · Z (z-ïðåîáðàçîâàíèå) âû÷èñëèòü z-ïðåîáðàçîâàíèå âûðàæåíèÿ îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ðåçóëüòàò ôóíêöèÿ îò ïåðåìåííîé z; · Inverse Z (Îáðàòíîå z-ïðåîáðàçîâàíèå) âû÷èñëèòü îáðàòíîå z-ïðåîáðàçîâàíèå îòíîñèòåëüíî âûäåëåííîé ïåðåìåííîé. Ðåçóëüòàò ôóíêöèÿ îò ïåðåìåííîé n. Êîìàíäà Evaluation Style
(Ñòèëü ðåçóëüòàòà...) ïîçâîëÿåò âûáèðàòü ñïîñîá îòîáðàæåíèÿ ðåçóëüòàòà ñèìâîëüíîãî ïðåîáðàçîâàíèÿ, çàäàòü îòîáðàæåíèå êîììåíòàðèåâ, âåðòèêàëüíîå ëèáî ãîðèçîíòàëüíîå ðàçìåùåíèå ïî îòíîøåíèþ ê ïðåîáðàçóåìîìó âûðàæåíèþ.  ðåçóëüòàòå âûïîëíåíèÿ ýòîé êîìàíäû ïîÿâëÿåòñÿ äèàëîãîâîå îêíî Evaluation Style (Ñòèëü âû÷èñëåíèé) (ðèñ. 2.16).
Ðèñ. 2.16 . Äèàëîãîâîå îêíî Evaluation Style (Ñòèëü âû÷èñëåíèé)
28
Âûáîð ðåæèìà Vertically, inserting lines (Âåðòèêàëüíî, âñòàâêà ñòðîê) îáåñïå÷èâàåò âûâîä ðåçóëüòàòîâ âû÷èñëåíèé â íîâîé ñòðîêå, ÷òî ïîçâîëÿåò èçáåæàòü íàëîæåíèÿ îáëàñòåé. Ðåæèì Horizontally (Ãîðèçîíòàëüíî) ðàçìåùàåò ðåçóëüòàòû âû÷èñëåíèé ñïðàâà îò âû÷èñëÿåìîãî âûðàæåíèÿ. Ðåçóëüòàòû ñèìâîëüíûõ âû÷èñëåíèé ìîæíî ñíàáæàòü òåêñòîâûìè êîììåíòàðèÿìè. Íàïðèìåð, êîìàíäà Symbolically (Âû÷èñëèòü â ñèìâîëàõ) ïîäìåíþ Evaluate (Âû÷èñëèòü) äîáàâëÿåò êîììåíòàðèé yields (â èòîãå èìååì), à êîìàíäà Integrate (Èíòåãðèðîâàòü ïî ïåðåìåííîé) ïîäìåíþ Variable (Ïåðåìåííûå) äîáàâëÿåò êîììåíòàðèé by integration, yields (â ðåçóëüòàòå èíòåãðèðîâàíèÿ èìååì). Äëÿ îòîáðàæåíèÿ êîììåíòàðèÿ ñëåäóåò âêëþ÷èòü îïöèþ Show Comments (Ïîêàçàòü êîììåíòàðèè).  öåëÿõ óäîáî÷èòàåìîñòè äîêóìåíòà íå ñëåäóåò óñòàíàâëèâàòü îïöèþ Evaluate In Place (Âû÷èñëèòü íà ìåñòå). 2.8. Ìåíþ Window (Îêíî) MathCAD ïîçâîëÿåò îäíîâðåìåííî ðàáîòàòü ñ íåñêîëüêèìè äîêóìåíòàìè. Êàæäîìó äîêóìåíòó îòâîäèòñÿ ñîáñòâåííîå îêíî. Îêíî, ñ êîòîðûì ðàáîòàåò ïîëüçîâàòåëü, íàçûâàåòñÿ àêòèâíûì. Îêíà äðóãèõ äîêóìåíòîâ íå âèäíû, íî â íèõ ìîæíî ïåðåéòè â ëþáîé ìîìåíò.  ìåíþ Window ïðèâåäåíû êîìàíäû äëÿ ðàáîòû ñ îêíàìè (ðèñ. 2.17):
Ðèñ. 2.17. Îêíî ìåíþ Window
· Cascade (Êàñêàä) ðàñïîëîæèòü îêíà äîêóìåíòîâ äðóã çà äðóãîì òàê, ÷òîáû áûëè âèäíû çàãîëîâêè îêîí; · Tile Horizontal (Ïî ãîðèçîíòàëè) ðàñïîëîæèòü îêíà äîêóìåíòîâ ãîðèçîíòàëüíî òàê, ÷òîáû îíè íå ïåðåêðûâàëèñü; 29
· Tile Vertical (Ïî âåðòèêàëè) ðàñïîëîæèòü îêíà äîêóìåíòîâ âåðòèêàëüíî òàê, ÷òîáû îíè íå ïåðåêðûâàëèñü. Êðîìå òîãî, â ìåíþ Window èìååòñÿ ñïèñîê äîêóìåíòîâ, ñ êîòîðûìè ðàáîòàåò ïîëüçîâàòåëü, ÷òî ïîçâîëÿåò áûñòðî ïåðåéòè â îêíî çàäàííîãî äîêóìåíòà. 2.9. Ìåíþ Help (Ñïðàâêà)  ìåíþ Help (Ñïðàâêà) ðàñïîëîæåíû èíôîðìàöèîííûå ðåñóðñû MathCAD. Ìåíþ Help ñîäåðæèò ñëåäóþùèå êîìàíäû (ðèñ. 2.18): · Mathcad help (Òåõíè÷åñêàÿ ïîääåðæêà...) âûçâàòü ñïðàâî÷íóþ ñèñòåìó ïàêåòà; · Resource Center (Öåíòð ðåñóðñîâ) îòêðûòü äîñòóï ê öåíòðó èíôîðìàöèîííûõ ðåñóðñîâ, îáúåäèíÿþùåìó â ñåáå ñïðàâî÷íóþ ñèñòåìó, îáó÷àþùóþ ñèñòåìó, ìíîãî÷èñëåííûå ïðèìåðû, ïðåäîñòàâëÿþùåìó âûõîä â Internet; · Tip of the Day
(Ñîâåò äíÿ) âûçâàòü îïåðàòèâíóþ ïîäñêàçêó; · Open Book... (Îòêðûòü êíèãó...) îòêðûòü ýëåêòðîííóþ êíèãó;
Ðèñ. 2.18. Îêíî ìåíþ Help
· About MathCAD... (Î ïðîãðàììå...) âûâåñòè êðàòêóþ èíôîðìàöèþ î ìàòåìàòè÷åñêîé ñèñòåìå MathCAD.
30
3. Ïàíåëè èíñòðóìåíòîâ Standard (Ñòàíäàðòíàÿ) è Formatting (Ôîðìàòèðîâàíèå) Âñå ñîâðåìåííûå Windows-ïðèëîæåíèÿ èìåþò ñòàíäàðòíóþ ïàíåëü èíñòðóìåíòîâ, êîòîðàÿ ïîçâîëÿåò âûïîëíÿòü íàèáîëåå ÷àñòî èñïîëüçóåìûå êîìàíäû ùåë÷êîì ïî ñîîòâåòñòâóþùåé ïèêòîãðàììå (êíîïêå). Áëàãîäàðÿ ýòîìó ñòàíîâèòñÿ íåíóæíûì óòîìèòåëüíûé ïîèñê â ìåíþ íàèáîëåå ÷àñòî èñïîëüçóåìûõ êîìàíä, êîòîðûå ê òîìó æå ÷àñòî áûâàþò ïðåäñòàâëåíû íåÿâíî.  íåêîòîðûõ Windows-ïðèëîæåíèÿõ, íàïðèìåð, â Microsoft Word, ñóùåñòâóåò âîçìîæíîñòü äîïîëíÿòü ïàíåëü èíñòðóìåíòîâ ïèêòîãðàììàìè êîìàíä, íåîáõîäèìûìè ïîëüçîâàòåëþ. Äàííàÿ âîçìîæíîñòü, ê ñîæàëåíèþ, îòñóòñòâóåò â MathCAD. Óñòàíîâèâ óêàçàòåëü ìûøè íà ïèêòîãðàììó, ìîæíî óâèäåòü ïîäñêàçêó ñ íàçâàíèåì ôóíêöèè, çàêðåïëåííîé çà ýòîé êíîïêîé. Ïàíåëü èíñòðóìåíòîâ ìîæíî ïîìåñòèòü â ëþáîå ìåñòî ýêðàíà ëèáî çàêðûòü.  MathCAD òðåòüÿ ñòðîêà îêíà ïàíåëü èíñòðóìåíòîâ Standard (Còàíäàðòíàÿ) (ðèñ. 3.1).
Ðèñ. 3.1. Ïàíåëü èíñòðóìåíòîâ Standard (Ñòàíäàðòíàÿ)
Ïèêòîãðàììû ïàíåëè èíñòðóìåíòîâ Standard (Ñòàíäàðòíàÿ) è ñîîòâåòñòâóþùèå èì êîìàíäû ïðåäñòàâëåíû â òàáë. 3.1. Òàáëèöà 3.1 Ïèêòîãðàììà
Êîìàíäà ìåíþ
Äåéñòâèå
1 1 2
2 New (Íîâûé) Open (Îòêðûòü)
3
Save (Ñîõðàíèòü)
3 Ñîçäàòü íîâûé äîêóìåíò Îòêðûòü ðàíåå ñîçäàííûé äîêóìåíò Ñîõðàíèòü òåêóùèé äîêóìåíò ñ åãî èìåíåì Ïå÷àòü äîêóìåíòà
4 5
Print (Ïå÷àòü)
Print Preview (Ïðåäâàðèòåëüíûé ïðîñìîòð)
Ïðåäâàðèòåëüíûé ïðîñìîòð äîêóìåíòà ïåðåä ïå÷àòüþ
31
1 6 7
2 Check Spelling (Îðôîãðàôèÿ) Cut (Âûðåçàòü)
8
Copy (Êîïèðîâàòü)
9
Paste (Âñòàâèòü)
10
Undo (Îòìåíà)
11
Redo (Âîçâðàò)
12
Align Across (Âûðîâíÿòü ïî ãîðèçîíòàëè) Align Down (Âûðîâíÿòü ïî âåðòèêàëè) Insert Function (Âñòàâèòü ôóíêöèþ) Insert Unit (Âñòàâèòü åäèíèöó èçìåðåíèÿ) Calculate (Âû÷èñëèòü) Insert Hyperlink (Âñòàâèòü ãèïåðññûëêó) Insert Component (Âñòàâèòü êîìïîíåíò) Run MathConnex (Çàïóñòèòü ñèñòåìó
13
14
15
16 17
18
19
3 Ïðîâåðèòü îðôîãðàôèþ Âûðåçàòü èç äîêóìåíòà è ñîõðàíèòü â áóôåðå îáìåíà âûäåëåííûé ôðàãìåíò Êîïèðîâàòü â áóôåð âûäåëåííûé ôðàãìåíò äîêóìåíòà Âñòàâèòü â äîêóìåíò ñîäåðæèìîå áóôåðà Îòìåíèòü ïîñëåäíåå èçìåíåíèå äîêóìåíòà Ïîâòîðíî âûïîëíèòü îòìåíó èçìåíåíèé Âûðàâíèâàíèå îáëàñòåé ïî ãîðèçîíòàëè Âûðàâíèâàíèå îáëàñòåé ïî âåðòèêàëè Âñòàâèòü âñòðîåííóþ ôóíêöèþ Âñòàâèòü åäèíèöó èçìåðåíèÿ Âûïîëíèòü âû÷èñëåíèÿ Âñòàâèòü ãèïåðññûëêó íà ôàéë Internet èëè ëîêàëüíûé ôàéë Âñòàâèòü OLE-îáúåêò Çàïóñòèòü íà âûïîëíåíèå ñèñòåìó MathConnex
32
×åòâåðòàÿ ñòðîêà îêíà ñîäåðæèò ïàíåëü èíñòðóìåíòîâ Formatting (Ôîðìàòèðîâàíèå) (ðèñ. 3.2). Êíîïêè ýòîé ïàíåëè ñîäåðæàò íàèáîëåå ÷àñòî èñïîëüçóåìûå ðåæèìû óïðàâëåíèÿ øðèôòîì, àáçàöåì, ñïèñêîì:
1
2
3
4 5 6 7 8 9 10 11
Ðèñ. 3.2 Ïàíåëü èíñòðóìåíòîâ ôîðìàòèðîâàíèÿ
1) ïîëå îòîáðàæàåò íàçâàíèå òåêóùåãî ñòèëÿ òåêñòîâûõ áëîêîâ, êíîïêà ïîçâîëÿåò ðàñêðûòü ñïèñîê äîñòóïíûõ ñòèëåé; 2) ïîëå îòîáðàæàåò íàçâàíèå òåêóùåãî øðèôòà, êíîïêà ïîçâîëÿåò ðàñêðûòü ñïèñîê äîñòóïíûõ øðèôòîâ; 3) ïîëå îòîáðàæàåò òåêóùèé ðàçìåð ñèìâîëîâ, êíîïêà ðàñêðûâàåò ñïèñîê äîñòóïíûõ ðàçìåðîâ ñèìâîëîâ; 4) êíîïêà âêëþ÷åíèÿ / âûêëþ÷åíèÿ ïîëóæèðíîãî (Bold) íà÷åðòàíèÿ ñèìâîëîâ; 5) êíîïêà âêëþ÷åíèÿ / âûêëþ÷åíèÿ íàêëîííîãî (Italic) íà÷åðòàíèÿ ñèìâîëîâ; 6) êíîïêà âêëþ÷åíèÿ / âûêëþ÷åíèÿ ïîä÷åðêíóòîãî (Underline) íà÷åðòàíèÿ ñèìâîëîâ; 7) êíîïêà âûðàâíèâàíèÿ òåêñòà (Align Left) ïî ëåâîé ãðàíèöå; 8) êíîïêà âûðàâíèâàíèÿ òåêñòà (Align Center) ïî öåíòðó; 9) êíîïêà âûðàâíèâàíèå òåêñòà (Align Right) ïî ïðàâîé ãðàíèöå; 10) êíîïêà ñîçäàíèÿ ìàðêèðîâàííîãî (Bullets) ñïèñêà; 11) êíîïêà ñîçäàíèÿ íóìåðîâàííîãî (Numbering) ñïèñêà. Âñå ýòè îïåðàöèè ôîðìàòèðîâàíèÿ èñïîëüçóþòñÿ â òåêñòîâîì ðåäàêòîðå Word.
33
4. Ïàíåëü èíñòðóìåíòîâ Math (Ìàòåìàòèêà) Ïàíåëü èíñòðóìåíòîâ Math (Ìàòåìàòèêà) ñîäåðæèò êíîïêè äëÿ îòîáðàæåíèÿ ñëåäóþùèõ ïàíåëåé èíñòðóìåíòîâ: Calculator (Êàëüêóëÿòîð), Graph (Ãðàôèê), Matrix (Ìàòðèöû), Evaluation (Âû÷èñëåíèÿ), Calculus (Èñ÷èñëåíèå), Boolean (Áóëåâà), Programming (Ïðîãðàììèðîâàíèå), Greek (Ãðå÷åñêèé àëôàâèò), Symbolic (Ñèìâîëû) (ðèñ 1.3). · Calculator (Êàëüêóëÿòîð) ýòî àðèôìåòè÷åñêàÿ ïàíåëü, ñîäåðæàùàÿ êíîïêè çàäàíèÿ âñåõ îñíîâíûõ âû÷èñëèòåëüíûõ îïåðàöèé, öèôð è íåêîòîðûõ ýëåìåíòàðíûõ ôóíêöèé, êîòîðûå ìîæíî íàéòè íà êëàâèàòóðå ìèêðîêàëüêóëÿòîðà (ðèñ. 4.1).
Ðèñ. 4.1. Ïàíåëü èíñòðóìåíòîâ Calculator (Êàëüêóëÿòîð)
· Graph (Ãðàôèê) ýòî ïàíåëü, ñîäåðæàùàÿ êíîïêè äëÿ ïîñòðîåíèÿ äâóõ- è òðåõìåðíûõ ãðàôèêîâ (ðèñ. 4.2).
Ðèñ. 4.2. Ïàíåëü èíñòðóìåíòîâ Graph (Ãðàôèê)
Matrix (Ìàòðèöû) ìàòðè÷íàÿ ïàíåëü, ñîäåðæàùàÿ êíîïêè äëÿ ñîçäàíèÿ è âûïîëíåíèÿ íåêîòîðûõ îïåðàöèé ñ âåêòîðàìè è ìàòðèöàìè (ðèñ. 4.3). 34
Ðèñ. 4.3. Ïàíåëü èíñòðóìåíòîâ Matrix (Ìàòðèöû)
· Evaluation (Âû÷èñëåíèÿ) ýòà ïàíåëü ïðåäíàçíà÷åíà äëÿ ââîäà ðàçëè÷íûõ çíàêîâ ïðèñâàèâàíèÿ, à òàêæå äëÿ çàäàíèÿ ñîáñòâåííûõ îïåðàòîðîâ (ðèñ. 4.4).
Ðèñ. 4.4. Ïàíåëü èíñòðóìåíòîâ Evaluation (Âû÷èñëåíèÿ)
· Calculus (Èñ÷èñëåíèå) ýòà ïàíåëü ñîäåðæèò êíîïêè äëÿ çàäàíèÿ îïåðàòîðîâ äèôôåðåíöèðîâàíèÿ, èíòåãðèðîâàíèÿ, âû÷èñëåíèÿ ñóìì, ïðîèçâåäåíèé è ïðåäåëîâ (ðèñ. 4.5).
Ðèñ. 4.5. Ïàíåëü èíñòðóìåíòîâ Calculus (Èñ÷èñëåíèå)
· Boolean (Áóëåâà) ýòî ïàíåëü, ñîäåðæàùàÿ êíîïêè çàäàíèÿ ëîãè÷åñêèõ îïåðàòîðîâ ñðàâíåíèÿ (ðèñ. 4.6).
Ðèñ. 4.6. Ïàíåëü èíñòðóìåíòîâ Boolean (Áóëåâà)
· Programming (Ïðîãðàììèðîâàíèå) ýòà ïàíåëü ñîäåðæèò êíîïêè äëÿ çàäàíèÿ êîìàíä ïðîãðàììèðîâàíèÿ (ðèñ. 4.7). 35
Ðèñ. 4.7. Ïàíåëü èíñòðóìåíòîâ Programming (Ïðîãðàììèðîâàíèå)
· Greek (Ãðå÷åñêèé àëôàâèò) êíîïêè ýòîé ïàíåëè ïðåäíàçíà÷åíû äëÿ ââîäà ãðå÷åñêèõ áóêâ (ðèñ. 4.8).
Ðèñ. 4.8. Ïàíåëü èíñòðóìåíòîâ Greek (Ãðå÷åñêèé àëôàâèò)
· Symbolic (Ñèìâîëû) ýòà ïàíåëü ñîäåðæèò êíîïêè äëÿ âûïîëíåíèÿ ðàçëè÷íûõ ñèìâîëüíûõ âû÷èñëåíèé (ðèñ. 4.9).
Ðèñ. 4.9. Ïàíåëü èíñòðóìåíòîâ Symbolic (Ñèìâîëû)
36
5. Âõîäíîé ÿçûê MathCAD 2000 Îáùåíèå ïîëüçîâàòåëÿ ñ MathCAD îñóùåñòâëÿåòñÿ íà ìàòåìàòè÷åñêè îðèåíòèðîâàííîì âõîäíîì ÿçûêå. Àëôàâèò âõîäíîãî ÿçûêà ýòî ñîâîêóïíîñòü ñëîâ è ñèìâîëîâ, êîòîðûå èñïîëüçóþòñÿ äëÿ çàäàíèÿ êîìàíä è ôóíêöèé. Àëôàâèò ÿçûêà ñîäåðæèò: · ëàòèíñêèå è ãðå÷åñêèå áóêâû; · àðàáñêèå öèôðû; · ñèñòåìíûå ïåðåìåííûå (ñì. ïðèëîæåíèå 1); · ñïåöèàëüíûå çíàêè è çíàêè-îïåðàòîðû; · èìåíà âñòðîåííûõ ôóíêöèé. Ê óêðóïíåííûì ýëåìåíòàì ÿçûêà îòíîñÿòñÿ òèïû äàííûõ, îïåðàòîðû, âñòðîåííûå ôóíêöèè, ôóíêöèè ïîëüçîâàòåëÿ, ïðîöåäóðû è óïðàâëÿþùèå ñòðóêòóðû. Êðîìå ýòîãî, âñå, ÷òî íàõîäèòñÿ â ìàòåìàòè÷åñêîé ïàíåëè Math, òàêæå îòíîñèòñÿ ê àëôàâèòó ïàêåòà.
Ê òèïó äàííûõ â ïàêåòå îòíîñÿòñÿ êîíñòàíòû, ïåðåìåííûå, ìàññèâû (ìàòðèöû è âåêòîðû), ôàéëû äàííûõ. 5.1. Êîíñòàíòû  ïàêåòå èìåþòñÿ ñëåäóþùèå òèïû äàííûõ: · öåëî÷èñëåííûå êîíñòàíòû ( 2, -285, 521); · âåùåñòâåííûå ÷èñëà ñ ìàíòèññîé è ïîðÿäêîì ( 5.6784 ∗ 10 4 ); · êîìïëåêñíûå ÷èñëà (1.5 + i*3); · ñèñòåìíûå êîíñòàíòû (e, π ); · ñòðîêîâûå êîíñòàíòû («ìàòðèöà», «12345»); · åäèíèöû èçìåðåíèÿ ôèçè÷åñêèõ âåëè÷èí (ïðè íåîáõîäèìîñòè MathCAD âûïîëíÿåò ðàñ÷åòû ôèçè÷åñêèõ âåëè÷èí ñ ïðåîáðàçîâàíèåì èõ ðàçìåðíîñòè). 37
MathCAD ïðîèçâîäèò âñåâîçìîæíûå ìàòåìàòè÷åñêèå îïåðàöèè ñ êîíñòàíòàìè (ïàíåëü Calculator) è ñèìâîëüíûìè ïåðåìåííûìè, ïðè÷åì ñèìâîëüíûå âû÷èñëåíèÿ ìîãóò áûòü âûïîëíåíû äâóìÿ ñïîñîáàìè: · ñ ïîìîùüþ êîìàíä ìåíþ Symbolics; · ñ ïîìîùüþ îïåðàòîðîâ ïàíåëè èíñòðóìåíòîâ Symbolic, âõîäÿùåé â ìàòåìàòè÷åñêóþ ïàíåëü Math. Äëÿ âû÷èñëåíèÿ ÷èñëåííîãî âûðàæåíèÿ ñ ïîìîùüþ ïàíåëè Ñàlculator ââîäÿò âûðàæåíèå è â êîíöå ââåäåííîãî âûðàæåíèÿ ñòàâÿò çíàê = . Êîëè÷åñòâî äåñÿòè÷íûõ çíàêîâ, âûâîäèìûõ â ÷èñëå ïîñëå çàïÿòîé, óñòàíàâëèâàþò ñ ïîìîùüþ êîìàíäû Number of decimal places, ðàñïîëîæåííîé â ìåíþ Format/Result/Number Format. Ïðèìåð 5.1. Âû÷èñëåíèå ÷èñëîâûõ âûðàæåíèé 4 4
8+
8−
2−1−
2+ 1 4
8−
2−1
= 0.707107 ,
π + 0.625 + 1 + 23 ⋅ ( 0.5 − i ⋅ 0.6) 8 = 1.799155 − 2.868293i. e + i ⋅ e−
1
Äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ ñ ïîìîùüþ êîìàíä ìåíþ Symbolics ââîäÿò âûðàæåíèå, âûäåëÿþò åãî ïðè ïîìîùè êóðñîðà, çàòåì èç ìåíþ Symbolics âûáèðàþò ïîäìåíþ Evaluate è êîìàíäó Symbolically (ïðèìåð 5.2.1). Åñëè æå èç ïîäìåíþ âûáðàòü êîìàíäó Floating Point, òî êîíå÷íûé ðåçóëüòàò áóäåò ïðåäñòàâëåí â âèäå ÷èñëà ñ ïëàâàþùåé òî÷êîé (ïðèìåð 5.2.2). Äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ âûðàæåíèé ñ ðàäèêàëàìè íóæíî èñïîëüçîâàòü êîìàíäó Factor èç ìåíþ Symbolic (ïðèìåð 5.2.3). Ïðèìåð 5.2. Ñèìâîëüíîå âû÷èñëåíèå ÷èñëîâûõ âûðàæåíèé ñ ïîìîùüþ êîìàíä ìåíþ Symbolics. 38
yields
1. 25 + 2− 4 + 13
48
4
12
2. 25 + 2− 4 + 13 + π
floating point evaluation yields
8.53742
4
12
3.
4 4
259
8+
by factoring, yields
2+ 1
8−
2−1−
4
1 2
2−1
8−
⋅ 2
Íèæå ïðèâåäåíû ðåçóëüòàòû ñèìâîëüíûõ âû÷èñëåíèé ñ ïîìîùüþ êîìàíä ïàíåëè Symbolic, âõîäÿùåé â Math. Ïðèìåð 5.3. Ñèìâîëüíûå âû÷èñëåíèÿ ñ ïîìîùüþ êîìàíä ïàíåëè Symbolic. 1. 25 + 2 − 4 + 13 → 259 4
12
48
2. 25 2 − 4 13 + + π float → 8.5374259869231265718 12 + 4 4
3. 4
8 +
8 −
2 − 1 −
2 + 1 4
8 −
factor 2 − 1
→
1 2
⋅
2
5.2. Ïåðåìåííûå Äëÿ çàäàíèÿ ïåðåìåííîé íóæíî óêàçàòü å¸ èìÿ, êîòîðîå íàçûâàåòñÿ èäåíòèôèêàòîðîì. Èìåíà (èäåíòèôèêàòîðû) ìîãóò èìåòü ëþáóþ äëèíó è ñîñòîÿòü èç áóêâ ëàòèíñêîãî è ãðå÷åñêîãî àëôàâèòîâ, àðàáñêèõ öèôð, îäíàêî, ïåðâîé äîëæíà áûòü áóêâà. Èìåíà ïåðåìåííûõ íå äîëæíû ñîâïàäàòü ñ èìåíàìè âñòðîåííûõ ôóíêöèé è ñèñòåìíûõ ïåðåìåííûõ. ×òîáû ïðè39
ñâîèòü ïåðåìåííîé çíà÷åíèå, íóæíî íàáðàòü å¸ èìÿ, ùåëêíóòü ïî ïèêòîãðàììå îïåðàòîðà ïðèñâàèâàíèÿ := íà ïàíåëè Ñàlculator è ââåñòè ÷èñëåííîå çíà÷åíèå ëèáî ìàòåìàòè÷åñêîå âûðàæåíèå. Åñëè ïåðåìåííîé ïðèñâîåíî çíà÷åíèå ñ ïîìîùüþ îïåðàòîðà :=, òî òàêàÿ ïåðåìåííàÿ íàçûâàåòñÿ ëîêàëüíîé. Åñëè ïåðåìåííîé ïðèñâîåíî çíà÷åíèå ñ ïîìîùüþ îïåðàòîðà ≡ (ïàíåëü Evaluation), òî òàêàÿ ïåðåìåííàÿ íàçûâàåòñÿ ãëîáàëüíîé. Ïðèìåð 5.4. Çàäàíèå ïåðåìåííûõ a := 4.5 m :=
b := π
a⋅b c
⋅d
c :=
21
d ≡ 5.76 ⋅ e
8
m = 84.323776
Ïåðåìåííàÿ ìîæåò áûòü ðàçìåðíîé, òî åñòü õàðàêòåðèçîâàòüñÿ êàê ôèçè÷åñêàÿ âåëè÷èíà. Äëÿ çàäàíèÿ ðàçìåðíîñòè ïåðåìåííîé ïîñëå ââîäà ÷èñëåííîãî çíà÷åíèÿ íàäî íàáðàòü çíàê óìíîæåíèÿ è ôèçè÷åñêóþ åäèíèöó èçìåðåíèÿ, êîòîðóþ ìîæíî âûáðàòü íà ïàíåëè èíñòðóìåíòîâ ëèáî ïî êîìàíäå Units â ìåíþ Insert.  ïðîöåññå âû÷èñëåíèé îòñëåæèâàåòñÿ ñîîòâåòñòâèå ðàçìåðíûõ âåëè÷èí è âûäàåòñÿ ñîîáùåíèå îá îøèáêå â ñëó÷àå åãî íàðóøåíèÿ. Ïðèìåð 5.5. Âû÷èñëåíèå ñêîðîñòè s := 150 ⋅ km
ïðîéäåííîå ðàññòîÿíèå
t := 1.25 ⋅ hr çàòðà÷åííîå âðåìÿ s -1 v := v = 33.333ms ñêîðîñòü t
Ðàíæèðîâàííàÿ ïåðåìåííàÿ ýòî ïåðåìåííàÿ, êîòîðàÿ çàäàåòñÿ âûðàæåíèåì: èìÿ ïåðåìåííîé := N1 [, N1 + Step ] .. N2, ãäå N1 íà÷àëüíîå çíà÷åíèå ïåðåìåííîé, N2 êîíå÷íîå çíà÷åíèå, Step øàã èçìåíåíèÿ. Åñëè âûðàæåíèå â êâàäðàòíûõ ñêîáêàõ îòñóòñòâóåò è N1 < N2, òî øàã èçìåíåíèÿ ðàâåí 1, â 40
ïðîòèâíîì ñëó÷àå øàã ðàâåí Step. Çàäàíèå ðàíæèðîâàííîé ïåðåìåííîé ýêâèâàëåíòíî çàäàíèþ êîíå÷íîãî öèêëà. Ïðèìåð 5.6. Çàäàíèå è âûâîä ðàíæèðîâàííûõ ïåðåìåííûõ a := 1.. 5
b := −5.. −1
c := −5, −4.5.. −3
a=
b =
c=
1
-5
-5
2
-4
-4.5
3
-3
-4
4
-2
-3.5
5
-1
-3
5.3. Âåêòîðû, ìàòðèöû Îäíîìåðíûé ìàññèâ ÷èñåë ëèáî ñèìâîëîâ íàçûâàåòñÿ âåêòîðîì, à äâóõìåðíûé ìàòðèöåé. Äëÿ ñîçäàíèÿ ìàññèâîâ ìîæíî âîñïîëüçîâàòüñÿ êîìàíäîé Matrix ìåíþ Insert èëè ïàíåëüþ Matrix:
Ðèñ. 5.1. Ñîçäàíèå âåêòîðîâ è ìàòðèö
 äèàëîãîâîì îêíå Insert Matrix íóæíî óêàçàòü ðàçìåð ìàòðèöû, çàäàâ êîëè÷åñòâî ñòðîê (Rows) è ñòîëáöîâ (Columns). Åñëè ïàðàìåòð Rows ðàâåí 1, òî áóäåò çàäàâàòüñÿ âåêòîð-ñòðîêà, åñëè ïàðàìåòð Columns ðàâåí 1, òî áóäåò çàäàâàòüñÿ âåêòîðñòîëáåö. Ïîñëå çàäàíèÿ ðàçìåðîâ âåêòîðà ëèáî ìàòðèöû ñëå41
äóåò ùåëêíóòü ïî êíîïêå ÎÊ ëèáî Insert, è â äîêóìåíòå ïîÿâèòñÿ øàáëîí ìàññèâà, êîòîðûé íóæíî çàïîëíèòü äàííûìè. Ïðèìåð 5.7. Ñîçäàíèå âåêòîðîâ è ìàòðèö
( 2 4 6 ) âåêòîð-ñòðîêà
a b+ c d
âåêòîð-ñòðîêà
2 4 −2 ìàòðèöà −42 Ìàòðèöû è âåêòîðû ìîæíî êîíñòðóèðîâàòü è ñ ïîìîùüþ ðàíæèðîâàííûõ ïåðåìåííûõ, òîëüêî íàäî ïîìíèòü, ÷òî ñèñòåìíàÿ ïåðåìåííàÿ ORIGIN, îïðåäåëÿþùàÿ èíäåêñ ïåðâîãî ýëåìåíòà ìàññèâà, ïî óìîë÷àíèþ ïðèíèìàåò çíà÷åíèå 0. Ïðèìåð 5.8. Ïîñòðîåíèå âåêòîðîâ è ìàòðèö ñ ïîìîùüþ ðàíæèðîâàííîé ïåðåìåííîé 1.
i := 1 .. 3 ðàíæèðîâàííàÿ ïåðåìåííàÿ 2
vi := i + 5 âû÷èñëåíèå i-ãî ýëåìåíòà âåêòîðà
v=
0 6 14
ïîñòðîåííûé âåêòîð, ýëåìåíò âåêòîðà ñ èíäåêñîì 0 ðàâåí 0
24 42
2. ORIGIN := 1 çàäàíèå èíäåêñàöèè ýëåìåíòîâ ñ 1 i := 1 .. 3
2
v1i := i + 5 ⋅ i
6 ïîñòðîåííûé âåêòîð, ýëåìåíò âåêòîðà ñ v1 = 14 èíäåêñîì 1 âû÷èñëåí ïî âûøåïðèâåäåííîé 24 ôîðìóëå 3.
i := 1 .. 2
j := 1
m i, j := i + j
2 3 4 ïîñòðîåííàÿ ìàòðèöà 3 4 5
m=
5.4. Îïåðàòîðû Îïåðàòîðû ýëåìåíòû ÿçûêà äëÿ ñîçäàíèÿ ìàòåìàòè÷åñêèõ âûðàæåíèé ñ èñïîëüçîâàíèåì äàííûõ. Àðèôìåòè÷åñêèå îïåðàòîðû ïðåäíàçíà÷åíû äëÿ âûïîëíåíèÿ äåéñòâèé íàä ÷èñëîâûìè âåëè÷èíàìè è ñîçäàíèÿ ìàòåìàòè÷åñêèõ âûðàæåíèé. Ýòè îïåðàòîðû íàõîäÿòñÿ â ìàòåìàòè÷åñêîé ïàíåëè Calculator. Îïåðàòîðû îòíîøåíèé ïðåäíàçíà÷åíû äëÿ ñðàâíåíèÿ äâóõ âåëè÷èí, êàê ïðàâèëî, èñïîëüçóþòñÿ ñîâìåñòíî ñ óñëîâíûìè ôóíêöèÿìè. Îíè ðàñïîëîæåíû â ïàíåëè Boolean. Ëîãè÷åñêèå îïåðàòîðû íàõîäÿòñÿ âî âòîðîé ñòðîêå ïàíåëè Boolean. Ðàñøèðåííûå îïåðàòîðû ïðåäíàçíà÷åíû äëÿ âû÷èñëåíèÿ ñóìì, ïðîèçâåäåíèé, ïðåäåëîâ, ïðîèçâîäíûõ, èíòåãðàëîâ è íàõîäÿòñÿ â ïàíåëè Calculus. Ïðèìåíåíèå ðàñøèðåííûõ îïåðàòîðîâ îáëåã÷àåò ðåøåíèå ìíîãèõ ìàòåìàòè÷åñêèõ çàäà÷. Ïîñëå âûçîâà ðàñøèðåííîãî îïåðàòîðà â äîêóìåíòå ïîÿâèòñÿ øàáëîí, êîòîðûé íóæíî çàïîëíèòü ÷èñëàìè èëè ñèìâîëàìè. 43
Ýòè îïåðàòîðû ìîæíî èñïîëüçîâàòü êàê â ÷èñëîâûõ, òàê è â ñèìâîëüíûõ âû÷èñëåíèÿõ. Èñïîëüçóÿ âîçìîæíîñòè MathCAD, ìîæíî ñîçäàâàòü ïîëüçîâàòåëüñêèå îïåðàòîðû. Ïðèìåð 5.9. Âû÷èñëåíèå êîíå÷íîé ñóììû
5.5. Âñòðîåííûå ôóíêöèè è ôóíêöèè ïîëüçîâàòåëÿ Ïàêåò èìååò áîëüøîå êîëè÷åñòâî âñòðîåííûõ ôóíêöèé. Åñëè îáðàòèòüñÿ ê ôóíêöèè ïî èìåíè ñ óêàçàíèåì ñîîòâåòñòâóþùèõ àðãóìåíòîâ, òî â ðåçóëüòàòå âû÷èñëåíèé áóäåò ïîëó÷åíî íåêîòîðîå çíà÷åíèå. Âñå âñòðîåííûå ôóíêöèè â îêíå Insert Function (Âñòàâèòü Ôóíêöèþ) (ðèñ. 5.2)
Ðèñ. 5.2. Îêíî Insert Function (Âñòàâèòü Ôóíêöèþ)
44
ðàçäåëåíû íà êàòåãîðèè, ÷òî ñóùåñòâåííî îáëåã÷àåò ïîèñê íóæíîé âñòðîåííîé ôóíêöèè. Íèæå ïåðå÷èñëåíû êàòåãîðèè âñòðîåííûõ ôóíêöèé è èìåíà âñòðîåííûõ ôóíêöèé â êàæäîé êàòåãîðèè: 1. Ôóíêöèè Áåññåëÿ (Bessel): Ai(x), bei(n, x), ber(n, x), Bi(x), I0(x), I1(x), In(m, x), J0(x), J1(x), Jn(m, x), js(n, x), K0(x), K1(x), Kn(m, x), Y0(x), Y1(x), Yn(m, x), ys(n, x). 2. Ôóíêöèè êîìïëåêñíûõ ÷èñåë (Complex Numbers): arg(z), csgn(z), Im(z), Re(z), signum(z). 3. Ôóíêöèè ñãëàæèâàíèÿ (Curve Fitting): åõðfit(vx, vy, vg), genfit(vx, vy, vg, F), lgsfit(vx, vy, vg, F), line(vx, vy), linfit(vx, vy, F), logfit(vx, vy), medfit(vx, vy), pwrfit(vx, vy, vg), sinfit(vx, vy, vg). 4. Ôóíêöèè ðåøåíèÿ äèôôåðåíöèàëüíûõ óðàâíåíèé è ñèñòåì (çàäà÷à Êîøè, êðàåâàÿ çàäà÷à, óðàâíåíèÿ â ÷àñòíûõ ïðîèçâîäíûõ) (Differential Equation Solving): Bulstoer(y, x1, x2, npoints, D), bulstoer(y, x1, x2, acc, D, kmax, save), bvalfit(v1, v2, x1, x2, xf, D, load1, load2, score), multigrid(M, ncycle), odesolve(x, b [, step]), relax(A, B, C, D, E, F, U, rjac), Rkadapt(y, x1, x2, npoints, D), rkadapt(y, x1, x2, acc, D, kmax, save), rkfixed(y, x1, x2, npoints, D), sbval(v, x1, x2, D, load, score), Stiffb(y, x1, x2, npoints, D, J), stiffb(y, x1, x2, acc, D, J, kmax, save), Stiffr(y, x1, x2, npoints, D, J), stiffr(y, x1, x2, acc, D, J, kmax, save). 5. Ôóíêöèè êîíòðîëÿ ïåðåìåííûõ (Expression Type): IsArray(x), IsScalar(x), IsString(x), UnisOf(x). 6. Ôóíêöèè ðàáîòû ñ ôàéëàìè (File Access): APPENDPRN(file), LoadColormap(file), READ_BLUE(file), READ_GREEN(file), READ_HLS(file), READ_HLS_HUE(file), READ_HLS_LIGHT(file), READ_HLS_SAT(file), READ_HSV(file), READ_HSV_HUE(file), READ_HSV_SAT(file), READ_HSV_VALUE(file), READ_IMAGE(file), READ_RED(file), READBMP(file), READPRN(file), READRGB(file), SaveColormap(file, M), WRITE_HLS(file), WRITE_HSV(file), WRITEBMP(file), WRITEPRN(file), WRITERGB(file). 45
7. Ôèíàíñîâî ýêîíîìè÷åñêèå ôóíêöèè (Finance): cnper(rate, pv, fv), crate(nper, pv, fv), cumint(rate, nper, pv, start, end [,type]), cumprn(rate, nper, pv, start, end [,type]), eff(rate, nper), fv(rate,nper,pmt [,[pv], [type]]), fvadj(prin, v), fvc(rate, v), ipmt(rate, per, nper, pv[,[pv], [type]]), irr(v, [guess]), mirr(v, fin_rate, rein_rate), nom(rate, nper), nper(rate, pmt,pv[,[fv], [type]]), npv(rate, v), pmt(rate, nper, pv[,[fv], [type]]), ppmt(rate, per, nper, pv[,[fv], [type]]), pv(rate, nper, pmt, nper, pv[,[fv], [type]]), rate (nper, pmt, pv [[fv], [type], [guess]]. 8. Ôóíêöèè ïðåîáðàçîâàíèÿ Ôóðüå (Fourier Transform): CFFT(A), cfft(A), FFT(v), fft(v), ICFFT(A), icfft(A), IFFT(v) è ifft(v). 9. Ãðàôè÷åñêèå ôóíêöèè (Graph): Polyhedron(S), PolyLookup(n). 10. Ãèïåðáîëè÷åñêèå ôóíêöèè (Hyperbolic): asinh(z), acosh(z), atanh(z), acoth(z), asech(z), acsch(z), sinh(z), cosh(z), tanh(z), csch(z), sech(z), coth(z). 11. Ôóíêöèè îáðàáîòêè îáðàçîâ (Image Processing) (ñì. ôóíêöèè ðàáîòû ñ ôàéëàìè). 12. Ôóíêöèè èíòåðïîëÿöèè è àïïðîêñèìàöèè (Interpolation and Prediction): bspline(vx, vy, u, n), cspline(Mxy, Mz), interp(vs, Mxy, Mz, v), linterp(vx, vy, x), lspline(Mxy, Mz), predict(v, m, n), pspline(Mxy, Mz). 13. Ëîãàðèôìè÷åñêèå è ýêñïîíåíöèàëüíûå ôóíêöèè (Log and Exponential) : exp(z), ln(z), log(z, [b]). 14. Ôóíêöèè òåîðèè ÷èñåë è êîìáèíàòîðèêè (Numbers Theory / Combinatorics): combin(n, k), gcd(A), lcm(A), mod(n, k), peremut(n, k). 15. Ôóíêöèè ñòóïåíåê è óñëîâèÿ (Piecewise Continuous): antisymmetric tensor(i, j, k), heaviside step(x), if(cond, x, y), kronecker delta(x, y), sign(x). 16. Ôóíêöèè ïëîòíîñòè âåðîÿòíîñòè (Probably Density): dbeta(x, s1, s2), dbinom(k, n, p), dcauchy(x, l, s), dchisq(x, d), dexp(x, r), dF(x, d1, d2), dgamma(x, s), dgeom(k, p), dhypergeom(m, a, b, n), dlnorm(x, mu, sigma), dlogis(x, l, s), dnbinom(k, n, p), dnorm(x, mu, sigma), dpois(k, l), dt(x, d), dunif(x, a, b), dweibull(x, s). 46
17. Ôóíêöèè ðàñïðåäåëåíèÿ âåðîÿòíîñòè (Probably Distribution): cnorm(x), pbeta(x, s1, s2), pbinom(k, n, p), pcauchy(x, l, s), pchisq(x, d), pexp(x, r), pF(x, d1, d2), pgamma(x, s), pgeom(k, p), phypergeom(m, a, b, n), plnorm(x, mu, sigma), plogis(x, l, s), pnbinom(k, n, p), pnorm(x, mu, sigma), ppois(k, l), pt(x, d), punif(x, a, b), pweibull(x, s) è ôóíêöèè ïëîòíîñòè âåðîÿòíîñòè. 18. Ôóíêöèè ñëó÷àéíûõ ÷èñåë (Random Numbers): rbeta(m, s1, s2), rbinom(m, n, p), rcauchy(m, l, s), rchisq(m, d), rexp(m, r), rF(m, d1, d2), rgamma(m, s), rgeom(m, p), rhypergeom(m, a, b, n), rlnorm(m, mu, sigma), rlogis(m, l, s), rnbinom(m, n, p), rnd(x), rnorm(m, mu, sigma), rpois(m, l), rt(m, d), runif(m, a, b), rweibull(m, s). 19. Ôóíêöèè ðåãðåññèè è ñãëàæèâàíèÿ (Regression and Smoothing): genfit(vx, vy, vg, F), intercept(vx, vy), ksmooth(vx, vy, b), linfit(vx, vy, F), loess(Mx, My, span), medsmooth(vy, n), regress(Mx, vy, n), slope(vx, vy), stderr(vx, vy),supsmooth(vx, vy) è ôóíêöèè ãðóïïû 3. 20. Ôóíêöèè ðåøåíèÿ àëãåáðàè÷åñêèõ óðàâíåíèé è ñèñòåì, à òàêæå ôóíêöèè îïòèìèçàöèè (Solving): find(var1, var2,...), lsolve(M, v), maximize(f, var1, var2,...), minerr(var1, var2,...), minimize(f, var1, var2,...), polyroots(v), root(f(var), var). 21. Ôóíêöèè ñîðòèðîâêè (Sorting): csort(A, j), reverse(A), rsort(A, j), sort(v). 22. Ñïåöèàëüíûå ôóíêöèè (Special): erf(z), erfc(x), fhyper(a, b, c, x), Gamma(a, z), Her(n, x), ibeta(a, x, y), Jac(n, a, b, x), Lag(n, x), Leg(n, x), mhyper(a, b, x), Tcheb(n, x), Ucheb(n, x). 23. Ñòàòèñòè÷åñêèå ôóíêöèè (Statistics): corr(A, B), cvar(A,B), gmean, hist, hmean(A), kurt, mean(A), median(A), skew(A,B,C,...), stderr, stdev(A), Stdev(A), var(A), Var(A). 24. Òåêñòîâûå ôóíêöèè (String): concat(S1, S2, S3,...), strlen(S), search(S, SubS, m), substr(S, m, n), str2num(S), num2str(z), str2vec(S), vec2str(v). 25. Òðèãîíîìåòðè÷åñêèå ôóíêöèè (Trigonometric): acos(z), acot(z0, acsc(z), angle(x, y), asec(z), asin(z), atan(z), atan2(z), cos(z), cot(z), csc(z), sec(z), sin(z), tan (z). 47
26. Ôóíêöèè îêðóãëåíèÿ è ðàáîòû ñ ÷àñòüþ ÷èñëà (Truncation and Round-Off): ceil(x), floor(x), round(x, n) è trunc(x). 27. Ôóíêöèè ïîëüçîâàòåëÿ (User defined): Kronecker(m,n), Psi(z). 28. Ôóíêöèè ðàáîòû ñ âåêòîðàìè è ìàòðèöàìè (Vector and Matrix): augment(A, B), cholesky(M), cols(A), cond1(M), cond2(M), conde(M), condi(M), diag(v), eigenvals(M), eigenvec(M, z), eigenvecs(M), geninv(A), genvals(M, N), genvecs(M, N), identity(n), last(v), lenght(v), lu(M), matrix(m, n, f), max(A), min(A), norm1(M), norm2(M), norme(M), normi(M), qr(A), rank(A), rows(A), rref(A), stack(A, B), submatrix(A, ir, jr, ic, jc), svd(A), svds(A) è tr(M). 29. Ôóíêöèè âîëíîâîãî ïðåîáðàçîâàíèÿ (Wavelet Transform): iwave(v) è wave(v). Íåñìîòðÿ íà áîëüøîå êîëè÷åñòâî âñòðîåííûõ ôóíêöèé, ó ïîëüçîâàòåëÿ ÷àñòî âîçíèêàåò íåîáõîäèìîñòü ñîçäàòü ñâîþ ôóíêöèþ. Ôóíêöèÿ ïîëüçîâàòåëÿ ñîçäàåòñÿ ñëåäóþùèì îáðàçîì: Èìÿ ôóíêöèè (Ñïèñîê àðãóìåíòîâ) : = Âûðàæåíèå. Èìÿ ôóíêöèè èäåíòèôèêàòîð, êàê è èìÿ ïåðåìåííîé.  ñêîáêàõ óêàçûâàåòñÿ ñïèñîê àðãóìåíòîâ, èñïîëüçóåìûõ â âûðàæåíèè, ïåðå÷èñëåííûõ ÷åðåç çàïÿòóþ. Âûðàæåíèå ýòî êîíñòðóêöèÿ, ñîäåðæàùàÿ îïåðàòîðû, òèïû äàííûõ è âñòðîåííûå ôóíêöèè. Ïðèìåð 5.10. Âû÷èñëèòü ïëîùàäü òðåóãîëüíèêà ïî ôîðìóëå Ãåðîíà, ñîçäàâ ôóíêöèþ ïîëüçîâàòåëÿ äëÿ âû÷èñëåíèÿ ïîëóïåðèìåòðà è ïëîùàäè p ( a , b , c) :=
( a + b + c) 2
ïîëóïåðèìåòð òðåóãîëüíèêà
S ( a , b , c) := p ( a , b , c) ⋅ ( p ( a , b , c) − a) ⋅ ( p ( a , b , c) − b) ⋅ ( p ( a , b , c)
Ïîëóïåðèìåòð è ïëîùàäü òðåóãîëüíèêà ñî ñòîðîíàìè a = 3, b = 4, c = 6 p ( 3 , 4 , 6) = 6.5 S ( 3 , 4 , 6) = 5.333. 48
6. Ïîñòðîåíèå äâóõìåðíûõ ãðàôèêîâ 6.1. Ïîñòðîåíèå ãðàôèêîâ ôóíêöèé âèäà y = f ( x ) Äëÿ ïîñòðîåíèÿ äâóõìåðíûõ ãðàôèêîâ â äåêàðòîâîé ñèñòåìå êîîðäèíàò íóæíî âûáðàòü øàáëîí äâóõìåðíîãî ãðàôèêà ïî êîìàíäå X-Y Plot èç ìåíþ Insert/Graph.  ðàáî÷åì ïîëå ïîÿâèòñÿ íåçàïîëíåííûé øàáëîí â âèäå ïðÿìîóãîëüíèêà ñ äâóìÿ òåìíûìè ìàëåíüêèìè ïðÿìîóãîëüíèêàìè ïî êàæäîé îñè (ðèñ. 6.1).
Ðèñ. 6.1. Øàáëîí äâóõìåðíîãî ãðàôèêà
Ìàëåíüêèé òåìíûé ïðÿìîóãîëüíèê ïîä ãîðèçîíòàëüíîé îñüþ îïðåäåëÿåò ïîçèöèþ äëÿ ââîäà èìåíè íåçàâèñèìîé ïåðåìåííîé. Ïî âåðòèêàëüíîé îñè â ýòîé ïîçèöèè ââîäèòñÿ èìÿ ôóíêöèè, ãðàôèê êîòîðîé íóæíî ïîñòðîèòü. Åñëè íà îäíîì è òîì æå ãðàôèêå íåîáõîäèìî ïîñòðîèòü íåñêîëüêî ôóíêöèé, òî èõ èìåíà ïåðå÷èñëÿþòñÿ ÷åðåç çàïÿòóþ â âûøåóêàçàííîé ïîçèöèè. Ïîñëå ââîäà íåçàâèñèìîé ïåðåìåííîé, íàïðèìåð, õ, ïîÿâÿòñÿ òåìíûå ìàëåíüêèå ïðÿìîóãîëüíèêè ïî îáå ñòîðîíû îò ïåðåìåííîé õ (ðèñ. 6.2). Ýòè ïðÿìîóãîëüíèêè ñëóæàò äëÿ óêàçàíèÿ ïîçèöèè ââîäà ãðàíèö çíà÷åíèé ïî îñè àáñöèññ, â ïðåäåëàõ êîòîðûõ áóäåò ïîñòðîåí ãðàôèê. Åñëè ýòè ïîëÿ íå çàäàíû, òî îíè àâòîìàòè÷åñêè çàïîëíÿòñÿ çíà÷åíèÿìè îò 10 äî 10. 49
Ðèñ. 6.2. Çàïîëíåíèå øàáëîíà
Ùåëêíóâ ëåâîé êíîïêîé ìûøè ïî òåìíîìó ïðÿìîóãîëüíèêó ïî âåðòèêàëüíîé îñè è çàäàâ ôóíêöèþ, ãðàôèê êîòîðîé íóæíî íàðèñîâàòü, â ïîçèöèè, îïðåäåëåííîé òåìíûìè ìàëåíüêèìè ïðÿìîóãîëüíèêàìè ïî îáå ñòîðîíû îò èìåíè ôóíêöèè, ñëåäóåò ââåñòè çíà÷åíèÿ äëÿ óêàçàíèÿ äèàïàçîíà èçìåíåíèÿ ôóíêöèè. Ïîñëå ùåë÷êà ëåâîé êíîïêîé ìûøè âíå ãðàôè÷åñêîé îáëàñòè ãðàôèê ôóíêöèè áóäåò ïîñòðîåí. Ïðèìåð 6.1. Ïîñòðîèòü ãðàôèê ôóíêöèè y = sin 2 x áåç óêàçàíèÿ è ñ óêàçàíèåì äèàïàçîíîâ èçìåíåíèÿ íåçàâèñèìîé ïåðåìåííîé è ôóíêöèè.
Ðèñ. 6.3. Ïîñòðîåíèå ãðàôèêà y = sin 2 x
Ïðè ïîñòðîåíèè ãðàôèêà ìîæíî èñïîëüçîâàòü ðàíæèðîâàííóþ ïåðåìåííóþ äëÿ çàäàíèÿ äèàïàçîíà èçìåíåíèÿ àðãóìåíòà. Íà îäíîì ãðàôèêå ñòðîèòü íåñêîëüêî êðèâûõ. Ïðèìåð 6.2. Ïîñòðîèòü ãðàôèêè ôóíêöèé y = 0.75 cos x , 3 y = 0.25 sin 3x , y = cos x ïðè èçìåíåíèè íåçàâèñèìîé ïåðå-
ìåííîé îò 4 äî 4.
50
y( x) := 0.75 ⋅ cos ( x) x := −4 , −3.99 .. 4
y1( x) := 0.25 ⋅ cos ( 3 ⋅ x)
y2( x) := c
- ðàíæèðîâàííàÿ ïåðåìåííàÿ
1
y ( x)
0.5
y1( x) y2( x) 0
0 0.5 1
4
2
0
2
x
Ðèñ. 6.4. Ïîñòðîåíèå íåñêîëüêèõ ãðàôèêîâ
Èñïîëüçóÿ ôóíêöèþ óñëîâèÿ if , ìîæíî ïîñòðîèòü áîëåå ñëîæíûå ãðàôèêè. Âèä ôóíêöèè óñëîâèÿ: if (óñëîâèå, âûðàæåíèå 1, âûðàæåíèå 2). Åñëè óñëîâèå èñòèííî, òî âûïîëíÿåòñÿ âûðàæåíèå 1, â ïðîòèâíîì ñëó÷àå âûðàæåíèå 2. Ïðèìåð 6.3. Ïîñòðîèòü ãðàôèê ôóíêöèè: 1 − x 2 , åñëè x < 1, y = x − 1, åñëè 1 ≤ x < 2, 3 − x , åñëè x ≥ 2. x := −2 , −1.99 .. 4
(
2
y( x) := if x < 1 , 1 − x , if( x ≥ 2 , 3 − x , x
51
3
2
y ( x)
0.5
1
2.5
4
−4 −2
x
4
Ðèñ. 6.5. Ãðàôèê ôóíêöèè
6.2. Ïîñòðîåíèå ãðàôèêîâ ôóíêöèé, çàäàííûõ ïàðàìåòðè÷åñêè Äëÿ ïîñòðîåíèÿ ãðàôèêîâ ôóíêöèé, çàäàííûõ ïàðàìåòðè÷åñêè: x ( t ) = ϕ( t ), y( t ) = φ( t ), t 0 < t < t 1 , ñíà÷àëà íóæíî âûáðàòü øàáëîí äâóõìåðíîãî ãðàôèêà X-Y Plot, â ñåðåäèíå ãîðèçîíòàëüíîé è âåðòèêàëüíîé îñåé ââåñòè ôóíêöèè x ( t ) , y( t ) . Ïåðåìåííàÿ t ìîæåò áûòü çàäàíà êàê ðàíæèðîâàííàÿ ïåðåìåííàÿ. Ïðèìåð 6.4. Ïîñòðîèòü ãðàôèê ôóíêöèè, çàäàííîé ïàðàìåòðè÷åñêè x ( t ) = cos 3 t , x ( t ) = sin 3 t ïðè t ∈[0, 2 π] x( t) := cos ( t)
3
y( t) := sin( t)
t := 0 , 0.01.. 2 ⋅ π
3
1 0.5
y ( t)
0 0.5 1
1
0.5
0
0.5
1
x( t )
Ðèñ. 6.6. Ãðàôèê ôóíêöèè, çàäàííîé ïàðàìåòðè÷åñêè
52
2 2 Ïðèìåð 6.5. Ïîñòðîèòü ãðàôèê óðàâíåíèÿ x + y = 1 2 2
a
b
ïðè ðàçëè÷íûõ çíà÷åíèÿõ ïàðàìåòðîâ a, b. Äàííîå óðàâíåíèå ìîæíî çàïèñàòü â ïàðàìåòðè÷åñêîì âèäå x ( t ) = a cos t , y ( t ) = b sin t , t ∈ [0, 2 π] . Íà ðèñ. 6.7. íàðèñîâàíû ãðàôèêè ôóíêöèè äëÿ a = 2, b = 1 ; a = 1, b = 2
x( a , t) := a ⋅ cos( t)
y( b , t) := b ⋅ sin( t)
t := 0 , 0.01.. 2
2
y ( 1 , t) y ( 2 , t)
0
2 2
1
0
1
2
x( 2 , t ) , x( 1 , t )
Ðèñ. 6.7. Ãðàôèê ôóíêöèè, çàäàííîé ïàðàìåòðè÷åñêè
6.3. Ïîñòðîåíèå ãðàôèêîâ â ïîëÿðíîé ñèñòåìå êîîðäèíàò Äëÿ ïîñòðîåíèÿ ãðàôèêîâ ρ(θ) = ϕ(θ) , θ∈[θ0 , θ1 ] â ïîëÿðíîé ñèñòåìå êîîðäèíàò íóæíî âûáðàòü øàáëîí Polar Plot â ìåíþ Insert/Graph.  íèæíþþ (ãîðèçîíòàëüíóþ) ÿ÷åéêó ââåñòè ïîëÿðíûé óãîë θ (äëÿ ââîäà ãðå÷åñêèõ áóêâ èñïîëüçîâàòü ïàíåëü Greek).  ëåâóþ (âåðòèêàëüíóþ) ÿ÷åéêó ââåñòè ïîëÿðíûé ðàäèóñ ρ(θ) . Ôóíêöèþ ρ(θ) ìîæíî çàäàòü çàðàíåå êàê ôóíêöèþ ïîëüçîâàòåëÿ ëèáî ââåñòè íåïîñðåäñòâåííî â ÿ÷åéêó. Âåëè÷èíó θ (ïîëÿðíûé óãîë) ìîæíî çàäàòü êàê ðàíæèðîâàííóþ ïåðåìåííóþ. 53
Ïðèìåð 6.6. Ïîñòðîèòü ãðàôèê ρ(θ) = 3 sin 4θ . ρ ( θ ) := 3 ⋅ s
1 ρ (θ )
180 2
Ðèñ. 6.8. Ãðàôèê ôóíêöèè â ïîëÿðíûõ êîîðäèíàòàõ
6.4. Èçìåíåíèå ðàçìåðîâ è ïåðåìåùåíèå ãðàôèêîâ Ïîñòðîåííûå ãðàôèêè ìîæíî ïåðåìåùàòü, ìîæíî èçìåíÿòü èõ ðàçìåðû. Ïåðåä îáðàáîòêîé íóæíî âûäåëèòü ãðàôè÷åñêóþ îáëàñòü. Äëÿ ýòîãî íóæíî ùåëêíóòü ëåâîé êíîïêîé ìûøè ïî ãðàôèêó ãðàôèê îêàæåòñÿ â ïðÿìîóãîëüíîé ðàìêå ñ ÷åðíûìè ïðÿìîóãîëüíèêàìè ïî êîíòóðó, êîòîðûå íàçûâàþòñÿ ìàðêåðàìè. Äëÿ èçìåíåíèÿ ðàçìåðîâ ãðàôèêà íóæíî ïîäâåñòè óêàçàòåëü ìûøè (êðàñíûé êðåñòèê) ê ìàðêåðó óêàçàòåëü ïðèìåò âèä äâóñòîðîííåé ñòðåëêè. Ïðè íàæàòîé ëåâîé êíîïêå, ïåðåìåùàÿ ìûøü ïî ñòîëó (ïðè ýòîì ïðÿìîóãîëüíàÿ ðàìêà ñòàíîâèòñÿ ïóíêòèðíîé), ìîæíî ðàñòÿíóòü ëèáî ñæàòü ãðàôèê, çàòåì êíîïêó ìûøè îòïóñòèòü (ðèñ. 6.9). Ðàçìåðû ãðàôèêà áóäóò èçìåíåíû. Ãðàôèê X-Y Plot ìîæíî èçìåíÿòü â ãîðèçîíòàëüíîì, âåðòèêàëüíîì ëèáî äèàãîíàëüíîì íàïðàâëåíèÿõ. Ãðàôèê Polar Plot ìîæíî èçìåíÿòü òîëüêî â äèàãîíàëüíîì íàïðàâëåíèè. 54
Ðèñ. 6.9. Èçìåíåíèå ðàçìåðà ãðàôèêà
Äëÿ ïåðåìåùåíèÿ ãðàôèêà íóæíî ïîìåñòèòü óêàçàòåëü ìûøè íà ëèíèþ ðàìêè, âûäåëÿþùóþ ãðàôè÷åñêóþ îáëàñòü. Ïðè ýòîì ôîðìà óêàçàòåëÿ áóäåò èçìåíåíà íà ëàäîøêó. Íàæàâ ëåâóþ êíîïêó, ìîæíî ïåðåìåñòèòü ãðàôèê â íóæíîå ìåñòî äîêóìåíòà, çàòåì îòïóñòèòü êíîïêó ìûøè (ðèñ. 6.10).
Ðèñ. 6.10. Ïåðåìåùåíèå ãðàôèêà
55
6.5. Ôîðìàòèðîâàíèå äâóõìåðíûõ ãðàôèêîâ Ïîñòðîåííûé ãðàôèê ìîæíî ôîðìàòèðîâàòü. Äëÿ ýòîãî íóæíî âûäåëèòü ãðàôèê è âûáðàòü êîìàíäó X-Y Plot èç Format/ Graph ëèáî âûïîëíèòü äâîéíîé ùåë÷îê ëåâîé êíîïêîé ìûøè ïî ãðàôèêó.  ðåçóëüòàòå ïîÿâèòñÿ äèàëîãîâîå îêíî Formatting Currently Selected X-Y Plot äëÿ çàäàíèÿ ïàðàìåòðîâ ôîðìàòèðîâàíèÿ âûáðàííîãî ãðàôèêà (ðèñ. 6.11).
Ðèñ. 6.11. Îêíî ôîðìàòèðîâàíèÿ ãðàôèêà
Êàê âèäíî èç ðèñ. 6.11, äèàëîãîâîå îêíî ôîðìàòà èìååò ÷åòûðå âêëàäêè: 1. X-Y Axes (X-Y Îñè) ôîðìàòèðîâàíèå îñåé ãðàôèêà; 2. Traces (Ëèíèè ãðàôèêîâ) ôîðìàòèðîâàíèå ëèíèé ãðàôèêà; 3. Labels (Íàäïèñè) çàäàíèå íàäïèñåé íà ãðàôèêå; 4. Defaults (Ïî óìîë÷àíèþ) óñòàíîâêà ïàðàìåòðîâ ïî óìîë÷àíèþ. 56
Ôîðìàòèðîâàíèå îñåé ãðàôèêà Âêëàäêà X-Y Axes (ðèñ. 6.11) ñîäåðæèò ñëåäóþùèå îñíîâíûå îïöèè äëÿ ôîðìàòèðîâàíèÿ îñåé ãðàôèêà (Axis X è Axis Y): · Log Scale (Ëîãàðèôìè÷åñêèé ìàñøòàá) âêëþ÷èòü / âûêëþ÷èòü ëîãàðèôìè÷åñêèé ìàñøòàá; · Crid Lines (Ëèíèè ñåòêè) âêëþ÷èòü / âûêëþ÷èòü âûâîä ëèíèé ìàñøòàáíîé ñåòêè; · Numbered (Íóìåðîâàòü) âêëþ÷èòü / âûêëþ÷èòü âûâîä öèôðîâûõ äàííûõ ïî îñÿì; · Autoscale (Àâòîìàñøòàá) âêëþ÷èòü / âûêëþ÷èòü àâòîìàòè÷åñêîå ìàñøòàáèðîâàíèå ãðàôèêà; · Show Markers (Ïîêàçàòü ìåòêè) âêëþ÷èòü / âûêëþ÷èòü óñòàíîâêó äâóõ äîïîëíèòåëüíûõ ÿ÷ååê (ïî êàæäîé îñè) äëÿ ñîçäàíèÿ êðàñíûõ ëèíèé ìàðêèðîâêè, ñîîòâåòñòâóþùèõ äâóì çíà÷åíèÿì x è y; · Auto Grid (Àâòîñåòêà) âêëþ÷èòü / âûêëþ÷èòü àâòîìàòè÷åñêóþ óñòàíîâêó ìàñøòàáíûõ ëèíèé; · Number of Grids (×èñëî èíòåðâàëîâ) âêëþ÷èòü / âûêëþ÷èòü óñòàíîâêó çàäàííîãî ÷èñëà ìàñøòàáíûõ ëèíèé. Ñòàíäàðòíî ïî óìîë÷àíèþ óñòàíàâëèâàþòñÿ îïöèè: Numbered (Íóìåðîâàòü), Autoscale (Àâòîìàñøòàá), Auto Grid (Àâòîñåòêà). Åñëè îïöèÿ Grid Lines îòêëþ÷åíà, òî ìàñøòàáíàÿ ñåòêà ãðàôèêà íå ñòðîèòñÿ, õîòÿ íà îñÿõ ðàçìåùàþòñÿ ÷åðòî÷êè äåëåíèÿ. Îïöèÿ Numbered îòîáðàæàåò öèôðîâûå äàííûå (óêàçàíèé íà ìàñøòàá). Ìîæíî òàêæå âêëþ÷èòü / âûêëþ÷èòü óñòàíîâêó ñëåäóþùèõ îïöèé êîîðäèíàòíûõ îñåé (Axes Style): · Boxed (Ðàìêà) îñè â âèäå ïðÿìîóãîëüíèêà; · Crossed (Ïåðåñå÷åíèå) ïåðåñåêàþùèåñÿ îñè â òî÷êå ñ êîîðäèíàòàìè (0,0); · None (Íåò îñåé) îòñóòñòâèå îñåé; · Equal Scales (Ðàâíûå ìàñøòàáû) óñòàíîâêà îäèíàêîâîãî ìàñøòàáà äëÿ îáåèõ îñåé.  íèæíåé ÷àñòè îêíà ðàçìåùåíû ÷åòûðå êëàâèøè: OK çàêðûòü îêíî ôîðìàòèðîâàíèÿ; Îòìåíà îòìåíèòü ôîðìàòèðîâàíèå; Ïðèìåíèòü ïðèìåíèòü çàäàííûå ïàðàìåòðû ê ãðàôèêó; Ñïðàâêà âûâîä ïîäñêàçêè. 57
Ôîðìàòèðîâàíèå ëèíèé ãðàôèêîâ Âêëàäêà Traces (Ãðàôèêè) (ñì. ðèñ. 6.12) ñëóæèò äëÿ óïðàâëåíèÿ îòîáðàæåíèåì ëèíèé, êîòîðûìè ñòðîèòñÿ ãðàôèê.
Ðèñ. 6.12. Îïöèè âêëàäêè Traces
Îíà ñîäåðæèò ñëåäóþùèå îïöèè: · Legend Label (Èìÿ êðèâîé) óêàçàòü òèï ëèíèè ó îñè îðäèíàò ñîîòâåòñòâóþùåé êðèâîé; · Symbol (Ñèìâîë) âûáðàòü ñèìâîë, êîòîðûé ïîìåùàåòñÿ íà ëèíèþ; · Line (Ëèíèÿ) óñòàíîâèòü òèï ëèíèè (ñïëîøíàÿ, ïóíêòèðíàÿ, òî÷å÷íàÿ è äð.); · Color (Öâåò) óñòàíîâèòü öâåò ëèíèè; · Type (Òèï) óñòàíîâèòü òèï ãðàôèêà; · Weight (Òîëùèíà) óñòàíîâèòü òîëùèíó ëèíèè. Îïöèÿ Symbol (Ñèìâîë) ïîçâîëÿåò çàäàòü ñëåäóþùèå îòìåòêè áàçîâûõ òî÷åê ãðàôèêà ôóíêöèè: 58
· none (íè÷åãî) áåç îòìåòêè; · xs íàêëîííûé êðåñòèê; · +õ ïðÿìîé êðåñòèê; · box (êâàäðàò) êâàäðàò; · dmnd (ðîìá) ðîìáèê; · os îêðóæíîñòü. Îïöèÿ Line çàäàåò ïîñòðîåíèå ñëåäóþùèõ òèïîâ ëèíèé: · none (íè÷åãî) ëèíèÿ íå ñòðîèòñÿ; · solid (ñïëîøíàÿ) íåïðåðûâíàÿ ëèíèÿ; · dash (ïóíêòèðíàÿ) ïóíêòèðíàÿ ëèíèÿ; · dadot (øòðèõ-ïóíêòèðíàÿ) øòðèõ-ïóíêòèðíàÿ ëèíèÿ. Îïöèÿ Color (Öâåò) ïîçâîëÿåò âûáðàòü öâåò ëèíèè è áàçîâûõ òî÷åê: · red -êðàñíûé; · blu ñèíèé; · gm çåëåíûé; · ñóà ãîëóáîé; · bm êîðè÷íåâûé; · blà ÷åðíûé. Îïöèÿ Òóðå (Òèï) çàäàåò ñëåäóþùèå òèïû ãðàôèêà: · line (ëèíèÿ) ïîñòðîåíèå ëèíèÿìè; · points (òî÷êè) ïîñòðîåíèå òî÷êàìè; · err (èíòåðâàëû) ïîñòðîåíèå âåðòèêàëüíûìè ÷åðòî÷êàìè ñ îöåíêîé èíòåðâàëà ïîãðåøíîñòåé; · bar (ñòîëáåö) ïîñòðîåíèå â âèäå ãèñòîãðàììû; · step (ñòóïåíüêà) ïîñòðîåíèå ñòóïåí÷àòîé ëèíèåé step; · draw (ïðîòÿæêà) ïîñòðîåíèå ïðîòÿæêîé îò òî÷êè äî òî÷êè. Ñëåäóþùèå äâå îïöèè ñâÿçàíû ñ âîçìîæíîñòüþ óäàëåíèÿ ñ ãðàôèêà âñïîìîãàòåëüíûõ íàäïèñåé: Hide Argument (Ñêðûòü ïåðåìåííûå) ñïðÿòàòü îáîçíà÷åíèÿ ìàòåìàòè÷åñêèõ âûðàæåíèé ïî îñÿì ãðàôèêà; Hide Legend (Ñêðûòü èìåíà) ñïðÿòàòü îáîçíà÷åíèÿ èìåí êðèâûõ ãðàôèêà. 59
Çàäàíèå íàäïèñåé íà ãðàôèêå. Âêëàäêà Label (Íàäïèñè) ïîçâîëÿåò ââîäèòü â ðèñóíîê äîïîëíèòåëüíûå íàäïèñè. Äëÿ óñòàíîâêè íàäïèñåé ìîæíî èñïîëüçîâàòü îêíà: · Title (Çàãîëîâîê) óñòàíîâèòü òèòóëüíóþ íàäïèñü ê ðèñóíêó; · X-Axis (Õ-îñü) óñòàíîâèòü íàäïèñü ïî îñè X; · Y-Axis (Y-îñü) óñòàíîâèòü íàäïèñü ïî îñè Y.  Title îïöèÿ Show Title (Ïîêàçàòü çàãîëîâîê) ïîçâîëÿåò âêëþ÷àòü èëè âûêëþ÷àòü îòîáðàæåíèå òèòóëüíîé íàäïèñè. Çäåñü æå ñîäåðæàòñÿ îïöèè Above (Ñâåðõó) è Below (Ñíèçó) äëÿ ðàçìåùåíèÿ òèòóëüíîé íàäïèñè íàä ðèñóíêîì ëèáî ïîä íèì, êîòîðûå âêëþ÷àþòñÿ / âûêëþ÷àþòñÿ ñîîòâåòñòâóþùèìè êðóãëûìè êíîïêàìè. Àêòèâèçàöèÿ ýòèõ îïöèé çàäàåòñÿ óñòàíîâêîé æèðíîé òî÷êè â êðóæêå. Óñòàíîâëåíèå ïî óìîë÷àíèþ. Âêëàäêà Defaults (Ïî óìîë÷àíèþ) ñëóæèò äëÿ óñòàíîâêè îïöèé ãðàôèêîâ: Change to Defaults (Âåðíóòü çíà÷åíèÿ ïî óìîë÷àíèþ); Use for Defaults (Èñïîëüçîâàòü äëÿ çíà÷åíèé ïî óìîë÷àíèþ). Ïðèìåíåíèå ñïåöèàëüíîãî ãðàôè÷åñêîãî ìàðêåðà. Âûäåëèì ïîñòðîåííûé äâóõìåðíûé ãðàôèê è âûáåðåì êîìàíäó Trace èç ìåíþ Format/Graph.  ðåçóëüòàòå ïîÿâëÿåòñÿ îêíî X-Y Trace. Ùåëêíóâ ëåâîé êíîïêîé ìûøè ïî ãðàôèêó, ïîÿâèòñÿ ãðàôè÷åñêèé ìàðêåð â âèäå äâóõ ïåðåêðåùèâàþùèõñÿ ïóíêòèðíûõ ëèíèé, è åãî êîîðäèíàòû îòîáðàæàþòñÿ â îêîøêàõ: X -Value, Y Value. Ïðè âêëþ÷åííîé îïöèè Track Data Points (Ïåðåìåùåíèå ïî òî÷êàì äàííûõ) ìàðêåð ïåðåìåùàåòñÿ ïî êðèâîé ãðàôèêà, è åãî ìîæíî óñòàíîâèòü íà ëþáóþ òî÷êó ýòîé êðèâîé. Ïðè ýòîì åãî êîîðäèíàòû îòîáðàæàþòñÿ â îêîøêàõ. Êíîïêè Copy X, Copy Y ïîçâîëÿþò ñêîïèðîâàòü îòîáðàæåííûå êîîðäèíàòû òî÷êè â îêîøêàõ â áóôåð îáìåíà è âñòàâèòü çàòåì â äîêóìåíò (ðèñ. 6.13) 60
Ðèñ. 6.13. Èñïîëüçîâàíèå ãðàôè÷åñêîãî ìàðêåðà
Ïðîñìîòð ÷àñòè ãðàôèêîâ ñ óâåëè÷åíèåì. Èìååòñÿ âîçìîæíîñòü ïðîñìîòðà ñ óâåëè÷åíèåì îòäåëüíûõ ÷àñòåé ãðàôèêà ëèáî ãðàôèêîâ. Ýòî îñóùåñòâëÿåòñÿ ñ ïîìîùüþ êîìàíäû Zoom èç ìåíþ Format/Graph.  ðåçóëüòàòå ïîÿâëÿåòñÿ îêíî X-Y Zoom (ðèñ. 6.14). Ïåðåìåùåíèåì ìûøè ñ íàæàòîé ëåâîé êíîïêîé ìîæíî âûäåëèòü îïðåäåëåííóþ ÷àñòü ãðàôèêà. Ïðè ýòîì ìèíèìàëüíàÿ è ìàêñèìàëüíàÿ êîîðäèíàòû ïî îñÿì Õ è Y îòîáðàæàþòñÿ â îêíå. Ïîñëå ýòîãî ìîæíî ðåàëèçîâàòü òðè âàðèàíòà ïðîñìîòðà: Zoom (Óâåëè÷åíèå) ïðîñìîòð âûðåçàííîãî ó÷àñòêà; Unzoom (Îòìåíà óâåëè÷åíèÿ) îòìåíà ïðîñìîòðà âûðåçàííîãî ó÷àñòêà; Full View (Ïîëíûé îáçîð) ïîëíûé ïðîñìîòð.
Ðèñ. 6.14. Ïðîñìîòð ÷àñòè ãðàôèêà
61
6.6. Àíèìàöèÿ (îæèâëåíèå) ãðàôèêîâ  ïàêåòå èìååòñÿ âîçìîæíîñòü ñîçäàòü àíèìàöèîííûé ãðàôèê, òî åñòü ïîêàçàòü, êàê èçìåíÿåòñÿ ãðàôèê ôóíêöèè y = f (ax ) â çàâèñèìîñòè îò èçìåíåíèÿ ïàðàìåòðà à. Âñòðîåííàÿ öåëî÷èñëåííàÿ ïåðåìåííàÿ FRAME ïîçâîëÿåò óïðàâëÿòü àíèìàöèåé. Ïî óìîë÷àíèþ îíà èçìåíÿåòñÿ îò 0 äî 9 ñ øàãîì 1. Ôóíêöèÿ, ãðàôèê êîòîðîé ïëàíèðóåì íàáëþäàòü â ðàçâèòèè, äîëæíà áûòü ôóíêöèåé ýòîé ïåðåìåííîé. Ýòàïû ñîçäàíèÿ àíèìàöèîííîãî ãðàôèêà: · ñîçäàòü ôóíêöèþ, êîòîðàÿ çàâèñèò îò ïåðåìåííîé FRAME, è ïîñòðîèòü ãðàôèê ýòîé ôóíêöèè (ðèñ. 6.15); · âûáðàòü êîìàíäó Animate èç ðåæèìà View, â ðåçóëüòàòå ïîÿâèòñÿ äèàëîãîâîå îêíî Animate. Çàòåì ñëåäóåò âûäåëèòü ãðàôè÷åñêèé îáúåêò ïóíêòèðíîé ëèíèåé (ðèñ. 6.15); · óñòàíîâèòü âåðõíþþ (From) è íèæíþþ (To) ãðàíèöû çíà÷åíèé ïåðåìåííîé FRAME è ñêîðîñòü âûâîäà êàäðîâ â ñåêóíäó (At Frames/Sec) â äèàëîãîâîì îêíî Animate;
Ðèñ. 6.15. Ñîçäàíèå àíèìàöèè
· ùåëêíóòü ïî êíîïêå Animate. Ïîÿâèòñÿ îêíî, â êîòîðîì áóäåò ñòðîèòüñÿ ãðàôèê äëÿ êàæäîãî çíà÷åíèÿ ïåðåìåííîé 62
FRAME, è ïðîèãðûâàòåëü àíèìàöèîííûõ êàäðîâ Playback (ðèñ. 6.16).
Ðèñ. 6.16. Âîñïðîèçâîäñòâî àíèìàöèè
Äëÿ âîñïðîèçâîäñòâà àíèìàöèîííîãî ðèñóíêà íóæíî íàæàòü íà êíîïêó â âèäå òðåóãîëüíèêà . Èñïîëüçóÿ êíîïêó Save As ... â äèàëîãîâîì îêíå Animate, ìîæíî ñîõðàíèòü àíèìàöèþ ðèñóíêîâ â ôàéëå ñ ðàñøèðåíèåì .avi äëÿ äàëüíåéøåãî ïðîñìîòðà ñ ïîìîùüþ ïðîèãðûâàòåëÿ Playback â ìåíþ View. Ñ ïîìîùüþ êíîïêè Options ìîæíî âûáðàòü ïðîãðàììó âîñïðîèçâåäåíèÿ âèäåîôèëüìîâ. Ïî óìîë÷àíèþ ïàêåò ðàáîòàåò ñ ïðîãðàììîé Microsoft Video 1, êîòîðàÿ âõîäèò â ñîñòàâ OS Windows 95/98. Ìîæíî ðàáîòàòü è ñ äðóãèìè âèäåîïðîãðàììàìè, åñëè îíè èíñòàëëèðîâàíû íà êîìïüþòåðå.
63
7. Ðåøåíèå íåëèíåéíûõ óðàâíåíèé è íåðàâåíñòâ 7.1. ×èñëåííîå ðåøåíèå óðàâíåíèé Äëÿ ÷èñëåííîãî ðåøåíèÿ íåëèíåéíîãî óðàâíåíèÿ f ( x ) = 0 ìîæíî èñïîëüçîâàòü âñòðîåííóþ ôóíêöèþ root, êîòîðàÿ èìååò âèä root(f(x), x, [a,b]), ãäå f ( x ) ëåâàÿ ÷àñòü óðàâíåíèÿ, x èìÿ ïåðåìåííîé, îòíîñèòåëüíî êîòîðîé ðåøàåòñÿ óðàâíåíèå, a , b ëåâûé è ïðàâûé êîíöû îòðåçêà, íà êîòîðîì íàõîäèòñÿ êîðåíü óðàâíåíèÿ (íåîáÿçàòåëüíûå ïàðàìåòðû). Ïîèñê êîðíÿ óðàâíåíèÿ îñóùåñòâëÿåòñÿ èòåðàöèîííûì ìåòîäîì ñ çàäàííîé òî÷íîñòüþ (òî÷íîñòü ïî óìîë÷àíèþ 10 −3 ; ñèñòåìíàÿ ïåðåìåííàÿ TOL îòâå÷àåò çà òî÷íîñòü). Ïåðåä èñïîëüçîâàíèåì âñòðîåííîé ôóíêöèè root íåîáõîäèìî çàäàòü íà÷àëüíîå çíà÷åíèå ïåðåìåííîé. Ïðèìåð 7.1. Íàéòè êîðåíü óðàâíåíèÿ ( x + 1)( x + 2)( x + 3)( x + 4) = 3 ïðè ðàçëè÷íûõ íà÷àëüíûõ çíà÷åíèÿõ ïåðåìåííîé x è ðàçëè÷íîé òî÷íîñòè. Çàäàíèå ôóíêöèè ïîëüçîâàòåëÿ f ( x) := ( x + 1) ⋅ ( x + 2) ⋅ ( x + 3) ⋅ ( x + 4) − 3 x := 0 íà÷àëüíîå çíà÷åíèå root( f ( x) , x) = −0.69722352 êîðåíü óðàâíåíèÿ x := −1 íà÷àëüíîå çíà÷åíèå root( f ( x) , x) = −0.69725236 êîðåíü óðàâíåíèÿ TOL := 0.000000001 çàäàíèå íîâîé òî÷íîñòè x := 0
root( f ( x) , x) = −0.69722436
x := −1 root( f ( x) , x) = −0.69722436 Åñëè óðàâíåíèå èìååò íåñêîëüêî êîðíåé, ñëåäóåò íàðèñîâàòü ãðàôèê ôóíêöèè y = f ( x ) è âûáðàòü ïîäõîäÿùåå íà÷àëüíîå ïðèáëèæåíèå ëèáî îòðåçîê, ãäå íàõîäèòñÿ êîðåíü óðàâíåíèÿ. 64
Ïðèìåð 7.2. Íàéòè íåñêîëüêî êîðíåé óðàâíåíèÿ
sin x + sin 3x + 4 cos3 x = 0 , ïðåäâàðèòåëüíî íàðèñîâàâ ãðàôèê ôóíêöèè y = sin x + sin 3x + 4 cos3 x .
Ôóíêöèÿ ïîëüçîâàòåëÿ ëåâàÿ ÷àñòü èñõîäíîãî óðàâíåíèÿ 3
f ( x) := sin( x) + sin( 3 ⋅ x) + 4 ⋅ cos ( x) . Ãðàôèê ôóíêöèè
f ( x) 5
0
TOL := 10
4
3
2
1
0
1
2
3
4
5
x
−6
root( f ( x) , x , 2 , 3) = 2.356194 root( f ( x) , x , −4 , −3) = −3.926991 x := 1
root( f ( x) , x) = 1.570397
x := 0 root( f ( x) , x) = −0.785398 Äëÿ ðåøåíèÿ óðàâíåíèÿ f ( x ) = Pn ( x ) , ãäå Pn ( x ) = a n x n + + a n −1x n −1 + . . . + a1x + a 0 ìíîãî÷ëåí n-îé ñòåïåíè, èìååòñÿ âñòðîåííàÿ ôóíêöèÿ, ïîçâîëÿþùàÿ íàéòè ñðàçó âñå êîðíè àëãåáðàè÷åñêîãî óðàâíåíèÿ: polyroots(V), ãäå V âåêòîð ðàçìåðíîñòè n+1, ïåðâûé ýëåìåíò êîòîðîãî ðàâåí a 0 , à ïîñëåäíèé a n . Ïðèìåð 7.3. Íàéòè âñå êîðíè óðàâíåíèÿ x 4 + 4 x 3 − 2 x 2 − 12 x + 9 = 0 .
65
V :=
9 −12 −2
âåêòîð êîýôôèöèåíòîâ
4 1
polyroots ( V ) =
−3
−3 ðåøåíèå èñõîäíîãî óðàâíåíèÿ. 1
1
7.2. Ñèìâîëüíîå ðåøåíèå óðàâíåíèé Äëÿ ñèìâîëüíîãî ðåøåíèÿ óðàâíåíèÿ ñíà÷àëà ñëåäóåò ââåñòè èñõîäíîå óðàâíåíèå, èñïîëüçóÿ çíàê ðàâåíñòâà èç ïàíåëè Boolean ëèáî êîìáèíàöèþ êëàâèø Ctrl + =. Óñòàíîâèòü êóðñîð íà ïåðåìåííóþ, îòíîñèòåëüíî êîòîðîé íóæíî ðåøèòü óðàâíåíèå, è âûáðàòü êîìàíäó Solve èç ìåíþ Symbolic/Variable. Íà ýêðàíå ïîÿâëÿåòñÿ îäíî èëè íåñêîëüêî ðåøåíèé äàííîãî óðàâíåíèÿ ñ èíôîðìàöèîííûì ñîîáùåíèåì has solution(s) ëèáî ñîîáùåíèå, ÷òî íåò ðåøåíèé. Åñëè óðàâíåíèå ñîäåðæèò öåëûå êîýôôèöèåíòû, òî ðåøåíèå âûäàåòñÿ â ôîðìàòå öåëûõ ÷èñåë. Åñëè æå óðàâíåíèå ñîäåðæèò âåùåñòâåííûå ÷èñëà, òî ðåøåíèå âûäàåòñÿ â ôîðìàòå êàê âåùåñòâåííûõ, òàê è êîìïëåêñíûõ ÷èñåë. Ïðèìåð 7.4. Ðåøèòü ñ ïîìîùüþ êîìàíäû Solve äâà óðàâíåíèÿ 1 x + 4 x − 1 = 0, 2 4
−3 x
= 7 ñ ðàçëè÷íûì ôîðìàòîì ðåøåíèÿ. 66
1 2 1 2
− 3⋅x has solution(s)
7
1 ln( 7) ⋅ 3 ln( 2)
− 3⋅x has solution(s)
7.0
3
x + 4⋅x− 5
3
x + 4 ⋅ x − 5.0
has solution(s)
0
.935784974019201
1 −1 2 −1 2
+
1 ⋅ i⋅ 2
−
1 ⋅ i⋅ 2
0
has solution(s)
1. −.50000000000000000000 − 2.1794494717703367761 ⋅ −.50000000000000000000 + 2.1794494717703367761 ⋅ Ñèìâîëüíîå ðåøåíèå óðàâíåíèÿ ìîæíî ïîëó÷èòü è ñ ïîìîùüþ êîìàíäû Solve èç ïàíåëè Symbolic. Äëÿ ýòîãî íóæíî ùåëêíóòü ëåâîé êíîïêîé ìûøè ïî Solve, è íà ýêðàíå ïîÿâèòñÿ êîíñòðóêöèÿ âèäà solve, → Ñëåâà îò ñëîâà solve íóæíî ââåñòè ëåâóþ ÷àñòü óðàâíåíèÿ, ò.å. ôóíêöèþ f ( x ) , ñïðàâà ïåðåìåííóþ, îòíîñèòåëüíî êîòîðîé ðåøàåòñÿ óðàâíåíèå, è ùåëêíóòü ëåâîé êíîïêîé ìûøè â ëþáîì ìåñòå äîêóìåíòà.  ðåçóëüòàòå ïîÿâèòñÿ ðåøåíèå ýòîãî óðàâíåíèÿ: 67
2 x + 5x − 6 solve, x →
−6 1
Âòîðîé ñïîñîá: âûäåëèòü ââåäåííîå óðàâíåíèå, çàòåì ùåëêíóòü ïî êîìàíäå Solve. Ïîÿâèòñÿ êîíñòðóêöèÿ âèäà x
25.0
solve, → , x 5 è â íåé ñïðàâà îò ñëîâà solve ââåñòè èìÿ ïåðåìåííîé, îòíîñèòåëüíî êîòîðîé ðåøàåòñÿ óðàâíåíèå, è ùåëêíóòü ëåâîé êíîïêîé ìûøè â ëþáîì ìåñòå äîêóìåíòà. Ïîÿâèòñÿ ðåøåíèå óðàâíåíèÿ 5 − 24
x
25.0
5 − 24
x
1.9519812658311713983 ⋅ 1i 2.0000000000000000000
solve, x →
5 Ïðèìåð 7.5. Ðåøåíèå íåêîòîðûõ óðàâíåíèé 1. Àëãåáðàè÷åñêèå óðàâíåíèÿ b a + x−a x−b
b+a 2 solve, x → 1 ⋅b + 1 ⋅a 2 2
7 ⋅ x − 10 − 10 ⋅ x − 9
7 ⋅ x − 7 solve, x →
2
16x
2 ( x + 4)
48 −
2
x
has solution(s)
68
13 12
2⋅ 5 + 2 2 − 2⋅ 5 −6 + 2 ⋅ i ⋅ 3 −6 − 2 ⋅ i ⋅ 3
2. Èððàöèîíàëüíûå óðàâíåíèÿ 3
6 ⋅ x − 2 solve, x →
− 9⋅ x
x
1 3
3 x + 34 − x − 3 1 solve, x → 30 Â ýòîì ïðèìåðå íàõîäèòñÿ òîëüêî îäèí êîðåíü. Âòîðîé êîðåíü óðàâíåíèÿ x = 61. 3
5x − 4
−5
2x − 3.
has solution(s)
2.250000000000000 2.
3. Ïîêàçàòåëüíûå è ëîãàðèôìè÷åñêèå óðàâíåíèÿ 6 x− 6
( 2 + 1)
x+ 1
( 2 − 1.)
x
( 0.04) − 5− x ⋅ 6 + 5
−x
2.0000000000000000000 solve , x →
3.0000000000000000000
−1.00000000
has solution(s)
0
Íàõîäèòñÿ òîëüêî îäèí êîðåíü. Íåò êîðíÿ x = 0.
(3 3 − 8)x + (3 3 + 8)x
6.0
solve , x → 3.000000000000000
Íàõîäèòñÿ òîëüêî îäèí êîðåíü. Íåò êîðíÿ x = -3. log( 8) − log( x − 5) log ( x)
2
( 3)
− log x + 2
log( 2) − log( x + 7)
0
has solution(s)
has solution(s)
69
100 10
1 + 2 ⋅ log( 5 , x + 2)
log( x) −3
x
log( x + 2 , 5)
− 2
has solution(s)
10.000000000000000000 100.00000000000000000
0.01 solve, x →
log( x + 2) , 2 + log( x + 10) , 2 2
2
4.0 ⋅ log( 3 , 2)
has solution(s)
−11. −1. −3.3542486889354094095 −8.6457513110645905905 4. Òðèãîíîìåòðè÷åñêèå óðàâíåíèÿ sin( 3x) + cos ( 3x)
0
has solution(s)
−1
12 Âû÷èñëÿåòñÿ òîëüêî ÷àñòíîå ðåøåíèå ïðè n = 0. 2
( cos ( 3x) ) − cos ( 6x)
0
has solution(s)
0 1 ⋅π 3
Âû÷èñëåííûå ÷àñòíûå ðåøåíèÿ ïðè n = 0, n = 1. 70
⋅π
7.3. Ñèìâîëüíîå ðåøåíèå íåðàâåíñòâ Íåðàâåíñòâà, êàê è óðàâíåíèÿ, ìîæíî ðåøàòü ëèáî ñ ïîìîùüþ êîìàíäû Solve (Ðåøèòü) èç ìåíþ Symbolics/Variable, îòìåòèâ ïðåäâàðèòåëüíî ïåðåìåííóþ, îòíîñèòåëüíî êîòîðîé ðåøàåòñÿ íåðàâåíñòâî, ëèáî êîìàíäû Solve (Ðåøèòü) èç ïàíåëè Symbolic. Ïðèâåäåííûå íèæå ïðèìåðû ïîêàçûâàþò, ÷òî ïàêåò ñïðàâëÿåòñÿ ñ ðåøåíèåì àëãåáðàè÷åñêèõ íåðàâåíñòâ, íî íå ðåøàåò èëè ðåøàåò íåêîððåêòíî èððàöèîíàëüíûå, ïîêàçàòåëüíûå è ëîãàðèôìè÷åñêèå íåðàâåíñòâà. Ïðèìåð 7.6. Ðåøåíèå àëãåáðàè÷åñêèõ íåðàâåíñòâ: x− 2 x+ 2 ≤ 3⋅x− 1 2⋅x+ 1
has solution(s)
x ≤ −8 −1 2 < x ⋅ ( x ≤ 1 < x 3
2 x − 5⋅x+ 6 < 0 solve, x → ( 2 < x) ⋅ ( x < 3) x +7
(x
2
( −2 < x) ⋅ ( x < ( 0 < x) ⋅ ( x <
2 + x + 1) − 4 ⋅ (x + x + 1) + 3 < 0 solve, x → 2
Ïðèìåð 7.7. Ðåøåíèå èððàöèîíàëüíûõ íåðàâåíñòâ: x+ 2⋅ x+ 8 < 0
2⋅ x− 1 x− 2
<1
has solution(s)
has solution(s)
71
x < −2
x< 2 5<x
Ïðèâåäåííûå ïðèìåðû ïîêàçûâàþò, ÷òî ïàêåò íàõîäèò ðåøåíèå èððàöèîíàëüíûõ óðàâíåíèé, íå ó÷èòûâàÿ îáëàñòü äîïóñòèìûõ çíà÷åíèé, ëèáî âîîáùå íå íàõîäèò ðåøåíèå. Ïðèìåð 7.8. Ðåøåíèå ïîêàçàòåëüíûõ è ëîãàðèôìè÷åñêèõ íåðàâåíñòâ: 2⋅x−3
(5 )
x 2 −1 −
5 < x 3
has solution(s)
> 5
Ýòî íåïðàâèëüíîå ðåøåíèå. Ðåøåíèåì äàííîãî ïîêàçàòåëüíîãî íåðàâåíñòâà ÿâëÿåòñÿ ðåøåíèå íåðàâåíñòâà − ( 2 ⋅ x − 3) > 1 x− 2
(2
has solution(s)
5 < x ⋅ ( x < 2 . 3
)
log x − 4 ⋅ x + 3 , 8 < 1 solve, x → ( −1 < x) ⋅ ( x < 5) . Ýòî ðåøåíèå íåïðàâèëüíîå, ò.ê. ïàêåò ðåøàåò òîëüêî íåðàâåíñòâî, ïîëó÷åííîå ïîñëå ïðåîáðàçîâàíèÿ ëîãàðèôìîâ 2
x − 4 ⋅ x + 3 < 8 solve, x → ( −1 < x) ⋅ ( x < 5) , íå ó÷èòûâàÿ ïðè ýòîì îáëàñòü äîïóñòèìûõ çíà÷åíèé
x< 1 3< x
2
x − 4 ⋅ x + 3 > 0 solve, x → log
3
8 − 2x
, x ≥ −2
has solution(s)
x< 1 4 ≤x 3
Ïðàâèëüíîå ðåøåíèå ýòîãî óðàâíåíèÿ x ∈ (0,1) ∪ (1, 4) 72
8. Ðåøåíèå cèñòåì óðàâíåíèé 8.1. ×èñëåííîå è ñèìâîëüíîå ðåøåíèå ñèñòåì ëèíåéíûõ àëãåáðàè÷åñêèõ óðàâíåíèé Íåîäíîðîäíàÿ ñèñòåìà ëèíåéíûõ àëãåáðàè÷åñêèõ óðàâíåíèé (ÑËÀÓ) â ìàòðè÷íîé ôîðìå èìååò âèä AX = B. Èçâåñòíî, ÷òî íåîäíîðîäíàÿ ÑËÀÓ ñîâìåñòíà (òåîðåìà Êðîíåêåðà-Êàïåëëè), åñëè ðàíã ðàñøèðåííîé ìàòðèöû ðàâåí ðàíãó ìàòðèöû ñèñòåìû, ò.å. rank(A) = rank(A|B). Ñîâìåñòíàÿ ñèñòåìà èìååò åäèíñòâåííîå ðåøåíèå, åñëè rank(A) = rank(A|B) = n, n ðàçìåðíîñòü ìàòðèöû À. Ðåøåíèå ÑËÀÓ â ìàòðè÷íîé ôîðìå èìååò âèä X = A −1 * B , ãäå A −1 îáðàòíàÿ ìàòðèöà ê ìàòðèöå À.  MathCAD äëÿ ðåøåíèÿ ÑËÀÓ èìåþòñÿ âñòðîåííàÿ ôóíêöèÿ lsolve(A,B) è ðåøàþùèé áëîê Give Find. Ïðèìåð 8.1. Ðåøèòü ñèñòåìó ìàòðè÷íûì ìåòîäîì è ñ ïîìîùüþ âñòðîåííîé ôóíêöèè: x − y − 3z = 3 3x + 4 y − 5z = − 8 2 y + 7 z = 17
A :=
−1 −3 3 4 −5 2
2
0
7
3 B := −8 17
Âû÷èñëåíèå ðàíãà èñõîäíîé ìàòðèöû è ðàñøèðåííîé. Âñòðîåííàÿ ôóíêöèÿ augment(A,B) îáúåäèíÿåò äâå ìàòðèöû, èìåþùèå îäèíàêîâîå êîëè÷åñòâî ñòðîê, â îäíó. rank ( A) = 3 −
rank ( augment ( A , B) ) = 3
X1 := lsolve( A , B) X := A ⋅ B Âûâîä ðåøåíèÿ, ïîëó÷åííîãî ìàòðè÷íûì ìåòîäîì è ñ ïîìîùüþ âñòðîåííîé ôóíêöèè lsolve(A,B): 1
73
5 X = −2 3
5 X1 = −2 3
Ðåøàþùèé áëîê Give-Find ìîæíî ïðèìåíÿòü òàêæå è äëÿ ðåøåíèÿ ñèñòåì íåëèíåéíûõ óðàâíåíèé êàê â ÷èñëåííîì, òàê è â ñèìâîëüíîì âèäå. Äëÿ ÷èñëåííîãî ðåøåíèÿ ñ ïîìîùüþ ðåøàþùåãî áëîêà íóæíî çàäàòü íà÷àëüíûå çíà÷åíèÿ äëÿ íåèçâåñòíûõ âåëè÷èí è çàêëþ÷èòü óðàâíåíèÿ â êëþ÷åâûå ñëîâà, íà÷èíàþùèåñÿ ñî ñëîâà Given è çàêàí÷èâàþùèåñÿ ñëîâîì Find(var1, var2, . . .) co çíàêîì = . Äëÿ ñèìâîëüíîãî ðåøåíèÿ ñèñòåìû íå íàäî ââîäèòü íà÷àëüíûå çíà÷åíèÿ, à âìåñòî çíàêà = ââåñòè ñèìâîëüíûé çíàê ðàâíî → èç ïàíåëè Evaluation. Ïðèìåð 8.2. Èñïîëüçóÿ ðåøàþùèé áëîê Give-Find, íàéòè ðåøåíèå íåîäíîðîäíîé ñèñòåìû x + 5y − z = 3 2 x + 4 y − 3z = 2 3x − y − 3z = − 7
Èñõîäíûå äàííûå 1 5 −1 A := 2 4 −3 3 −1 −3
3 B := 2 −7
Âû÷èñëåíèå ðàíãà ìàòðèöû À è ðàñøèðåííîé ìàòðèöû rank( A ) = 3 rank( augment ( A , B) ) = 3 Çàäàíèå íà÷àëüíûõ óñëîâèé äëÿ íåèçâåñòíûõ âåëè÷èí x := 0
y := 0
z := 0
Íà÷àëî ðåøàþùåãî áëîêà è ñèñòåìà óðàâíåíèé 74
Given x+ 5⋅y− z
3
2x + 4 ⋅ y − 3 ⋅ z 3⋅x−
2
y− 3⋅z
−7
Íàõîæäåíèå ðåøåíèÿ ñèñòåìû
−4 1 Find ( x , y , z) = −2 Ïðèìåð 8.3. Èñïîëüçóÿ ðåøàþùèé áëîê Give-Find, íàéòè ñèìâîëüíîå ðåøåíèå ÑËÀÓ âèäà
Given x− a⋅y a⋅x− 4⋅y
x − ay = b ax − 4 y = a + b + 1
b a+ b+ 1
(a2 + a ⋅ b + a − 4 ⋅ b) (−4 + a2) find( x , y) → −( a ⋅ b − a − b − 1) ( − 4 + a2)
Åñëè rank(A) = rank(A|B) < n, òî, èñïîëüçóÿ âñòðîåííóþ ôóíêöèþ rref(A), íóæíî ïðèâåñòè ìàòðèöó ê ñòóïåí÷àòîìó âèäó è âûáðàòü áàçèñíûå è ñâîáîäíûå (ïðîèçâîëüíûå) ïåðåìåííûå è íàéòè ðåøåíèå ñèñòåìû â çàâèñèìîñòè îò âûáðàííûõ ñâîáîäíûõ ïåðåìåííûõ. 75
Ïðèìåð 8.4. Íàéòè ðåøåíèå ñèñòåìû AX = B, ãäå ìàòðèöà À è âåêòîð Â èìåþò âèä
1 2 1 1 A := 0 1 1 1 1 1 0 0
5 3 2
B
Âû÷èñëåíèå ðàíãîâ ìàòðèö: rank(A)=2
rank(augment(A, B)) = 2
Ïðèâîäèì ðàñøèðåííóþ ìàòðèöó ñ ïîìîùüþ âñòðîåííîé ôóíêöèè rref(A) ê ñòóïåí÷àòîìó âèäó:
1 0 − 1 − 1 − 1 rref ( augment( A , B) ) = 0 1 1 1 3 0 0 0 0 0  êà÷åñòâå áàçèñíûõ ïåðåìåííûõ âûáèðàåì X1, X2; ðåøåíèå ñèñòåìû áóäåò çàâèñåòü îò ñâîáîäíûõ ïåðåìåííûõ X3, X4:
−1 + x3 + x4 3 − x3 − x4 X( x3 , x4) := x3 x4 Íåêîòîðûå ðåøåíèÿ ñèñòåìû:
X ( 1 , 0) =
0 2 1 0
X ( 1 , 3) = 76
3 −1 1 3
Îäíîðîäíàÿ ÑËÀÓ AX = 0 èìååò íóëåâîå ðåøåíèå, åñëè ðàíã ìàòðèöû À ðàâåí êîëè÷åñòâó íåèçâåñòíûõ âåëè÷èí, â ïðîòèâíîì ñëó÷àå ñèñòåìà èìååò áåñêîíå÷íîå ìíîæåñòâî ðåøåíèé. Åñëè rang(A) < n, òî ñ ïîìîùüþ âñòðîåííîé ôóíêöèè rref(A) íóæíî ïðèâåñòè ìàòðèöó ê ñòóïåí÷àòîìó âèäó è âûáðàòü áàçèñíûå è ñâîáîäíûå (ïðîèçâîëüíûå) ïåðåìåííûå. Äàëåå íàõîäèì ðåøåíèå ñèñòåìû â çàâèñèìîñòè îò ñâîáîäíûõ ïåðåìåííûõ. Ïðèìåð 8.5. Íàéòè ðåøåíèÿ ñëåäóþùèõ îäíîðîäíûõ ÑËÀÓ 3x + 4 y − z = 0 , 2 x − 4 y + 5z = 0 , 2. x − 3y + 5z = 0 , 1. x + 2 y − 3z = 0 , 4 x + y + 4z = 0 . 3x − y + 2 z = 0 Âû÷èñëÿåì ðàíã ìàòðèöû ïåðâîé ñèñòåìû
2 −4 5 A := 1 2 −3 3 −1 2
rank( A) = 3
Ïåðâàÿ ñèñòåìà èìååò òîëüêî íóëåâîå ðåøåíèå. Âû÷èñëÿåì ðàíã ìàòðèöû âòîðîé ñèñòåìû:
3 4 −1 A := 1 −3 5 4 1 4
rank( A) = 2
Âòîðàÿ îäíîðîäíàÿ ñèñòåìà èìååò áåñêîíå÷íîå ìíîæåñòâî ðåøåíèé Given 3⋅x+ 4⋅y− z
0
x− 3⋅y+ 5⋅z
0
4⋅x+ y+ 4⋅z
0 77
Find( x , y , z) →
− 17 13
⋅z
16 ⋅z 13 z
 êà÷åñòâå ñâîáîäíîé ïåðåìåííîé âûáðàíà ïåðåìåííàÿ z. 8.2. Âû÷èñëåíèå ñîáñòâåííûõ çíà÷åíèé è âåêòîðîâ Äëÿ âû÷èñëåíèÿ ñîáñòâåííûõ çíà÷åíèé ìàòðèöû À ìîæíî èñïîëüçîâàòü âñòðîåííóþ ôóíêöèÿ eigenvals(A). Äëÿ íàõîæäåíèÿ ñîáñòâåííîãî âåêòîðà, ñîîòâåòñòâóþùåãî ñîáñòâåííîìó çíà÷åíèþ λ ìàòðèöû À, ñëåäóåò âûáðàòü âñòðîåííóþ ôóíêöèþ eigenvec(A, λ ). Âñòðîåííàÿ ôóíêöèÿ eigenvecs(A) íàõîäèò âñå ñîáñòâåííûå âåêòîðû ìàòðèöû A. Ïðèìåð 8.6. Íàéòè ñîáñòâåííûå çíà÷åíèÿ è âåêòîðû ìàòðèöû âèäà A :=
2.2 2 0.5 2 1 1.3 2
1
0.5 2 0.5 1.6 2
1 1.6 2
Ñîáñòâåííûå çíà÷åíèÿ èñõîäíîé ìàòðèöû
λ := eigenvals( A)
λ = 78
0.540693 − 1.529036 1.111817 5.876526
Ñîáñòâåííûå âåêòîðû ìàòðèöû À
Sv := eigenvecs( A)
Sv =
0.59188 −0.24537
0.3747
−0.41
0.42105 −0.56721 −0.48282 0.636 0.38175 −0.05413 0.68974
0.402
−0.38825 −0.51
0.57155 0.78431
Ïåðâûé ñòîëáåö ìàòðèöû Sv ñîîòâåòñòâóåò ïåðâîìó ñîáñòâåííîìó çíà÷åíèþ λ = 5.876526, âòîðîé ñòîëáåö âòîðîìó ñîáñòâåííîìó çíà÷åíèþ λ = 0.5406393 è ò.ä. Äëÿ âûïîëíåíèÿ ïðîâåðêè ñëåäóåò óìíîæèòü èñõîäíóþ ìàòðèöó À íà ñîáñòâåííûé âåêòîð, êîòîðûé ñîîòâåòñòâóåò ïåðâîìó ñîáñòâåííîìó çíà÷åíèþ, è âû÷åñòü ïðîèçâåäåíèå ñîáñòâåííîãî çíà÷åíèÿ íà ñîîòâåòñòâóþùèé ñîáñòâåííûé âåêòîð, ò.å Aλ − λX = 0 : 0
A ⋅ Sv
0
− λ
0 ⋅
Sv
0
=
0 0 0
8.3. Ðåøåíèå ñèñòåì íåëèíåéíûõ óðàâíåíèé Ñèñòåìû íåëèíåéíûõ óðàâíåíèé â îñíîâíîì ðåøàþòñÿ ÷èñëåííûìè ìåòîäàìè. Ïðèìåð 8.7. Èñïîëüçóÿ ðåøàþùèé áëîê, ðåøèòü ñèñòåìó sin( 2 x − y) − 1,2 x = 0,4, 0,8 x 2 + 1,5 y 2 = 1 .
Íà÷àëüíûå çíà÷åíèÿ x := 0 y := 0 . Íàõîäèì ðåøåíèå ñèñòåìû ñ ïîìîùüþ áëîêà Given Find Given 79
sin( 2x − y) − 1.2x 2
2
0.8x + 1.5y
0.4
1
− 0.43906 − 0.7509
Find ( x , y) =
Åñëè âçÿòü äðóãèå íà÷àëüíûå çíà÷åíèÿ, òî ïîëó÷èì åùå îäíî ðåøåíèå èñõîäíîé ñèñòåìû x := 0.5
y := 0.5
sin( 2x − y) − 1.2x 2
2
0.8x + 1.5y
0.4
1
− 0.43906 − 0.7509
Find ( x , y) =
Ïðèìåð 8.8. Íàéòè òî÷êè ïåðåñå÷åíèÿ îêðóæíîñòè
2 x 2 + y 2 = 2 è ïàðàáîëû y = x .
Ñèìâîëüíîå ðåøåíèå ñèñòåìû óðàâíåíèé
y− x 2 2 x +y 2
0
2.
solve,
1. x −1. → y −1.4142135623730950488⋅ i ⋅ 1.4142135623730950488i
80
9. Âû÷èñëåíèå ïðåäåëîâ, ñóìì, ïðîèçâåäåíèé  MathCAD èìåþòñÿ ñïåöèàëüíûå îïåðàòîðû äëÿ âû÷èñëåíèÿ ïðåäåëîâ, êîíå÷íûõ è áåñêîíå÷íûõ ñóìì, ïðîèçâåäåíèé. Ïèêòîãðàììû ýòèõ îïåðàòîðîâ ðàñïîëîæåíû â ïàíåëè Calculus. 9.1. Ñèìâîëüíîå âû÷èñëåíèå ïðåäåëîâ Ñèìâîëüíîå âû÷èñëåíèå ïðåäåëîâ ìîæíî âûïîëíÿòü äâóìÿ ñïîñîáàìè. Ïåðâûé ñïîñîá. Ââåñòè îïåðàòîð ïðåäåëà, èñïîëüçóÿ ïàíåëü Calculus. Çàòåì çàäàòü ïðåäåë äëÿ ïåðåìåííîé è âûðàæåíèå, ïðåäåë êîòîðîãî íóæíî âû÷èñëèòü (ðèñ. 9.1).
lim
lim ( x + − x→∞
lim + x→1
x→
Ðèñ. 9.1. Îïåðàòîð ïðåäåëà
Ïîñëå ýòîãî íóæíî âûäåëèòü âñå âûðàæåíèå è âûïîëíèòü êîìàíäó Symplify èç ìåíþ Symbolics ëèáî êîìàíäó Symbolically èç ìåíþ Symbolics/Evaluate.  ðåçóëüòàòå íà ýêðàíå ïîÿâèòñÿ èñêîìîå çíà÷åíèå ïðåäåëà èëè ñîîáùåíèå îá îøèáêå. Ïðèìåð 9.1. Âû÷èñëèòü ïðåäåë âûðàæåíèÿ 3
lim
27 +
3 x − 27 − x 3
x→0
4 x + 2⋅ x
,
èñïîëüçóÿ êîìàíäó Symplify è Symbolically. Ðåçóëüòàò âû÷èñëåíèÿ ïî êîìàíäå Symplify 3
lim
27 +
3 x − 27 − x
2
simplifies to
27
3
x→0
4 x + 2⋅ x
Ðåçóëüòàò âû÷èñëåíèÿ ïî êîìàíäå Symbolically 3
lim
x→0
27 +
3 x − 27 − x 3
x + 2⋅ x
yields
2 81
4
81
⋅3 27
Èç ïðèâåäåííûõ ïðèìåðîâ âèäíî, ÷òî ðåçóëüòàòîì âû÷èñëåíèÿ ïî êîìàíäå Symplify ÿâëÿåòñÿ ðàöèîíàëüíîå ÷èñëî, à ïî êîìàíäå Symbolically íåò. Ïðèìåð 9.2. Âû÷èñëåíèå ëåâîñòîðîííèõ è ïðàâîñòîðîííèõ ïðåäåëîâ ñ ïîìîùüþ êîìàíäû Symplify: x
simplifies to
lim x x→0 + lim + x→0
1
1 simplifies to
1
1+
e
0
x
lim atan − 1 − x x→1 1
1 simplifies to
2
⋅π
Ïðèìåð 9.3. Âû÷èñëåíèå ïðåäåëîâ íà áåñêîíå÷íîñòè
(
2
)
1+
2 2 x+ x − 1− x+ x
lim acos x + x − x
x→∞
lim − x→∞
(
simplifies to
1 3
)
⋅π
simplifies to
Âòîðîé ñïîñîá. Äëÿ âû÷èñëåíèÿ ïðåäåëîâ ìîæíî èñïîëüçîâàòü çíàê ñèìâîëüíîãî ðàâåíñòâà → . Ïðèìåð 9.4. Âû÷èñëåíèå ïðåäåëîâ ñ ïîìîùüþ ñèìâîëüíîãî ðàâåíñòâà lim ( x − ln( cosh( x) ) ) → ln( 2)
x→∞
sin( x) − sin( a) → cos ( a) x− a x→a lim
82
x
a
a −x a a lim → a ⋅ ln( a) − a x− a x→a x2 1 x+ y lim 1 + x y →a
lim x→∞
→ exp( 1)
Ïðèìåð 9.5. Íàéòè íàêëîííóþ àñèìïòîòó ôóíêöèè x 2 − 3x − 2 è íàðèñîâàòü åå ãðàôèê. x +1
Ñîçäàíèå ïîëüçîâàòåëüñêîé ôóíêöèè x − 3⋅x− 2 x+ 1 Âû÷èñëåíèå êîýôôèöèåíòîâ íàêëîííîé ïðÿìîé 2
f ( x) :=
f ( x) → 1 lim ( f ( x) − x) → −4 x x→∞ x→∞ nl(x):= x - 4 ýòî íàêëîííàÿ àñèìïòîò lim
20
20
−1 10
axes Y
y=
f ( x) nl( x)
0
0 10
− 20
20
5
−5
2.5
0
2.5
x
5 5
axes X
Ðèñ. 9.2. Ãðàôèê ôóíêöèè y =
83
x 2 − 3x − 2 x +1
9.2. Âû÷èñëåíèå ñóìì è ïðîèçâåäåíèé Îïåðàòîð ñóììû (ïðîèçâåäåíèÿ) ìîæíî ââåñòè, èñïîëüçóÿ ïàíåëü Calculus. Çàòåì çàäàòü ïðåäåëû èçìåíåíèÿ èíäåêñà, â ñîîòâåòñòâóþùèõ ÿ÷åéêàõ íàä è ïîä ñèìâîëîì ñóììû (ïðîèçâåäåíèÿ), à ïîñëå çíàêà ñóììû (ïðîèçâåäåíèÿ) ââåñòè âûðàæåíèå, çàäàþùåå îòäåëüíîå ñëàãàåìîå ëèáî ìíîæèòåëü (ðèñ. 9.3.). 10
∑
=1
n
n
∏
∑
n
∏
k
n
k= 1
k
1 k( k + 1)
Ðèñ. 9.3. Îïåðàòîðû ñóììû è ïðîèçâåäåíèÿ
Ïðèâåäåííûå âûøå îïåðàòîðû ìîãóò âûïîëíÿòü êàê ÷èñëåííûå, òàê è ñèìâîëüíûå âû÷èñëåíèÿ. Äëÿ ÷èñëåííîãî âû÷èñëåíèÿ ñóììû (ïðîèçâåäåíèÿ) ñëåäóåò ââåñòè çíàê =, è ïîñëå ââåäåííîãî âûðàæåíèÿ ïîÿâèòñÿ ÷èñëåííûé ðåçóëüòàò. Ïðèìåð 9.6. Âû÷èñëåíèå êîíå÷íûõ ñóìì è ïðîèçâåäåíèé
( −1) k k⋅ ( k + 1) ⋅ ( 2⋅ k + 1)
20
∑ k
=1
20
35
∑ ∑ n
=1
1
=1
k
( 4⋅ k − 1)
x := 4
∑ k
k+ 1
∏ k
=
3
=
0.171514
k := 0 .. 50
( −1) ( 2 ⋅k)!
100
2 ⋅n
= −0.141566
x ⋅ 3
4⋅ k
= 0.205507
2 π π 1 − 2 ⋅ sec = k 2k
84
0.868859
10
Ïðèìåð 9.7. Âû÷èñëèòü ñóììó S = ∑ a i + b i , ãäå êîýôôèi =1
öèåíòû âû÷èñëÿþòñÿ ïî ôîðìóëàì: i / 2, åñëè i − ÷åòíîå, ai = i , åñëè i − íå÷åòíîå,
2 i, åñëè i − ÷åòíîå, bi = 3 i , åñëè i − íå÷åòíîå.
Âû÷èñëåíèå êîýôôèöèåíòîâ i := 1 .. 10
ai := if mod( i, 2)
i 0, ,i 2
bi := if( mod( i, 2)
0,2 ⋅ i
Âû÷èñëåíèå ñóììû S :=
∑
ai + bi
S = 39.9712051
i
Äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ ñóììû (ïðîèçâåäåíèÿ) âåðõíèé èíäåêñ íóæíî çàäàòü íåîïðåäåëåííîé ïåðåìåííîé ëèáî ∞ . Çàòåì âûäåëèòü âñå âûðàæåíèå è âûáðàòü êîìàíäó Symplify èëè Factor èç ìåíþ Symbolics ëèáî êîìàíäó Symbolically èç ìåíþ Symbolics/Evaluate.  ðåçóëüòàòå ïîÿâèòñÿ èñêîìîå çíà÷åíèå ñóììû (ïðîèçâåäåíèÿ) èëè ñîîáùåíèå îá îøèáêå. Äëÿ ñèìâîëüíîãî âû÷èñëåíèÿ ìîæíî òàêæå èñïîëüçîâàòü çíàê ñèìâîëüíîãî ðàâåíñòâà → . n
Ïðèìåð 9.8. Âû÷èñëèòü ñóììó ∑ i i =1
n
∏ 1 −
k =1
2
è ïðîèçâåäåíèå
1 , èñïîëüçóÿ êîìàíäû Symplify, Factor, Symbolically. k2 85
n
∑
2
i
1 3 1 2 1 ⋅n + ⋅n + ⋅n 3 2 6
simplifies to
=1
i
n
∑
2
i
by factoring, yields
=1
i
n
∑
2
i
1 1 1 3 1 2 ⋅( n + 1) − ⋅( n + 1) + ⋅n + 3 2 6 6
yields
=1
i
n
∏
k=2 n
∏
k=2 n
∏
k=2
1 ⋅n⋅( n + 1) ⋅( 2 ⋅n + 1) 6
1 − 1 2 k
1 ⋅( n + 1) ( 2 ⋅n)
simplifies to
1 − 1 2 k
by factoring, yields
1 − 1 2 k
Γ (n + 2 1 ⋅Γ ( n) ⋅ 2 Γ (n + 1
Γ ( n + 2) 1 ⋅Γ ( n) ⋅ 2 2 Γ ( n + 1)
yields
Ïðèìåð 9.9. Âû÷èñëåíèå íåêîòîðûõ ñóìì è ïðîèçâåäåíèé ∞
∑
1
simplifies to
i
2
=0 2
i
∑
(k
1 .. ∞ )
1 ( 2 ⋅k − 1)
2
→
1 2 ⋅π 8 86
∞
∞
∑ ∑
l
1
= 1 k = 1 ( 4l − 1) ∞
∏
k=2 ∞
∏
k=1
n →∞
by factoring, yields
3
k +1 1 1 − → 1 ⋅π 2 4 ( 2k + 1)
∑
k
2k − 1 2
=1
→3
k
n
lim
n →∞
∏ 1 + nk → exp 12
k=1
2
1 ⋅ln( 2) 4
simplifies to
3
k −1
n
lim
2k
87
2 3
10. Âû÷èñëåíèå ïðîèçâîäíûõ, èíòåãðàëîâ. Çàäà÷è íà ýêñòðåìóì 10.1. Âû÷èñëåíèå ïðîèçâîäíûõ Ñèìâîëüíîå âû÷èñëåíèå ïðîèçâîäíûõ ìîæíî âûïîëíÿòü òðåìÿ ñïîñîáàìè. Ïåðâûé ñïîñîá. Ââåñòè âûðàæåíèå è îòìåòèòü êóðñîðîì ïåðåìåííóþ, ïî êîòîðîé ïðîèçâîäèòñÿ äèôôåðåíöèðîâàíèå. Çàòåì âûïîëíèòü êîìàíäó Differentiate èç ìåíþ Symbolics/Variable. Ïðåäâàðèòåëüíî íóæíî óñòàíîâèòü â Symbolics/Evaluation Style îïöèþ Horizontally è îòìåòèòü îêîøêî Show Comments äëÿ âûâîäà ðåçóëüòàòà è êîììåíòàðèé â îäíîé ñòðîêå. Ïðèìåð 10.1. Âû÷èñëèòü ïðîèçâîäíóþ ñ ïîìîùüþ êîìàíäû Differentiate: sin( ax + b)
2
2 ⋅ sin( ax +
by differentiation, yields
x a −x 2
2
2
1
by differentiation, yields
(a
2
−x) 2
b) ⋅ cos ( ax
1 2
+
x
(a2 − x2
cos ( 2 ⋅ x) sin( 2 ⋅ x) Âòîðîé ñïîñîá. Ââåñòè îïåðàòîð äèôôåðåíöèðîâàíèÿ, èñïîëüçóÿ ïàíåëü Calculus (ðèñ.10.1).  íèæíåé ÿ÷åéêå óêàçàòü ïåðåìåííóþ, ïî êîòîðîé ïðîèçâîäèòñÿ äèôôåðåíöèðîâàíèå, çàòåì ââåñòè äèôôåðåíöèðóåìîå âûðàæåíèå. Âûäåëèòü åãî è âûáðàòü êîìàíäó Symbolically èç ìåíþ Symbolics/Evaluate. ln( sin( 2x) )
2⋅
by differentiation, yields
d2
d dx
2
f ( x)
dx
Ðèñ. 10.1. Îïåðàòîðû äèôôåðåíöèðîâàíèÿ
88
Ïðèìåð 10.2. Âû÷èñëèòü ïðîèçâîäíóþ ñ ïîìîùüþ êîìàíäû Symbolically d sin( ln( x) ) dx
cos ( ln( x) ) x
yields
(a x3 + b ⋅ x + c)
yields
6⋅a⋅x
d ( 2 x ⋅ y + sin( x ⋅ y) ) dx
yields
2⋅ x⋅ y +
d2 2
dx
cos ( x ⋅ y) ⋅ y
Òðåòèé ñïîñîá. Ââåñòè îïåðàòîð äèôôåðåíöèðîâàíèÿ, çàòåì ñèìâîëüíûé çíàê ðàâåíñòâà → (ââîäèòñÿ ñ èñïîëüçîâàíèåì ñîîòâåòñòâóþùåé ïèêòîãðàììû íà ïàíåëè Symbolic ëèáî êîìáèíàöèåé êëàâèø Ctrl + → ) è ùåëêíóòü ëåâîé êíîïêîé ìûøè â ëþáîì ñâîáîäíîì ìåñòå äîêóìåíòà. Íà ýêðàíå ïîÿâèòñÿ ðåçóëüòàò âû÷èñëåíèÿ. Ïðåèìóùåñòâî ýòîãî ñïîñîáà âû÷èñëåíèÿ ïðîèçâîäíûõ çàêëþ÷àåòñÿ â àâòîìàòè÷åñêîì îáíîâëåíèè ðåçóëüòàòà ïðè èçìåíåíèè èñõîäíîãî âûðàæåíèÿ. Ïðèìåð 10.3. Âû÷èñëèòü ïðîèçâîäíóþ ñ ïîìîùüþ ñèìâîëüíîãî çíàêà ðàâåíñòâà. 2 2 f ( x , y) := x ⋅ y + y ⋅ x d 2 f ( x , y) → 2 ⋅ x ⋅ y + y dx
d 2 f ( x , y) → x + 2 ⋅ x ⋅ y dy
k
k
k ( 1 − x) k d ( 1 − x) → −( 1 − x) ⋅ − ⋅ ( 1 − x) ⋅ ( 1 + x) n ( 1 + x) n ( 1 dx ( 1 + x) n d dx
n
n
n
cos ( n ⋅ x) ⋅ sin( x) → −sin( n ⋅ x) ⋅ n ⋅ sin( x) + cos ( n ⋅ x) ⋅ sin( x) ⋅ n ⋅
89
c s
Ïðèìåð 10.4. Ïîêàçàòü, ÷òî ôóíêöèÿ u ( x, y) = e x ( x cos y − y sin y) óäîâëåòâîðÿåò óðàâíåíèþ Ëàïëàñà
∂ 2 u ( x , y) ∂x 2
+
∂ 2u ( x , y) ∂y 2
= 0.
x
u( x , y) := e ⋅( x⋅cos ( y) − y⋅sin( y) ) f ( x , y) :=
g( x , y) :=
d2 2
dx
u( x , y) → exp ( x) ⋅( x⋅cos ( y) − y⋅sin( y) ) + 2⋅exp( x)
d2 2
dy
u( x , y) → exp( x) ⋅( −x⋅cos ( y) − 2 ⋅cos ( y) + y⋅si
f ( x , y) + g( x , y) simplify → 0 .
Äëÿ âû÷èñëåíèÿ çíà÷åíèÿ ïðîèçâîäíîé â òî÷êå (÷èñëåííîå äèôôåðåíöèðîâàíèå) ïîñòóïàþò ñëåäóþùèì îáðàçîì: íóæíî ïðèñâîèòü ïåðåìåííîé ÷èñëåííîå çíà÷åíèå, ââåñòè îïåðàòîð äèôôåðåíöèðîâàíèÿ ñ ñîîòâåòñòâóþùåé ïåðåìåííîé è äèôôåðåíöèðóåìûì âûðàæåíèåì è çíàê =.  ðåçóëüòàòå ïîÿâèòñÿ ÷èñëåííûé ðåçóëüòàò. Ïðèìåð 10.5. Âû÷èñëèòü çíà÷åíèå ïðîèçâîäíîé â òî÷êå x := 2
(
)
2 d cos x + x + 1 = −3.284933. dx
10.2. Âû÷èñëåíèå èíòåãðàëîâ Âûïîëíèòü ñèìâîëüíîå èíòåãðèðîâàíèå, êàê è äèôôåðåíöèðîâàíèå, ìîæíî òðåìÿ ñïîñîáàìè. Ïåðâûé ñïîñîá. Ââåñòè èíòåãðèðóåìîå âûðàæåíèå è óêàçàòü ïåðåìåííóþ, îòíîñèòåëüíî êîòîðîé ïðîèçâîäèòñÿ èíòåãðèðîâàíèå, çàòåì âûïîëíèòü êîìàíäó Integrate èç Symbolics/ Variable. Ïðèìåð 10.6. Âû÷èñëèòü èíòåãðàëû ñ ïîìîùüþ êîìàíäû Integrate 90
1
cos ( 3 ⋅x)
2
1
by integration, yields
2 x + 4⋅x + 20
4 1
by integration, yields
6
⋅atan ⋅x + 1
4
1 2
⋅cos ( 3 ⋅x) ⋅sin( 3 ⋅x) +
Âòîðîé ñïîñîá. Ââåñòè íåîïðåäåëåííûé ëèáî îïðåäåëåííûé îïåðàòîð èíòåãðèðîâàíèÿ, èñïîëüçóÿ ñîîòâåòñòâóþùèå ïèêòîãðàììû ïàíåëè Calculus (ðèñ. 10.2). ⌠ 1 dx x ⌡
∞
⌠ cos ( x d ⌡0
Ðèñ. 10.2. Íåîïðåäåëåííûé è îïðåäåëåííûé îïåðàòîðû èíòåãðèðîâàíèÿ
Ïîñëå ââîäà îïåðàòîðà èíòåãðèðîâàíèÿ ñëåäóåò ââåñòè ïîäûíòåãðàëüíóþ ôóíêöèþ è ïåðåìåííóþ èíòåãðèðîâàíèÿ, çàòåì âûäåëèòü âñå âûðàæåíèå è âûáðàòü êîìàíäó Symbolically èç ìåíþ Symbolics/Evaluate. Ïðèìåð 10.7. Âû÷èñëèòü íåîïðåäåëåííûå èíòåãðàëû ñ ïîìîùüþ êîìàíäû Symbolically ⌠ sin( ln( x) ) dx ⌡
2
⌠ 1 dx 2 2 2 x⋅ x +a ⌡ ⌠ 1 dx 3 + 5⋅cos ( x) ⌡
1
yields
⋅x⋅( sin( ln( x) ) − cos ( ln(
−1
yields
(a ⋅x) 2
yields
−1 4
⋅ln tan ⋅x − 2 +
91
1
2
⋅(x + a 2
1 4
1 ) 2
2
⋅ln tan ⋅x
1
2
Èñïîëüçóÿ îïðåäåëåííûé îïåðàòîð èíòåãðèðîâàíèÿ, ñõîäíûì îáðàçîì ìîæíî âû÷èñëÿòü íåñîáñòâåííûå èíòåãðàëû. Ïðèìåð 10.8. Âû÷èñëèòü íåñîáñòâåííûå èíòåãðàëû ñ ïîìîùüþ êîìàíäû Symbolically ∞
⌠ 3 − x2 x ⋅e dx ⌡0
1
yields
2
e
⌠ 1 dx x⋅ ln( x) ⌡1
yields
2
∞
⌠ 1 dx x2 + 4 ⋅x + 13 ⌡1
1
yields
12
⋅π
∞
2 2 ⌠ ln x + a dx 2 2 x + b ⌡0
yields
− b ⋅ c sgn( b ) ⋅ π + a ⋅ c sgn( a ) ⋅ π
Òðåòèé ñïîñîá. Åñëè ïðè âûïîëíåíèè ñèìâîëüíûõ âû÷èñëåíèé óêàçàòü êëþ÷åâîå ñëîâî float, òî âìåñòî ñèìâîëüíûõ êîíñòàíò π è e â èòîãîâîå âûðàæåíèå áóäóò àâòîìàòè÷åñêè ïîäñòàâëåíû èõ ÷èñëîâûå çíà÷åíèÿ, ïðè ýòîì ñëåäóåò çàäàòü êîëè÷åñòâî çíàêîâ ïîñëå çàïÿòîé. Êëþ÷åâîå ñëîâî assume ïîçâîëÿåò íàëîæèòü îãðàíè÷åíèÿ íà çíà÷åíèå ïàðàìåòðà. Ïðèìåð 10.9. Âû÷èñëèòü èíòåãðàëû ñ ïîìîùüþ ñèìâîëüíîãî çíàêà ðàâåíñòâà: ⌠ 1 dx → ln( csc ( x) − cot( x) ) sin ( x) ⌡ 92
1
⌠ n−1 1 x dx assume, n > 0 → ⌡0 n ∞
⌠ sin(x) 1 dx → ⋅π 2 x ⌡0
∞
⌠ ⌡0
sin ( x)
x
dx float , 15 → 1.57079632679490
1
⌠ 1 −1 dx assume, a < 1 → ( −1 + a) xa ⌡0 ∞
⌠ π 1 1 dx assume, a > 0 → ⋅ 1 2 2 x +a ⌡0 2 a Äëÿ ÷èñëåííîãî âû÷èñëåíèÿ îïðåäåëåííîãî èíòåãðàëà íóæíî ââåñòè îïðåäåëåííûé îïåðàòîð èíòåãðèðîâàíèÿ è óêàçàòü ÷èñëà â êà÷åñòâå ïðåäåëîâ èíòåãðèðîâàíèÿ. Çàòåì ââåñòè ïîäûíòåãðàëüíóþ ôóíêöèþ è çíàê =.  ðåçóëüòàòå íà ýêðàíå ïîÿâèòñÿ ÷èñëåííîå çíà÷åíèå èíòåãðàëà. Ïðèìåð 10.10. Âû÷èñëèòü ïëîùàäü ôèãóðû, îãðàíè÷åí2 íîé êðèâûìè y = sin x , y = 1 − x . Íàõîäèì òî÷êè ïåðåñå÷åíèÿ äàííûõ èñõîäíûõ êðèâûõ, ïðåäâàðèòåëüíî íàðèñîâàâ ãðàôèêè ôóíêöèé: 2
g( x) := 1 − x
f ( x) := sin( x)
93
x := −2 , −1.99 .. 2
− 1.4096
0.6367
f ( x) g ( x)
x
Ðèñ. 10.3. Ãðàôèêè ôóíêöèé
x := −1 x := 1
a := root( f ( x) − g( x) , x) b := root( f ( x) − g( x) , x)
a = −1.409624 b = 0.636733
Ïëîùàäü êðèâîëèíåéíîé òðàïåöèè ðàâíà b
⌠ S := ( g( x) − f ( x) ) dx ⌡a
S = 1.670214
Ïðèìåð 10.11. Âû÷èñëèòü ïëîùàäü ôèãóðû, îãðàíè÷åííîé ýëëèïñîì (ðèñ. 6.7) x2 a2
+
y2 b2
= 1.
Ïàðàìåòðè÷åñêîå óðàâíåíèå ýëëèïñà èìååò âèä: x ( t ) = a cos t , y( t ) = b sin t . Ïëîùàäü ôèãóðû, îãðàíè÷åííîé ýëëèïñîì, ðàâíà x( a , t) := a ⋅ sin( t)
dx( a , t) :=
y( b , t) := b ⋅ cos ( t)
d x( a , t) → a ⋅ cos ( t) dt 94
2⋅π
⌠ ⌡0
y( b , t) ⋅ dx( a , t) dt → π ⋅ b ⋅ a
Ïëîùàäü ôèãóðû, âû÷èñëåííîé ÷åðåç äâîéíîé èíòåãðàë 2⋅π
⌠ a⋅b⋅ ⌡0
1
⌠ ρ dρ dφ → π ⋅ b ⋅ a . ⌡0
Ïðèìåð 10.12. Âû÷èñëèòü ïëîùàäü ôèãóðû, îãðàíè÷åííîé ëåìíèñêàòîé Áåðíóëëè ρ(φ) = 2 cos 2φ . ρ (φ ) := 2 ⋅ cos (2 ⋅ φ ) 135
ρ ( φ)
180
φ := 0 , 0.1 .. 2 ⋅ π 90 2 1.5 1 0.5 0
45
0
225
315 270
φ Ðèñ. 10.4. Ãðàôèê ëåìíèñêàòû Áåðíóëëè
Ïëîùàäü ðàâíà: π
⌠4 1 ( ρ ( φ ) ) 2 dφ → 4 4⋅ ⋅ 2 ⌡0 Ïðèìåð 10.13. Âû÷èñëèòü äâîéíûå èíòåãðàëû. 2
⌠ ⌡1
4
⌠ ⌡3
1
(x2 + y2)
dx dy = 0.069772 95
a
⌠ ⌡− a
⌠ ⌡
a
24
a − x − y dy dx → 2
2
2
2 2 − a −x
⌠2 4⋅ ⌡0 −1
a2−x2
2 3
⋅π ⋅a
3
b
⌠2 2 2 (−24⋅h⋅p + a2 + b −1 − x + y ⋅b ⋅a ⋅ h dy dx → 2 ⋅p 24 p ⌡0
⋅b ⋅a ⋅
(−24⋅h⋅p + a2 + b2) p
expands to
b ⋅a ⋅h −
1 24
3
⋅b ⋅
a 1 − p 24
10.3. Çàäà÷è íà ýêñòðåìóì Äëÿ íàõîæäåíèÿ çíà÷åíèé x, y, z, ïðè êîòîðûõ ôóíêöèÿ f(x, y, z) äîñòèãàåò ìàêñèìóì ëèáî ìèíèìóì, ìîæíî èñïîëüçîâàòü ðåøàþùèé áëîê Given-Find, òîëüêî Find(x,y,z) çàìåíèòü íà Maximize(f,x,y,z) ëèáî Minimize(f,x,y,z). Âíóòðè áëîêà ìîãóò áûòü çàäàíû îãðàíè÷åíèÿ â âèäå ðàâåíñòâ èëè íåðàâåíñòâ. Ïåðåä âûçîâîì ðåøàþùåãî áëîêà íóæíî çàäàòü íà÷àëüíûå çíà÷åíèÿ ïåðåìåííûõ. Ïðèìåð 10.14. Íàéòè ìàêñèìóì ôóíêöèè f ( x ) = − x 3 + x 2 + 2 + ln x .
Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ 3 2 f ( x) := −x + x + 2 + 2 ⋅ln( x)
Ãðàôèê ôóíêöèè 96
5 2.5
f ( x)
1
2
3
2.5 5
x
Ðèñ. 10.5. Ãðàôèê ôóíêöèè
x := 1.5 Given xmax := Maximize( f , x) xmax = 1.161
f ( xmax) = 2.082
Ïðèìåð 10.15. Íàéòè ìèíèìóì ôóíêöèè f ( x ) = ïðè x > 0 . Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ 1+
2
x f ( x) := 1+ x x := 1 Given x≥ 0
xmin := Minimize( f , x) xmin = 0.414
f ( xmin) = 0.828427 97
1+ x2 1+ x
Ïðèìåð 10.16. Íàéòè ìàêñèìóì ôóíêöèè f ( x ) =
x 3 + 3 x
ïðè x ∈[ −5, − 1] . g( x) :=
x 3
+
x := − 2 Given x ≥ −5
3
x
x ≤ −1
xmax := Maximize( g , x) xmax = − 3 g ( xmax) = − 2 Ïðèìåð 10.17. Íàéòè ìàêñèìóì è ìèíèìóì ôóíêöèè f ( x , y ) = 4( x − y) − x 2 − y 2 ïðè îãðàíè÷åíèÿõ âèäà x + 2 y ≤ 4 , x − 2y ≤ 4 , x ≥ 0 . Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ f ( x , y) := 4⋅( x − y) − x − y Íà÷àëüíûå óñëîâèÿ x := 1 y := 1 Íàõîæäåíèå ìàêñèìóìà 2
2
Given x + 2 ⋅y ≤ 4
x − 2 ⋅y ≤ 4
x≥ 0
a := Maximize( f , x , y) a 0 = 1.6
f ( a0 , a1) = 7.2
a 1 = − 1.2
Íàõîæäåíèå ìèíèìóìà Given x + 2 ⋅y ≤ 4
x − 2 ⋅y ≤ 4 98
x ≥ 0
a := Minimize( f , x , y) a0 = 0
f ( a0 , a1) = −12 .
a1 = 2
Ïðèìåð 10.18. Íàéòè ìàêñèìóì ôóíêöèè f ( x , y ) = 3x + 2 y ïðè îãðàíè÷åíèÿõ âèäà x + 2 y ≥ 5 , − x + 7 y ≤ 70 , 2.5 x + y ≤ 30 , x ≥ 0 , y ≥ 0 (çàäà÷à ëèíåéíîãî ïðîãðàììèðîâàíèÿ). Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ f ( x , y) := 3 ⋅x + 2 ⋅y . Îáëàñòü îãðàíè÷åíèÿ íà ïëîñêîñòè 15 0 5−0.5t 10+
11.081
7.568
10
t 7
30−2.5 ⋅ t
0
−5
0
10
20
0
t
20
Ðèñ. 10.6. Îáëàñòü îãðàíè÷åíèÿ
Íàõîæäåíèå ìàêñèìóìà x := 1 Given
y := 1
x + 2 ⋅y ≥ 5
. −x + 7 ⋅y ≤ 70
2.5⋅x +
y ≤ 30 x≥ 0 y≥ 0 xym := Maximize( f , x , y)
xym0 = 7.568
xym1 = 11.081 99
f ( xym0 , xym1) = 44
11. Ðåøåíèå äèôôåðåíöèàëüíûõ óðàâíåíèé MathCAD ñîäåðæèò âñòðîåííûå ôóíêöèè äëÿ ÷èñëåííîãî ðåøåíèÿ çàäà÷è Êîøè è ãðàíè÷íûõ çàäà÷ äëÿ îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé è ñèñòåì óðàâíåíèé. Ýòè ôóíêöèè ðàñïîëîæåíû â áèáëèîòåêå âñòðîåííûõ ôóíêöèé Differential Equation Solving. 11.1. Ðåøåíèå çàäà÷è Êîøè è ãðàíè÷íîé çàäà÷è ñ ïîìîùüþ odesolve Äëÿ ÷èñëåííîãî ðåøåíèÿ çàäà÷è Êîøè äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ, ëèíåéíîãî îòíîñèòåëüíî ñòàðøåé ïðîèçâîäíîé: a ( x ) y ( n ) ( x ) + F( x , y′( x ), y′′( x ), . . . , y ( n −1) ( x )) = G ( x ) , y(a ) = f 0 , y′(a ) = f1, . . . , y ( n −1) (a ) = f n −1
è ïðîñòîé ãðàíè÷íîé çàäà÷è y ( p ) (a ) = f p ,
y (m ) (m ) = f m ,
0 ≤ p, m ≤ n − 1 ,
â MathCAD èìååòñÿ âñòðîåííàÿ ôóíêöèÿ odesolve, êîòîðàÿ ðåøàåò ïîñòàâëåííóþ çàäà÷ó ìåòîäîì Ðóíãå - Êóòòà ñ ôèêñèðîâàííûì øàãîì. Äëÿ ÷èñëåííîãî ðåøåíèÿ ïîñòàâëåííîé çàäà÷è ìåòîäîì Ðóíãå - Êóòòà ñ àâòîìàòè÷åñêèì âûáîðîì øàãà íóæíî ùåëêíóòü ïðàâîé êíîïêîé ìûøè ïî èìåíè ôóíêöèè è â âñïëûâàþùåì ìåíþ âûáðàòü êîìàíäó Adaptive (ðèñ. 11.1).
Ðèñ. 11.1. Âûáîð êîìàíäû Adaptive
100
Îáðàùåíèå ê ôóíêöèè odesolve èìååò âèä: Y := odesolve(x, b [, step]), ãäå Y èìÿ ôóíêöèè, ñîäåðæàùåé çíà÷åíèÿ íàéäåííîãî ðåøåíèÿ, b êîíå÷íàÿ òî÷êà îòðåçêà, íà êîòîðîì èùåòñÿ ðåøåíèå çàäà÷è, step íåîáÿçàòåëüíûé ïàðàìåòð, çàäàþùèé øàã. Ïåðåä îáðàùåíèåì ê ôóíêöèè odesolve íóæíî çàïèñàòü êëþ÷åâîå ñëîâî Given, ââåñòè äèôôåðåíöèàëüíîå óðàâíåíèå, íà÷àëüíûå ëèáî ãðàíè÷íûå óñëîâèÿ. Äëÿ ââîäà ïðîèçâîäíûõ ìîæíî èñïîëüçîâàòü êàê îïåðàòîð äèôôåðåíöèðîâàíèÿ, òàê è çíàê ïðîèçâîäíîé (êîìáèíàöèÿ êëàâèø Ctrl + F7). Çíàê ðàâåíñòâà ââîäèòñÿ ñ ïîìîùüþ ïèêòîãðàììû Boolean ëèáî êîìáèíàöèåé êëàâèø Ctrl + = . Ïðè ââîäå ôóíêöèè îáÿçàòåëüíî ñëåäóåò óêàçûâàòü àðãóìåíò èñõîäíîé ôóíêöèè. Äëÿ ïîëó÷åíèÿ ÷èñëåííîãî ðåøåíèÿ çàäà÷è â ëþáîé òî÷êå îòðåçêà [a, b] íóæíî çàäàòü èìÿ ôóíêöèè Y, óêàçàâ â ñêîáêàõ ÷èñëåííîå çíà÷åíèå àðãóìåíòà, è ââåñòè ñ êëàâèàòóðû çíàê =. Ïðèìåð 11.1. Ðåøèòü çàäà÷ó Êîøè äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ ïåðâîãî ïîðÿäêà y′( x ) = − 2 y( x ) − 3 sin x , y(0) = 2 íà îòðåçêå [0, 10] è ïîñòðîèòü ãðàôèê ðåøåíèÿ. Given − 2 ⋅y ( x) − 3 ⋅sin( x) y' ( x) y ( 0) 3 y := odesolve ( x , 10) Çíà÷åíèå ðåøåíèÿ çàäà÷è Êîøè â íåêîòîðûõ òî÷êàõ îòðåçêà [0;10]: x := 1 , 2.5 .. 10 x= y( x) = 1
-0.36078
2.5
-1.18268
4
0.51678
5.5
1.27189
7
-0.33604
8.5
-1.31939
10
0.14938
101
4 3 2
y ( x)
1
0
2.5
5
7.5
10
1 2
x
Ðèñ. 11.2. Ãðàôèê ðåøåíèÿ
Ïðèìåð 11.2. Ðåøèòü çàäà÷ó Êîøè äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ âòîðîãî ïîðÿäêà
y′′( x ) − sin xy′( x ) + y( x ) =
x , 2π
y(0) = 1 , y′(0) = 3 íà îòðåçêå [0, 10] è ïîñòðîèòü ãðàôèê ðåøåíèÿ.
Given y'' ( x) − sin( x) ⋅y' ( x) + y( x)
x 2 ⋅π
y( 0)
1
y := odesolve( x , 10) 9
5.5
y ( x)
2 0
2.5
5
7.5
1.5
5
x Ðèñ. 11.3. Ãðàôèê ðåøåíèÿ
102
10
y'( 0)
Ïðèìåð 11.3. Ðåøèòü çàäà÷ó Êîøè äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ òðåòüåãî ïîðÿäêà y′′′( x ) −
( y′′( x )) 2 = 6 y( x )( y′( x )) 2 , y′( x )
y( 2) = 0 , y′( 2) = 1 , y′′( 2) = 0 íà îòðåçêå [2, 3.3] è ïîñòðîèòü
ãðàôèê ðåøåíèÿ. Given
d2 y( x) dx2 3 d y( x) − 3
2
d 6 ⋅y( x) ⋅ y( x) dx
d y( x) dx
dx
y ( 2)
y' ( 2 )
0
y'' ( 2 )
1
2
0
y := odesolve ( x , 3.3 , 0.001 ) Ãðàôèê ôóíêöèè, ÿâëÿþùåéñÿ ðåøåíèåì ïîñòàâëåííîé çàäà÷è Êîøè 20 5 2 y ( x)
2.38
2.75
3.13
10 25 40 x
Ðèñ. 11.4. Ãðàôèê ðåøåíèÿ
103
3.5
Çíà÷åíèÿ ðåøåíèÿ ïîñòàâëåííîé çàäà÷è Êîøè â íåêîòîðûõ òî÷êàõ îòðåçêà [2, 3.3]: a := 2.8 , 2.85 .. 3.3 a =
y ( a) =
2.8
0.932
2.85
1.907
2.9
1.143
2.95
-1.997
3
1.459
3.05
13.936
3.1
2.076
3.15
-42.867
3.2
4.621
3.25
256.142
3.3
633.416
Ïðèìåð 11.4. Ðåøèòü ãðàíè÷íóþ çàäà÷ó äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ âòîðîãî ïîðÿäêà y′′( t ) + 9 y( t ) = 4 , y(0) = 0 , y( π / 2) = 1 è ïîñòðîèòü ãðàôèê ðåøåíèÿ.
Given d2 2
dt
y( t) + 9 y( t)
y( 0)
4
π 2
y
0
1
π 2
y := odesolve t ,
104
1.5
1
y ( t)
0.5
0
0.5
1
1.5
2
0.5
t
Ðèñ. 11.5. Ãðàôèê ðåøåíèÿ
Ïðèìåð 11.5. Ðåøèòü ãðàíè÷íóþ çàäà÷ó äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ âòîðîãî ïîðÿäêà y′′( x ) − cos( x ) y′( x ) + y( x ) = sin x / 2 , y(0) = 0 , y′( π / 2) = 1 è ïîñòðîèòü ãðàôèê ðåøåíèÿ. Given
x 2
sin
y'' ( x) − cos ( x) ⋅ y' ( x) + y( x) y( 0)
0
y' (2 ⋅ π )
1
y := odesolve(x , 2 ⋅ π ) 20
10
y ( x) 0
2
4
6
10
x
Ðèñ. 11.6. Ãðàôèê ðåøåíèÿ
105
8
Íàïðèìåð, åñëè ãðàíè÷íûå óñëîâèÿ èìåþò íåïðîñòîå ïðåäñòàâëåíèå, òî ãðàíè÷íóþ çàäà÷ó äëÿ ëèíåéíîãî äèôôåðåíöèàëüíîãî óðàâíåíèÿ âòîðîãî ïîðÿäêà ìîæíî ëèáî ìåòîäîì âàðèàöèè ïîñòîÿííûõ, ëèáî ìåòîäîì äèôôåðåíöèàëüíîé ïðîãîíêè ñâåñòè ê ðåøåíèþ íåñêîëüêèõ çàäà÷ Êîøè. Ñîãëàñíî ìåòîäó âàðèàöèè ïîñòîÿííûõ îáùåå ðåøåíèå ãðàíè÷íîé çàäà÷è (11.1) y′′( x ) + h ( x ) y′( x ) + q ( x ) y( x ) = f ( x ) , a < x < b , α 0 y(a ) + α1y′( x ) = A ,
β0 y ( b) + β1 ( x ) y′( b) = B
(11.2)
ìîæíî ïðåäñòàâèòü â âèäå y( x ) = Z( x ) + C1Z1( x ) + C 2 Z 2( x ) ,
(11.3)
ãäå C1 , C 2 ïðîèçâîëüíûå ïîñòîÿííûå, Z( x ), Z1 ( x ), Z 2 ( x ) ðåøåíèÿ ñëåäóþùèõ çàäà÷ Êîøè: Z′′( x ) + h ( x ) Z′( x ) + q ( x ) Z( x ) = f ( x ) ,
(11.4)
Z(a ) = 0, Z′(a ) = 0, Z1′′( x ) + h ( x ) Z1′( x ) + q ( x ) Z1( x ) = 0 ,
(11.5)
Z(a ) = 0, Z′(a ) = 1, Z1′′( x ) + h ( x ) Z1′( x ) + q ( x ) Z1( x ) = 0 ,
(11.6)
Z(a ) = 1, Z′(a ) = 0.
Äëÿ îïðåäåëåíèÿ ïðîèçâîëüíûõ ïîñòîÿííûõ C1 , C 2 ïîäñòàâèì ïðåäñòàâëåíèå (11.3) â ãðàíè÷íûå óñëîâèÿ (11.2) è ïîëó÷èì ñèñòåìó äëÿ îïðåäåëåíèÿ ýòèõ âåëè÷èí. Ïðèìåð 11.6. Ìåòîäîì âàðèàöèè ïîñòîÿííûõ íàéòè ðåøåíèå ãðàíè÷íîé çàäà÷è y′′( x ) + ( x + 1) y′( x ) − 2 y( x ) = 2, y(0) − y′(0) = −1, y(1) = 4 è ïîñòðîèòü ãðàôèê ðåøåíèÿ. Ðåøåíèå çàäà÷è Êîøè (11.4): Given Z'' ( x) + ( x + 1)Z( x) − 2 ⋅Z( x) 106
2
Z ( 0)
0 Z' ( 0 )
0
Z := odesolve ( x , 1 )
Z ( 1 ) = 1.034
Ðåøåíèå çàäà÷è Êîøè (11.5): Given 2
d
2
Z1 ( x) + ( x + 1 )Z1 ( x) − 2 ⋅Z1 ( x)
0
dx
Z1 ( 0 )
0
Z1' ( 0 )
1
Z1 := odesolve ( x , 1 , 0.01 )
Z1 ( 1) = 1.085
Ðåøåíèå çàäà÷è Êîøè (11.6): Given d
2 2
Z2 ( x) + ( x + 1 )Z2 ( x) − 2 ⋅Z2 ( x)
0
dx
Z2 ( 0 )
1
Z2' ( 0 )
0
Z2 := odesolve ( x , 1 , 0.01 )
Z2 ( 1 ) = 1.347
Íàõîæäåíèå ïðîèçâîëüíûõ ïîñòîÿííûõ C1 := 0 Given −C1 + C2
C2 := 0 −1
Z( 1) + C1 ⋅Z1( 1) + C2 ⋅Z2( 1) C := Find( C1 , C2)
4
1.773 0.773
C= 107
Ïðèáëèæåííîå ðåøåíèå â íåêîòîðûõ òî÷êàõ: x := 0 , 0.1 .. 1 Z( x) + C0 ⋅Z1( x) + C1⋅Z2( x)
x= 0
0.773117
0.1
0.964457
0.2
1.184465
0.3
1.433928
0.4
1.713403
0.5
2.023124
0.6
2.362919
0.7
2.732117
0.8
3.129454
0.9
3.552986
1
4
Ãðàôèê ïðèáëèæåííîãî ðåøåíèÿ 4 3 Z( x) + C0⋅ Z1( x) + C1⋅ Z2( x)
2 1 0
0.25
0.5
0.75
1
x
Ðèñ. 11.7. Ãðàôèê ðåøåíèÿ
Ñîãëàñíî ìåòîäó äèôôåðåíöèàëüíîé ïðîãîíêè ðåøåíèå ãðàíè÷íîé çàäà÷è (11.1) - (11.2) ïðè óñëîâèè α1 ≠ 0 ñîñòîèò èç ðåøåíèÿ ñëåäóþùèõ çàäà÷ Êîøè: 108
α Z1′( x ) = − Z12 ( x ) − p ( x ) Z1( x ) − q ( x ) , Z1(a ) = − 0 , α1
(11.7)
A . α1
(11.8)
Z2′( x ) = − Z 2( x )( Z1( x ) + p ( x )) + f ( x ) , Z2(a ) =
Èñïîëüçóÿ íàéäåííûå ôóíêöèè Z1( x ), Z 2( x ) , íàõîäèì ðåøåíèå èñõîäíîé ãðàíè÷íîé çàäà÷è êàê ðåøåíèå çàäà÷è Êîøè y′( x ) = Z1( x ) y( x ) + Z 2( x ) ,
y( b ) =
B − β1Z2( b ) β0 + β1Z1( b ) .
(11.9)
Ïðèìåð 11.7. Ìåòîäîì äèôôåðåíöèàëüíîé ïðîãîíêè íàéòè ðåøåíèå ãðàíè÷íîé çàäà÷è y′′( x ) + ( x 2 + 1) y′( x ) − xy ( x ) = 2, y(0) − y′(0) = −1, y(1) = 5 .
Ðåøåíèå çàäà÷è Êîøè (11.7): Given 2 − Z1 ( x) ⋅(Z1 ( x) + x + 1) + x
d Z1 ( x) dx Z1 ( 0)
1
Z1 := odesolve ( x , 1) Ðåøåíèå çàäà÷è Êîøè (11.8): Given 2 − Z2 ( x) ⋅ (Z1 ( x) + x + 1) + 2
d Z2 ( x) dx Z2 ( 0)
1
Z2 := odesolve ( x , 1) 109
Ðåøåíèå çàäà÷è Êîøè (11.9): Given d y( x) dx y ( 1)
Z1( x) y( x) + Z2( x)
5
y := odesolve ( x , 0) Ïðèáëèæåííîå ðåøåíèå â íåêîòîðûõ òî÷êàõ: x := 0 , 0.2 .. 1 x=
y( x) =
0
2.058853
0.2
2.6538
0.4
3.228457
0.6
3.801894
0.8
4.388953
1
5
Ñîãëàñíî ìåòîäó êîíå÷íûõ ðàçíîñòåé ãðàíè÷íàÿ çàäà÷à (11.1) (11.2) ñâîäèòñÿ ê ðåøåíèþ ñèñòåìû ëèíåéíûõ àëãåáðàè÷åñêèõ óðàâíåíèé âèäà ãäå
y i +1 + m i y i + k i y i = h 2 Fi ,
mi =
2h 2q i − 4 , 2 + hp i
x i = a + ih ,
ki =
i = 1, . . . , n −1 ,
2 − hp i 2 + hp i ,
q i = q ( x i ) , pi = p( x i ) , 110
Fi =
2f i 2 + hp i ,
fi = f ( x i ) , h = (b − a ) / n .
Ïîëó÷åííàÿ ñèñòåìà ðåøàåòñÿ ìåòîäîì ïðîãîíêè. Ñíà÷àëà âûïîëíÿåòñÿ ïðÿìîé ìåòîä ïðîãîíêè. Íàõîäèì êîýôôèöèåíòû Ci , D i ïî ôîðìóëàì Co = Ci =
α1 , hα 0 − α1
D0 =
1 , m i − k i C i −1
Ah , α1
D i = h 2 Fi − k i Ci −1D i −1 .
Îáðàòíûé õîä ìåòîäà ïðîãîíêè íàõîæäåíèå ïðèáëèæåííîãî ðåøåíèÿ ãðàíè÷íîé çàäà÷è â òî÷êàõ x i , i = n, . . . , 0 ïî ôîðìóëàì yn =
Bh + β1C n −1D n −1 β0 h + β1 (C n −1 + 1) ,
y i = C i ( D i − yi −1 ) , i = n − 1, . . . , 0 .
Ïðèìåð 11.8. Ìåòîäîì ïðîãîíêè ðåøèòü ãðàíè÷íóþ çàäà÷ó y′′( x ) + xy′( x ) −
y( x ) = 1 , y( 2) + 2 y′( 2) = 1 , 2x
y( 2.3) = 2.15 .
Èñõîäíûå äàííûå α 0 := 1
α 1 := 2
a := 2
β 0 := 1
β 1 := 0
A := 1 B := 2.5
b := 2.3
b−a n=6 h Ôîðìèðîâàíèå ýëåìåíòîâ ìàòðèöû h := 0.05
n :=
i := 1 .. n − 1 pi := xi
qi :=
2 ⋅h
2
mi :=
⋅qi − 4
2+
h⋅pi
xi := a + h⋅i −1 2 ⋅xi
f i := 1 ki :=
2−
h⋅pi
2+
h⋅pi
111
Fi := 2 ⋅
fi 2+
h⋅pi
Ïðÿìîé õîä ìåòîäà ïðîãîíêè α1 h c0 := d0 := A⋅ α1 h⋅α 0 − α 1
c0 = −1.026
d0 = 0.02
i := 1 .. n − 1 1
ci :=
di := h2 ⋅Fi − ki⋅ci−1 ⋅di−1
mi − ki⋅ci−1 Îáðàòíûé õîä ìåòîäà ïðîãîíêè yn := 2.15
yi := ci⋅(di − yi+ 1)
i := n − 1 , n − 2 .. 0
Ïðèáëèæåííîå ðåøåíèå ãðàíè÷íîé çàäà÷è i := 0 .. n
x=
2
xi := a + h⋅i
y=
2.05 2.1 2.15 2.2 2.25 2.3
2.249058 2.217832 2.193314 2.174859 2.161858 2.153747 2.15
Ãðàôèê ðåøåíèÿ 2.25
2.21
y
2.18
2.14
2.11 1.95
2.05
2.15
2.25
x
Ðèñ. 11.8. Ãðàôèê ðåøåíèÿ
112
2.35
11.2. Ðåøåíèå çàäà÷è Êîøè äëÿ íîðìàëüíîé ñèñòåìû îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé Äëÿ ÷èñëåííîãî ðåøåíèÿ çàäà÷è Êîøè äëÿ íîðìàëüíîé ñèñòåìû îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé (ÎÄÓ): y1′ ( x ) = f1 ( x , y1 ( x ), y 2 ( x ), . . . , y n ( x )), y′ ( x ) = f ( x , y ( x ), y ( x ), . . . , y ( x )), 2 2 1 2 n . . . . . . . y′n ( x ) = f n ( x , y1 ( x ), y 2 ( x ), . . . , y n ( x )),
(11.10)
y1 (a ) = y10 , y 2 (a ) = y 20 , . . . , y n (a ) = y n 0 ,
èìååòñÿ âñòðîåííàÿ ôóíêöèÿ rkfixed, èñïîëüçóþùàÿ ìåòîä Ðóíãå-Êóòòà. Åñëè ðåøåíèå çàäà÷è Êîøè äëÿ ñèñòåìû ÎÄÓ ÿâëÿåòñÿ ãëàäêîé ôóíêöèåé, òî äëÿ ÷èñëåííîãî ðåøåíèÿ ýòîé çàäà÷è ëó÷øå èñïîëüçîâàòü âñòðîåííóþ ôóíêöèþ Bulstoer, èñïîëüçóþùóþ ìåòîä Bulirsch- Stoer (Áóëèðøà-Øòåðà). Åñëè èçâåñòíî, ÷òî ðåøåíèå çàäà÷è Êîøè äëÿ ñèñòåìû (11.10) äîñòàòî÷íî ãëàäêîå, òî ëó÷øå èñïîëüçîâàòü âñòðîåííóþ ôóíêöèþ Rdadapt.  îòëè÷èå îò ôóíêöèè, êîòîðàÿ èùåò ïðèáëèæåííîå ðåøåíèå ñ ïîñòîÿííûì øàãîì, ôóíêöèÿ Rkadapt âû÷èñëÿåò ïðèáëèæåííûå ðåøåíèÿ íà áîëåå ìåëêîé ñåòêå íà òåõ ó÷àñòêàõ îòðåçêà, ãäå çíà÷åíèÿ ôóíêöèè ìåíÿþòñÿ áûñòðî, è íà áîëåå êðóïíîé íà òåõ ó÷àñòêàõ îòðåçêà, ãäå ôóíêöèÿ ìåíÿåòñÿ ìåäëåííî. Ýòî ïîçâîëÿåò ïîâûñèòü òî÷íîñòü âû÷èñëåíèé è ñîêðàòèòü âðåìÿ âû÷èñëåíèé. Äëÿ ïðèáëèæåííîãî ðåøåíèÿ æåñòêèõ ñèñòåì ÎÄÓ èñïîëüçóþòñÿ âñòðîåííûå ôóíêöèè Stiffr, Stffb. Åñëè íåîáõîäèìî íàéòè ïðèáëèæåííîå ðåøåíèå çàäà÷è Êîøè òîëüêî â êîíå÷íîé òî÷êå îòðåçêà, òî èñïîëüçóþòñÿ âñòðîåííûå ôóíêöèè bulstoer, rkadapt, stiffb, stiffr. Îáðàùåíèÿ ê âûøåïåðå÷èñëåííûì âñòðîåííûì ôóíêöèÿì: · rkfixed(y, à, â, npoints, D) ðåøåíèå çàäà÷è Êîøè íà îòðåçêå ìåòîäîì Ðóíãå-Êóòòà ñ ïîñòîÿííûì øàãîì; 113
· Bulstoer(y, à, â, npoints, D) ðåøåíèå çàäà÷è Êîøè íà îòðåçêå ìåòîäîì Bulirsch-Stoer; · Rkadapt(y, à, â, npoints, D) ðåøåíèå çàäà÷è Êîøè íà îòðåçêå ìåòîäîì Ðóíãå-Êóòòà ñ àâòîìàòè÷åñêèì âûáîðîì øàãà; · Stiffr(y, a, b, acc, D, J) ðåøåíèå çàäà÷è Êîøè äëÿ æåñòêèõ ñèñòåì ÎÄÓ íà îòðåçêå ñ èñïîëüçîâàíèåì àëãîðèòìà Rosenbrock; · Stiffb(y, a, b, acc, D, J) ðåøåíèå çàäà÷è Êîøè äëÿ æåñòêèõ ñèñòåì ÎÄÓ íà îòðåçêå ñ èñïîëüçîâàíèåì àëãîðèòìà Bulirsch-Stoer; · rkadapt(y, à, â, acc, D, kmax, save) ðåøåíèå çàäà÷è Êîøè â çàäàííîé òî÷êå ìåòîäîì Ðóíãå-Êóòòà ñ àâòîìàòè÷åñêèì âûáîðîì øàãà; · bulstoer(y, à, â, acc, D, kmax, save) ðåøåíèå çàäà÷è Êîøè â çàäàííîé òî÷êå ìåòîäîì Áóëèðøà-Øòåðà; · stiffr(y, à, â, acc, D, J, kmax, save) ðåøåíèå çàäà÷è Êîøè äëÿ æåñòêèõ ñèñòåì ÎÄÓ â çàäàííîé òî÷êå ñ èñïîëüçîâàíèåì àëãîðèòìà Rosenbrock; · stiffb(y, à, â, acc, D, J, kmax, save) ðåøåíèå çàäà÷ äëÿ æåñòêèõ ñèñòåì â çàäàííîé òî÷êå ñ èñïîëüçîâàíèåì àëãîðèòìà Áóëèðøà-Øòåðà. Ñìûñë ïàðàìåòðîâ äëÿ âñåõ ôóíêöèé îäèíàêîâ è îïðåäåëÿåòñÿ ìàòåìàòè÷åñêîé ïîñòàíîâêîé çàäà÷è: · y âåêòîð íà÷àëüíûõ óñëîâèé ðàçìåðíîñòè n, ãäå n ÷èñëî óðàâíåíèé â ñèñòåìå (11.10); · a, b íà÷àëüíàÿ è êîíå÷íàÿ òî÷êè îòðåçêà èíòåãðèðîâàíèÿ ñèñòåìû; · npoints ÷èñëî òî÷åê, íå ñ÷èòàÿ íà÷àëüíîé òî÷êè, â êîòîðûõ èùåòñÿ ïðèáëèæåííîå ðåøåíèå. Ýòîò àðãóìåíò îïðåäåëÿåò ÷èñëî ñòðîê (npoints+1) â âîçâðàùàåìîé ìàòðèöå; · D èìÿ âåêòîð-ôóíêöèè D(x,y) ïðàâûõ ÷àñòåé ñèñòåìû (11.10); · J èìÿ ìàòðèöû-ôóíêöèè J(x,y) ðàçìåðíîñòè n * (n+1), â ïåðâîì ñòîëáöå êîòîðîé õðàíÿòñÿ âûðàæåíèÿ ÷àñòíûõ ïðîèçâîäíûõ ïî x ïðàâûõ ÷àñòåé ñèñòåìû, à â îñòàëüíûõ n ñòîëáöàõ ñîäåðæèòñÿ ìàòðèöà ßêîáè ïðàâûõ ÷àñòåé; 114
· acc ïàðàìåòð, êîíòðîëèðóþùèé ïîãðåøíîñòü ðåøåíèÿ ïðè àâòîìàòè÷åñêîì âûáîðå øàãà èíòåãðèðîâàíèÿ (åñëè ïîãðåøíîñòü ðåøåíèÿ áîëüøå acc, òî øàã ñåòêè óìåíüøàåòñÿ; øàã óìåíüøàåòñÿ äî òåõ ïîð, ïîêà åãî çíà÷åíèå íå ñòàíåò ìåíüøå save ); · kmax ìàêñèìàëüíîå ÷èñëî óçëîâ ñåòêè, â êîòîðûõ ìîæåò áûòü âû÷èñëåíî ðåøåíèå çàäà÷è íà îòðåçêå; · save íàèìåíüøåå äîïóñòèìîå çíà÷åíèå øàãà íåðàâíîìåðíîé ñåòêè. Ðåçóëüòàò ðàáîòû ôóíêöèé ìàòðèöà, ñîäåðæàùàÿ n+1 ñòîëáöîâ; åå ïåðâûé ñòîëáåö ñîäåðæèò êîîðäèíàòû óçëîâ ñåòêè, âòîðîé âû÷èñëåííûå ïðèáëèæåííûå çíà÷åíèÿ ðåøåíèÿ y1 ( x ) â óçëàõ ñåòêè, (k+1)-é ñòîëáåö çíà÷åíèÿ ðåøåíèÿ y k ( x ) â óçëàõ ñåòêè. Ïðèìåð 11.9. Ðåøèòü ìåòîäîì Ðóíãå-Êóòòà çàäà÷ó Êîøè äëÿ íîðìàëüíîé ñèñòåìû ÎÄÓ d 2 2 dx y1 = sin( x + y 2 ), d y = cos( xy ), 2 1 dx
ñ íà÷àëüíûìè óñëîâèÿìè y1 (0) = 1, y 2 (0) = 0.5 íà îòðåçêå [ 0, 4] c øàãîì h = 0.1. Âûâåñòè íåêîòîðûå çíà÷åíèÿ è ïîñòðîèòü ãðàôèêè ôóíêöèé. ORIGIN := 1 Íà÷àëüíûå óñëîâèÿ
y :=
1 0.5
Âåêòîð ïðàâûõ ÷àñòåé
sin x2 + (y2)2 D( x , y) := cos (x⋅y1) 115
Ðåøåíèå ïîñòàâëåííîé çàäà÷è Y := rkfixed( y , 0 , 4 , 40 , D) ×èñëåííûå çíà÷åíèÿ (ïåðâûé ñòîëáåö çíà÷åíèÿ õ, âòîðîé çíà÷åíèÿ ôóíêöèè y1 ( x ) , òðåòèé çíà÷åíèÿ ôóíêöèè y 2 ( x ) ). 1
2
3
1
0
2
0.1
1.030165 0.599826
3
0.2
1.073235
0.69853
4
0.3
1.131406
0.79469
5
0.4
1.205133 0.886362
6
0.5
1.292515 0.970872
7
0.6
1.389155 1.044747
8
0.7
1.488874 1.103925
9
0.8
1.585272 1.144322
10
0.9
1.673452 1.162615
Y=
1
1.750961
0.5
11
1
12
1.1
1.817559 1.127028
1.1569
13
1.2
1.874183 1.074612
Ãðàôèêè ôóíêöèé 3
2
Y 〈2〉 Y 〈3〉
1
0
1
2
3
1
Y 〈1〉
Ðèñ. 11.9. Ãðàôèêè ðåøåíèÿ
116
4
Ïðèìåð 11.10. Ðåøèòü ìåòîäîì Bulirsch-Stoer çàäà÷ó Êîøè äëÿ ñèñòåìû ÎÄÓ âèäà d dx y1 = 3y1 − y 2 + y 3 + x , d y 2 = y1 + y 2 + y 3 + sin( x ), dx d dx y1 = 4 y1 − y 2 + 4 y 3 ,
ñ íà÷àëüíûìè óñëîâèÿìè y1 (0) = 0,34, y 2 (0) = − 0,16, y3 (0) = 0,27 íà îòðåçêå [ 0; 0,8 ]. Ïîñòðîèòü ãðàôèêè ôóíêöèé.
0.34 y := −0.16 0.27
ORIGIN := 1
3 ⋅y1 − y2 + y3 + x D( x , y) := y1 + y2 + y3 + sin(x) 4 ⋅y − y + 4 ⋅y Y := Bulstoer( y , 0 , 0.8 , 100 , D) 1 2 3 40 30 Y 〈2〉 Y 〈3〉 Y 〈4〉
20 10
0
0.4
10 Y 〈1〉
Ðèñ. 11.10. Ãðàôèêè ðåøåíèÿ
117
0.8
Ïðèìåð 11.11. Ðåøèòü çàäà÷ó Êîøè äëÿ æåñòêîé ñèñòåìû d dx y1 = − 2 y1 − 998 y 2 , d y = − 1000 y , 2 2 dx
ñ íà÷àëüíûìè óñëîâèÿìè y1 (0) = 2, y 2 (0) = 1 íà îòðåçêå [ 0, 0.01]. Ïîñòðîèòü ãðàôèêè ôóíêöèé.
2 1
y :=
ORIGIN := 1
−2 ⋅y1 − 998 ⋅y2
D( x , y) :=
−1000 ⋅y2
0 −2 −99 0 0 −10
J ( x , y) :=
Y := Stiffr ( y , 0 , 0.01 , 1000 , D , J ) 2.5 1.88 Y 〈2〉 Y 〈3〉
1.25 0.63
0
0.0025
0.005
0.0075
Y 〈1〉
Ðèñ. 11.11. Ãðàôèêè ðåøåíèÿ
118
0.01
11.3. Àâòîíîìíûå ñèñòåìû îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé Ñèñòåìà îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé íàçûâàåòñÿ àâòîíîìíîé, åñëè íåçàâèñèìàÿ ïåðåìåííàÿ ÿâíî íå âõîäèò â ïðàâóþ ÷àñòü ñèñòåìû. Ðàññìîòðèì àâòîíîìíóþ ñèñòåìó âòîðîãî ïîðÿäêà dy1 ( t ) = f1 ( y1 ( t ), y 2 ( t )), dt dy 2 ( t ) = f ( y ( t ), y ( t )). 2 1 2 dt
(11.11)
Ïóñòü y1 ( t ) = ϕ1 ( t ), y 2 ( t ) = ϕ2 ( t ) ðåøåíèå ñèñòåìû (11.11). Êðèâàÿ, çàäàííàÿ â ïàðàìåòðè÷åñêîì âèäå
y1 = ϕ1 ( t ),
y 2 = ϕ2 ( t ), t = t,
(11.12)
íàçûâàåòñÿ èíòåãðàëüíîé êðèâîé â òðåõìåðíîì ïðîñòðàíñòâå 0 y1y 2 t . Ïðîåêöèÿ èíòåãðàëüíîé êðèâîé (11.12) íà ïëîñêîñòü (ôàçîâàÿ ïëîñêîñòü) 0 y1y 2 íàçûâàåòñÿ ôàçîâîé êðèâîé, èëè ôàçîâîé òðàåêòîðèåé ñèñòåìû. Ïðèìåð 11.12. Ïîñòðîèòü ãðàôèêè ðåøåíèÿ, èíòåãðàëüíóþ êðèâóþ è ôàçîâóþ òðàåêòîðèþ àâòîíîìíîé ñèñòåìû dy1 ( t ) dt = sin y1 + 2, dy 2 ( t ) = sin y + cos y , 1 2 dt
ñ íà÷àëüíûìè óñëîâèÿìè y1 (0) = 1, y 2 (0) = 0 íà îòðåçêå [0,18] . Íà÷àëüíûå óñëîâèÿ ORIGIN:= 1
1 0
y :=
119
Âåêòîð ïðàâûõ ÷àñòåé sin(y1) + 2
D( x , y) :=
sin(y1) + cos (y2)
Ðåøåíèå ñèñòåìû Y := rkfixed( y , 0 , 18 , 100, D) Ãðàôèêè ðåøåíèé: y1 ( t ) (âåðõíèé ãðàôèê), y 2 ( t ) . 40
Y Y
〈2〉
30
〈3〉
20 10
0
4.5 Y
9 〈1〉
13.5
18
Ðèñ. 11.12. Ãðàôèêè ðåøåíèÿ
Èíòåãðàëüíàÿ êðèâàÿ â ïðîñòðàíñòâå 0 y1y 2 t
(Y
〈2〉
,Y
〈3〉
,Y
〈1〉
)
Ðèñ. 11.13. Èíòåãðàëüíàÿ êðèâàÿ
120
Ôàçîâàÿ òðàåêòîðèÿ àâòîíîìíîé ñèñòåìû 2 1.5 Y
〈3〉
1 0.5
0
10 Y
20 〈2〉
30
40
Ðèñ. 11.14. Ôàçîâàÿ òðàåêòîðèÿ
Ïðèìåð 11.13. Ïîñòðîèòü ãðàôèêè ðåøåíèÿ è ôàçîâîé òðàåêòîðèè ñèñòåìû Âîëüòåððà-Ëîòêà y1′ ( t ) = (a − by 2 ( t )) y1 ( t ), y′2 ( t ) = ( −c + dy1 ( t )) y 2 ( t ),
ãäå a , b, c, d ïîëîæèòåëüíûå ÷èñëà, ñ íà÷àëüíûìè óñëîâèÿìè y1 (0) = 1, y 2 (0) = 2.
Èñõîäíûå äàííûå ORIGIN := 1 a := 2 b := 3 c := 1 Íà÷àëüíûå äàííûå
y :=
1 2
d := 5
Ðåøåíèå ïîñòàâëåííîé çàäà÷è
(a − b ⋅y2) ⋅y1 (−c + d ⋅y1) ⋅y2
D( x , y) :=
Y := rkfixed( y , 0 , 18 , 2000, D)
121
Ãðàôèêè ðåøåíèÿ 4
Y 〈2〉
3
Y 〈3〉
2 1
0
4.5
9
13.5
18
Y 〈1〉
Ðèñ. 11.15. Ãðàôèêè ðåøåíèÿ
Ôàçîâàÿ òðàåêòîðèÿ ñèñòåìû 4 3
Y 〈3〉
2 1
0
0.5
1
1.5
2
Y 〈2〉
Ðèñ. 11.16. Ôàçîâàÿ òðàåêòîðèÿ
Èçâåñòíî, ÷òî ëèíåéíàÿ àâòîíîìíàÿ ñèñòåìà ñ íåâûðîæäåííîé ìàòðèöåé y1′ ( t ) = a11y1 ( t ) + a12 y 2 ( t ), y′2 ( t ) = a 21y1 ( t ) + a 22 y 2 ( t )
èìååò åäèíñòâåííóþ òî÷êó ïîêîÿ (0, 0). Õàðàêòåð òî÷êè ïîêîÿ ìîæíî óñòàíîâèòü ïî ñîáñòâåííûì çíà÷åíèÿì ìàòðèöû ñèñòåìû: a11 A = a 21
a12 a 22 .
122
Âåêòîðíîå ïîëå àâòîíîìíîé ñèñòåìû çàäàåò â êàæäîé òî÷êå ïëîñêîñòè 0 y1y 2 íàïðàâëåíèå êàñàòåëüíîé ê ôàçîâîé òðàåêòîðèè ñèñòåìû, ïðîõîäÿùåé ÷åðåç ýòó òî÷êó. Òî÷êè âåêòîðíîãî ïîëÿ, â êîòîðûõ âåêòîðíîå ïîëå íóëåâîå, íàçûâàþòñÿ îñîáûìè òî÷êàìè âåêòîðíîãî ïîëÿ. Òî÷êè ïîêîÿ àâòîíîìíîé ñèñòåìû ÿâëÿþòñÿ îñîáûìè òî÷êàìè âåêòîðíîãî ïîëÿ. Ïðèìåð 11.14. Îïðåäåëèòü õàðàêòåð òî÷êè ïîêîÿ ëèíåéíîé àâòîíîìíîé ñèñòåìû y1′ ( t ) = y1 ( t ) − y 2 ( t ), y′2 ( t ) = 2 y1 ( t ) − y 2 ( t )
è èçîáðàçèòü ôàçîâûå êðèâûå è âåêòîðíîå ïîëå. Âû÷èñëåíèå ñîáñòâåííûõ çíà÷åíèé ORIGIN := 1
1 − 4 eigenvals ( A ) = 2.646i A := 2 −1 − 2.646i Ñîáñòâåííûå çíà÷åíèÿ, êîìïëåêñíûå ÷èñëà è äåéñòâèòåëüíàÿ ÷àñòü ðàâíà íóëþ. Òî÷êà ïîêîÿ óñòîé÷èâà, íî íå àñèìïòîòè÷åñêè óñòîé÷èâà è íàçûâàåòñÿ öåíòðîì [2, 3] y1 − 4⋅y2
D( x , y) :=
2⋅y1 − y2
Ðåøåíèå àâòîíîìíîé ñèñòåìû äëÿ ðàçëè÷íûõ íà÷àëüíûõ çíà÷åíèé −1 X1 := rkfixed( x , − 2 , 2 , 200 , D) x :=
1 1 x := −2 −2 x := 2 −1 x := 2
X2 := rkfixed( x , − 2 , 2 , 200 , D) X3 := rkfixed( x , − 2 , 2 , 200 , D) X4 := rkfixed( x , − 2 , 2 , 200 , D) 123
Ôàçîâûå òðàåêòîðèè ñèñòåìû 4
X1 X2 X3 X4
〈3〉
2
〈3〉 〈3〉
6
4
2
0
2
4
6
〈3〉 2
4 X1
〈2〉
, X2
〈2〉
, X3
〈2〉
, X4
〈2〉
Ðèñ. 11.17. Ôàçîâûå òðàåêòîðèè
Ïîñòðîåíèå âåêòîðíîãî ïîëÿ i := 1 .. 20 y1i := −2 + 0.2 ⋅i Y1( i, j) := y1i − 4 ⋅y2j
y2j := −2 + 0.2 ⋅ j Y2( i, j) := 2 ⋅y1i − y2j
( Y1 , Y2)
Ðèñ. 11.18. Âåêòîðíîå ïîëå
124
11.4. Àíàëèòè÷åñêîå ðåøåíèå äèôôåðåíöèàëüíûõ óðàâíåíèé Ðåøåíèå íåêîòîðûõ äèôôåðåíöèàëüíûõ óðàâíåíèé ìîæíî ïîëó÷èòü â àíàëèòè÷åñêîì âèäå. Óðàâíåíèå â âèäå P ( x )dx + Q( y)dy = 0
íàçûâàåòñÿ äèôôåðåíöèàëüíûì óðàâíåíèåì ñ ðàçäåëÿþùèìèñÿ ïåðåìåííûìè. Îáùèé èíòåãðàë ýòîãî óðàâíåíèÿ èìååò âèä
∫ P(x )dx
+
∫ Q(x )dy
= C.
Ïðèìåð 11.15. Íàéòè îáùèé èíòåãðàë äèôôåðåíöèàëüíîãî óðàâíåíèÿ (1 − e 2 x ) y 2 dy − e x dx = 0 .
Îáùèé èíòåãðàë äèôôåðåíöèàëüíîãî óðàâíåíèÿ ⌠ x ⌠ e 2 F ( x , y , C) := y dy − dx − C 2⋅ x ⌡ 1 + e ⌡ Àíàëèòè÷åñêîå ðåøåíèå óðàâíåíèÿ F ( x , y , C) →
1 3
⋅y − atan( exp( x) ) − C 3
Äèôôåðåíöèàëüíîå óðàâíåíèå âèäà dy( x ) + p( x ) y( x ) = q ( x ) dx
íàçûâàåòñÿ ëèíåéíûì äèôôåðåíöèàëüíûì óðàâíåíèåì ïåðâîãî ïîðÿäêà. Îáùåå ðåøåíèå ýòîãî óðàâíåíèÿ y( x ) =
1 µ( x )
( ∫ q(x )µ(x )dx + C ),
ãäå µ( x ) = e ∫
p ( x ) dx
. 125
Ïðèìåð 11.16. Íàéòè îáùåå ðåøåíèå ëèíåéíîãî äèôôåðåíöèàëüíîãî óðàâíåíèÿ âèäà dy ( x ) 2 − y( x ) = 2 x 3 . dx x
Èñõîäíûå äàííûå p ( x) :=
−2 x
3 q ( x) := 2 ⋅x
⌠ p ( x) d x ⌡
µ ( x) := e
Îáùåå ðåøåíèå
⌠ ⋅ y( x , C) := q ( x) ⋅µ ( x) dx + C µ ( x) ⌡ 1
y( x , C) → x ⋅( x + C) 2
2
Èñïîëüçóÿ ïðåîáðàçîâàíèå Ëàïëàñà, ìîæíî íàéòè àíàëèòè÷åñêîå ðåøåíèå çàäà÷è Êîøè. Ïðèìåð 11.17. Ñ ïîìîùüþ ïðåîáðàçîâàíèÿ Ëàïëàñà íàéòè ðåøåíèå çàäà÷è Êîøè äëÿ äèôôåðåíöèàëüíîãî óðàâíåíèÿ dy( t ) + y( t ) = sin t , dt
y ( 0) = 0 .
Íàõîäèì ïðÿìîå ïðåîáðàçîâàíèå Ëàïëàñà d y( t) + y( t) − sin( t) dt has Laplace transform
s ⋅laplace( y( t) , t , s) − y( 0) + laplace( y( t) , t , s) −
(s
2
1
+ 1)
Ââåäåì îáîçíà÷åíèå L = laplace(y(t),t,s), ïðèìåì âî âíèìàíèå íà÷àëüíîå óñëîâèå è ðåøèì ïîëó÷åííîå óðàâíåíèå îòíîñèòåëüíî L. 126
 ðåçóëüòàòå ïîëó÷èì s ⋅L + L −
1
1
has solution(s)
s +1
(s + 1) ⋅( s + 1)
2
2
Ïðèìåíèì ê ïîëó÷åííîìó âûðàæåíèþ îáðàòíîå ïðåîáðàçîâàíèå Ëàïëàñà è ïîëó÷èì àíàëèòè÷åñêîå ðåøåíèå èñõîäíîé çàäà÷è 1
(s + 1) ⋅( s + 1) 2
has inverse Laplace transform
1 2
1
1
2
2
⋅exp( −t) − ⋅cos ( t) +
⋅sin( t)
Ïðèìåð 11.18. Íàéòè àíàëèòè÷åñêîå ðåøåíèå çàäà÷è Êîøè d 2 y( t ) dt
+ 4
2
dy( t ) + 4 y( t ) = t 2e − 2 t , dt
y(0) = 0, y′(0) = 0 .
Âûïîëíÿåì ïðÿìîå ïðåîáðàçîâàíèå Ëàïëàñà d2
d 2 − 2⋅ t y( t) + 4 ⋅ y( t) + 4 ⋅y( t) − t ⋅e dt dt 2
has Laplace transform s ⋅( s ⋅laplace( y( t) , t , s) − y( 0) ) −
t←0
+ 4 ⋅s ⋅laplace( y( t) , t , s) − 4 ⋅y( 0) + 4⋅laplace( y( t) , t , s)
d y( t) dt
Ââåäåì îáîçíà÷åíèå L = laplace(y(t),t,s), ïðèìåì âî âíèìàíèå íà÷àëüíîå óñëîâèå è ðåøèì ïîëó÷åííîå óðàâíåíèå îòíîñèòåëüíî L.  ðåçóëüòàòå ïîëó÷èì s ⋅( s ⋅L) + 4⋅s ⋅L + 4 ⋅L −
2
2
( s + 2) ⋅(s + 4 ⋅s + 4) Ïîëó÷åíèå àíàëèòè÷åñêîãî ðåøåíèÿ èñõîäíîé çàäà÷è 2
( s + 2) ⋅(s + 4⋅s + 4) 3
( s + 2)
3
has solution(s)
has inverse Laplace transform
2
3
2
1 12
127
⋅t ⋅exp( −2⋅t) 4
12. Ïðîãðàììèðîâàíèå â MathCAD MathCAD ðàñïîëàãàåò âîçìîæíîñòüþ äëÿ ñîçäàíèÿ ïðîãðàììíûõ áëîêîâ (ìîäóëåé). Ñðåäñòâà ïðîãðàììèðîâàíèÿ ðàñïîëîæåíû â ïàíåëå Programming (ðèñ. 12.1).
Ðèñ. 12.1. Ïàíåëü Programming
Ïðîãðàììíûé ìîäóëü åñòü íè ÷òî èíîå, êàê ôóíêöèÿ ïîëüçîâàòåëÿ ñ èìåíåì è ïàðàìåòðàìè, âûäåëåííûìè â òåêñòå æèðíîé âåðòèêàëüíîé ÷åðòîé.  ìîäóëå ìîæíî ïðèñâàèâàòü çíà÷åíèÿ ëîêàëüíûì ïåðåìåííûì, ñîçäàâàòü óñëîâíûå ïåðåõîäû, öèêëû. Îïåðàòîð Add Line ñîçäàåò ïðîãðàììíûé áëîê. Îïåðàòîð ← îïåðàòîð ëîêàëüíîãî ïðèñâîåíèÿ. Ëîêàëüíàÿ ïåðåìåííàÿ îïðåäåëåíà òîëüêî âíóòðè áëîêà è ïðè âûõîäå èç áëîêà òåðÿåò ñâîå çíà÷åíèå. Îïåðàòîð if óñëîâíûé îïåðàòîð, êîòîðûé ñîçäàåò êîí. Åñëè óñëîâèå âûïîëíÿåòñÿ, òî ñòðóêöèþ âèäà if âîçâðàùàåòñÿ çíà÷åíèå âûðàæåíèÿ ñëåâà. Ñîâìåñòíî ñ îïåðàòîðîì if ìîæíî èñïîëüçîâàòü îïåðàòîð èíîãî âûáîðà otherwise. Îïåðàòîð if ñîâìåñòíî ñ îïåðàòîðîì otherwise îáðàçóåò êîíñòðóêöèþ Åñëè ....... Òî ....... Èíà÷å. Ïðèìåð 12.1. Ïîñòðîèòü ãðàôèê ôóíêöèè 1 − x 2 , åñëè õ ≤ 1, y( x ) = x 2 − 1, åñëè õ > 1.
Êîíñòðóèðîâàíèå ïîëüçîâàòåëüñêîé ôóíêöèè, èñïîëüçóÿ îïåðàòîðû if è otherwise 128
2
y( x) :=
1−x
if x ≤ 1
2
x − 1 otherwise Ãðàôèê ôóíêöèè 4 3 2
y ( x)
1 2
1
0
1
2
x
Ðèñ. 12.1. Ãðàôèê ôóíêöèè
Îïåðàòîð for îïåðàòîð öèêëà ñ çàäàííûì ÷èñëîì ïîâòîðåíèé. Êîíñòðóêöèÿ îïåðàòîðà for for
∈
Ïåðâûé îïåðàíä ïåðåìåííàÿ öèêëà, è åå çíà÷åíèÿ îïðåäåëÿþòñÿ âî âòîðîì îïåðàíäå ïåðâîé ñòðîêè. Òðåòèé îïåðàíä (âòîðàÿ ñòðîêà) òåëî öèêëà. Ïðèìåð 12.2. Íàéòè ñðåäíåå àðèôìåòè÷åñêîå çíà÷åíèå ôóíêöèè cos x , åñëè 0 ≤ x ≤ π / 4, y( x ) = sin x , åñëè x > π / 4
â òî÷êàõ x i = 0,2i , i = 1, 2, . . . , 10 . Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ f ( x) :=
cos ( x) if ( x ≥ 0) ⋅ x ≤ sin( x) otherwise 129
π 4
Âû÷èñëåíèå ñðåäíåãî àðèôìåòè÷åñêîãî SumA( n) :=
S←0 for k ∈ 1 .. n S ← S + f ( 0.2 ⋅k) S n
SumA( 10) = 0.90855 Îïåðàòîð while îïåðàòîð öèêëîâ, äåéñòâóþùèé äî òåõ ïîð, ïîêà âûïîëíÿåòñÿ íåêîòîðîå óñëîâèå. Óñëîâèå ïðîâåðÿåòñÿ ïåðåä íà÷àëîì êàæäîãî öèêëà. Êîíñòðóêöèÿ îïåðàòîðà while while Ïåðâûé îïåðàíä óñëîâèå. Âòîðîé òåëî öèêëà. Ïðèìåð 12.3. Âû÷èñëèòü êâàäðàòíûé êîðåíü èç ÷èñëà À ñ òî÷íîñòüþ 0.00001, èñïîëüçóÿ èòåðàöèîííóþ ôîðìóëó xn =
x n −1 A + 2 2 x n −1 .
KvK ( a) :=
x0 ←
a 2
R←1 while R > 0.00001 x1 ←
x0 2
+
a 2 ⋅x0
R ← x1 − x0 x0 ← x1 x1
130
KvK ( 3) = 1.732051
3 = 1.732051
KvK ( 12) = 3.464102
12 = 3.464102
Îïåðàòîð break ñëóæèò äëÿ ïðåæäåâðåìåííîãî çàâåðøåíèÿ öèêëà, ÷òîáû èçáåæàòü, íàïðèìåð, çàöèêëèâàíèÿ èëè ñëèøêîì ïðîäîëæèòåëüíûõ âû÷èñëåíèé. Ïðèìåð 12.4. Íàéòè íîìåð è çíà÷åíèå ïåðâîãî ýëåìåíòà â ÷èñëîâîì ìàññèâå, êîòîðûé íàõîäèòñÿ â äèàïàçîíå 0 .2 ≤ a i ≤ 0 .4 . Ñîçäàíèå ÷èñëîâîãî ìàññèâà, èñïîëüçóÿ âñòðîåííóþ ôóíêöèþ rnd(1), ãåíåðèðóþùóþ ñëó÷àéíûå ÷èñëà â äèàïàçîíå îò 0 äî 1. i := 1 .. 10
0
ai := rnd ( 1)
a =
0
0
1
1.268·10 -3
2
0.193
3
0.585
4
0.35
5
0.823
6
0.174
7
0.71
8
0.304
9
0.091
10
0.147
Ïîëüçîâàòåëüñêàÿ ôóíêöèÿ NN ( a) :=
for k ∈ 0 .. last( a) break if (ak ≥ 0.2) ⋅(ak ≤ 0.4)
k ak 131
Ðåçóëüòàòû âû÷èñëåíèé
4 0.35
NN ( a) =
Îïåðàòîð continue ïîçâîëÿåò ïðåðâàòü âûïîëíåíèå òåêóùåé èòåðàöèè è ïåðåéòè ê âûïîëíåíèþ ñëåäóþùåé èòåðàöèè. Ïðèìåð 12.5. Íàéòè ìèíèìàëüíûé è ìàêñèìàëüíûé ýëåìåíòû â ÷èñëîâîì ìàññèâå. Èñõîäíûé ÷èñëîâîé ìàññèâ i := 0 .. 10 T
a =
0 0
ai := rnd( 4) 1
2
3
4
5
6
7
3.824 2.157 1.848 3.449 3.119 3.987 2.446 1.065
minmaxa ( ) :=
min← a0 max ← a0 for k ∈ 1 .. last( a) if ak < min min← ak continue max ← ak if ak > max
min max 1.065 3.987
minmax( a) =
132
8 3.36
Îïåðàòîð on error ñëóæèò äëÿ îáðàáîòêè îøèáî÷íûõ ñèòóàöèé òèïà «äåëåíèÿ íà íóëü». Êîíñòðóêöèÿ îïåðàòîðà exp − 2 on error exp − 1 . Åñëè ïðè âûïîëíåíèè exp 1 ïðîèçîøëà îøèáêà, òî âû÷èñëÿåòñÿ exp 2. n
Ïðèìåð 12.7. Âû÷èñëèòü ñóììó
1
∑ ai i =0
, åñëè a i ≠ 0 , è
íàéòè êîëè÷åñòâî íóëåâûõ ýëåìåíòîâ â ÷èñëîâîì ìàññèâå a i , i = 0,1, . . . , N .
Èñõîäíûé ìàññèâ
Ò v :=
1 0 5 0 10
SumRec( v) :=
su ← 0 j←0 for k ∈ 0 .. last( v) j ← j + 1 on error su ← su +
su j
1.3 2
SumRec( v) =
133
1 vk
Îïåðàòîð return ñëóæèò äëÿ ïðåæäåâðåìåííîãî çàâåðøåíèÿ ïðîãðàììíîãî áëîêà. Ïðèìåð 12.8. Íàéòè âñå ïðîñòûå ÷èñëà, íå ïðåâîñõîäÿùèå n. PN ( n) :=
if n
0 2
2
if n > 2 an ← 0 r ← PN (ceil( n)) for i ∈ 2 .. length( r) for j ∈ 2 ..
n ri−1
ari− 1⋅ j ← 1 j←1 for i ∈ 2 .. n if ai
0
qj ← i j← j+ 1 1
q N := 25 T
Pn =
0
Pn := PN ( N)
0
1
2
3
4
0
2
3
5
7 11 13 17 19 23
134
5
6
7
8
9
Ïðèëîæåíèå 1
Ñèñòåìíûå ïåðåìåííûå p = 3,14159 ...
e = 2,71828 ...
% = 0,01
TOL = 10-3
ORIGIN = 0 ÑTOL = 10-3
PRNCOLWIDTH = 8 PRNPRECISION = 4 FRAME = 0
×èñëî p.  ÷èñëåííûõ ðàñ÷åòàõ Mathcad èñïîë çóåò çíà÷åíèå p ñ ó÷åòîì 15 çíà÷àùèõ öèôð. ñèìâîëüíûõ âû÷èñëåíèÿõ p ñîõðàíÿåò ñâîå òî íîå çíà÷åíèå Îñíîâàíèå íàòóðàëüíûõ ëîãàðèôìîâ.  ÷èñëå íûõ ðàñ÷åòàõ Mathcad èñïîëüçóåò çíà÷åíèå e ó÷åòîì 15 çíà÷àùèõ öèôð.  ñèìâîëüíûõ â ÷èñëåíèÿõ e ñîõðàíÿåò ñâîå òî÷íîå çíà÷åíèå Áåñêîíå÷íîñòü.  ÷èñëåííûõ ðàñ÷åòàõ ýòî ç äàííîå áîëüøîå ÷èñëî (10307).  ñèìâîëüí âû÷èñëåíèÿõ áåñêîíå÷íîñòü Ïðîöåíò. Èñïîëüçóåòñÿ â âûðàæåíèÿõ, ïîäîáí 10%, èëè êàê ìàñøòàáèðóþùèé ìíîæèòåëü â ïîëå, îòâîäèìîì äëÿ åäèíèö ðàçìåðíîñòè Äîïóñêàåìàÿ ïîãðåøíîñòü äëÿ ðàçëè÷íûõ àëãî ðèòìîâ àïïðîêñèìàöèè (èíòåãðèðîâàíèÿ, ðåø íèÿ óðàâíåíèé, è ò.ä.) Îïðåäåëÿåò èíäåêñ ïåðâîãî ýëåìåíòà âåêòîðîâ ìàòðèö Äîïóñêàåìàÿ ïîãðåøíîñòü äëÿ ðàâåíñòâ è íåðà âåíñòâ, âõîäÿùèõ â ðåøåíèå îïòèìèçàöèîííû çàäà÷ ñ îãðàíè÷åíèÿìè Øèðèíà ñòîëáöà, èñïîëüçóåìàÿ ïðè çàïèñè ôà ëîâ ôóíêöèåé WRITEPRN ×èñëî çíà÷àùèõ öèôð, èñïîëüçóåìûõ ïðè çàïè ñè ôàéëîâ ôóíêöèåé WRITEPRN Èñïîëüçóåòñÿ â êà÷åñòâå ñ÷åò÷èêà êàäðîâ ïðè ñîçäàíèè àíèìàöèé
135
ÐÅÊÎÌÅÍÄÓÅÌÀ ËÈÒÅÐÀÒÓÐÀ
1. Àëàäüåâ Â.Ç., Ãåðøãîðí Í.À. Âû÷èñëèòåëüíûå çàäà÷è íà ïåðñîíàëüíîì êîìïüþòåðå. Êèåâ: Òýõíèêà, 1991. 245 ñ. 2. Àìåëüêèí Â.Â. Äèôôåðåíöèàëüíûå óðàâíåíèÿ â ïðèëîæåíèÿõ. Ì.: Íàóêà, 1987. 160 ñ. 3. Áÿðîçê³íà Í.Ñ., ̳íþê Ñ.À. Äûôåðýíöûÿëüíûÿ ³ ³íòýãðàëüíûÿ ¢ðà¢íåíí³. Ò.1. Ãðîäíà: ÃðÄÓ, 2000. 436 ñ. 4. Äåìèäîâè÷ Á.Ï. Ñáîðíèê çàäà÷ è óïðàæíåíèé ïî ìàòåìàòè÷åñêîìó àíàëèçó. Ì.: Íàóêà, 1969. 544 ñ. 5. Äüÿêîíîâ Â.Ï. MathCAD 8/2000: Ñïåöèàëüíûé ñïðàâî÷íèê. ÑÏá.: Ïèòåð, 2000. 592 ñ. 6. Êàõàíåð Ä., Ìîóëåð Ê., Íýø Ñ. ×èñëåííûå ìåòîäû è ïðîãðàììíîå îáåñïå÷åíèå. Ì.: Ìèð, 1998. 575 ñ. 7. Ìàòâååâ Í.Ì. Ñáîðíèê çàäà÷ è óïðàæíåíèé ïî îáûêíîâåííûì äèôôåðåíöèàëüíûì óðàâíåíèÿì. Ìí.: Âûø. øê., 1987. 319 ñ. 8. Ìîë÷àíîâ È.Í. Ìàøèííûå ìåòîäû ðåøåíèÿ ïðèêëàäíûõ çàäà÷ äèôôåðåíöèàëüíûõ óðàâíåíèé. Êèåâ: Íàóêîâà äóìêà, 1988. 344 ñ. 9. Íà Ö. Âû÷èñëèòåëüíûå ìåòîäû ðåøåíèÿ ïðèêëàäíûõ ãðàíè÷íûõ çàäà÷. Ì.: Ìèð, 1982. 296 ñ. 10. Î÷êîâ Â.Ô. MathCAD 7 Pro äëÿ ñòóäåíòîâ è èíæåíåðîâ. Ì.: Êîìïüþòåð ïðåññ, 1998. 380 ñ. 11. Õåðõàãåð Ì., Ïàðòîëü Õ. MathCAD 2000: ïîëíîå ðóêîâîäñòâî. Êèåâ: BHV, 2000. 416 ñ. 12. Øóøêåâè÷ Ã.×., Øóøêåâè÷ Ñ.Â. Èíòåãðèðîâàííûé ïàêåò MathCAD â ó÷åáíîì ïðîöåññå // Ìàò. 1-îé ìåæäóíàð. íàó÷. êîíô. ïðåïîä. è ñòóä. «Ñîöèàëüíî-ýêîíîìè÷åñêîå ðàçâèòèå ÐÁ íà ðóáåæå XX-XXI âåêîâ: àíàëèç, ïåðïåêòèâû». Ãðîäíî: Ãðîäíåíñêèé ôèëèàë ÈÑÇ, 1997. Ñ. 240241. 13. Øóøêåâè÷ Ã.×., Øóøêåâè÷ Ñ.Â. Ñèìâîëüíûå ïðåîáðàçîâàíèÿ â ïàêåòå MathCAD //Êîìïüþòåðíàÿ àëãåáðà â ôóíäà 136
ìåíòàëüíûõ è ïðèêëàäíûõ èñëåäîâàíèÿõ è îáðàçîâàíèè: Òåç. ìåæäóíàð. íàó÷. êîíô. Ìí.: ÁÃÓ, 1997. Ñ.170172. 14. Øóøêåâè÷ Ã.×. Èñïîëüçîâàíèå ïàêåòà MathCAD äëÿ ðàñ÷åòà ýëåêòðîñòàòè÷åñêèõ ïîëåé ñèñòåìû ïðîâîäíèêîâ //Òð. 3 Ìåæäóíàð. êîíô. «Íîâûå èíôîðìàöèîííûå òåõíîëîãèè â îáðàçîâàíèè». Ò. 1. Ìí.: ÁÃÝÓ, 1998. Ñ.112113. 15. MathCAD 6.0 PLUS. Ôèíàíñîâûå, èíæåíåðíûå è íàó÷íûå ðàñ÷åòû â ñðåäå Windows 95. Ì.: ÈÈÄ «Ôèëèíú», 1996. 698 ñ. 16. Shushkevich G.Ch. Calculation of electrostatic problems with MATHCAD Computer algebra in fundamental and applied research and education. Proceedings of second international scientific conference. Minsk: BSU, 1999. Ð.105109. 17. Shushkevich G.Ch., Shushkevich S.V. Calculation of higher transcendental functions with the help of a package MATHCAD Computer algebra in fundamental and applied research and education. Proceedings of second international scientific conference. Minsk: BSU, 1999. Ð.127128.
137
ÑÎÄÅÐÆÀÍÈÅ Ââåäåíèå...................................................................................3 1. Èíòåðôåéñ ìàòåìàòè÷åñêîé ñèñòåìû MathCAD............... 2. Îñíîâíûå êîìàíäû ãëàâíîãî ìåíþ............................... 2.1. Ìåíþ File (Ôàéë)...................................................... 2.2. Ìåíþ Edit (Ïðàâêà).................................................... 2.3. Ìåíþ View (Âèä)....................................................... 2.4. Ìåíþ Insert (Âñòàâêà).................................................. 2.5. Ìåíþ Format (Ôîðìàò)............................................... 2.6. Ìåíþ Math (Ìàòåìàòèêà).......................................... 2.7. Ìåíþ Symbolics (Ñèìâîëû).......................................... 2.8. Ìåíþ Window (Îêíî).......................................... 2.9. Ìåíþ Help (Ñïðàâêà).......................................... 3. Ïàíåëè èíñòðóìåíòîâ Standard (Ñòàíäàðòíàÿ) è Formatting (Ôîðìàòèðîâàíèå)................................................................. 4. Ïàíåëü èíñòðóìåíòîâ Math (Ìàòåìàòèêà)...................... 5. Âõîäíîé ÿçûê MathCAD..................................................... 5.1. Êîíñòàíòû.................................................................... 5.2. Ïåðåìåííûå................................................................... 5.3. Âåêòîðû, ìàòðèöû...................................................... 5.4. Îïåðàòîðû................................................................... 5.5. Âñòðîåííûå ôóíêöèè è ôóíêöèè ïîëüçîâàòåëÿ 6. Ïîñòðîåíèå äâóõìåðíûõ ãðàôèêîâ.................................... 6.1. Ïîñòðîåíèå ãðàôèêîâ ôóíêöèé âèäà y = f ( x ) ......... 6.2. Ïîñòðîåíèå ãðàôèêîâ ôóíêöèé, çàäàííûõ ïàðàìåòðè÷åñêè................................................................. 6.3. Ïîñòðîåíèå ãðàôèêîâ â ïîëÿðíîé ñèñòåìå êîîðäèíàò............................................................................... 6.4. Èçìåíåíèå ðàçìåðîâ è ïåðåìåùåíèå ãðàôèêîâ.......... 6.5. Ôîðìàòèðîâàíèå äâóõìåðíûõ ãðàôèêîâ.................... 6.6. Àíèìàöèÿ (îæèâëåíèå) ãðàôèêîâ.............................. 7. Ðåøåíèå íåëèíåéíûõ óðàâíåíèé è íåðàâåíñòâ............... 7.1. ×èñëåííîå ðåøåíèå óðàâíåíèé................................... 7.2. Ñèìâîëüíîå ðåøåíèå óðàâíåíèé................................ 7.3. Ñèìâîëüíîå ðåøåíèå íåðàâåíñòâ.............................. 138
8. Ðåøåíèå ñèñòåì óðàâíåíèé................................................. 8.1. ×èñëåííîå è ñèìâîëüíîå ðåøåíèå ñèñòåì ëèíåéíûõ àëãåáðàè÷åñêèõ óðàâíåíèé................................ 8.2. Âû÷èñëåíèå ñîáñòâåííûõ çíà÷åíèé è âåêòîðîâ........ 9. Âû÷èñëåíèå ïðåäåëîâ, ñóìì, ïðîèçâåäåíèé.................... 9.1. Ñèìâîëüíîå âû÷èñëåíèå ïðåäåëîâ............................ 9.2. ×èñëåííîå è ñèìâîëüíîå âû÷èñëåíèå ñóìì è ïðîèçâåäåíèé........................................................................ 10. Âû÷èñëåíèå ïðîèçâîäíûõ, èíòåãðàëîâ Çàäà÷è íà ýêñòðåìóì................................................................ 10.1. Âû÷èñëåíèå ïðîèçâîäíûõ.......................................... 10.2. Âû÷èñëåíèå èíòåãðàëîâ............................................. 10.3. Çàäà÷è íà ýêñòðåìóì................................................... 11. Ðåøåíèå äèôôåðåíöèàëüíûõ óðàâíåíèé......................... 11.1. Ðåøåíèå çàäà÷è Êîøè è ãðàíè÷íîé çàäà÷è ñ ïîìîùüþ odesolve.............................................................. 11.2. Ðåøåíèå çàäà÷è Êîøè äëÿ íîðìàëüíîé ñèñòåìû îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé................ 11.3. Àâòîíîìíûå ñèñòåìû îáûêíîâåííûõ äèôôåðåíöèàëüíûõ óðàâíåíèé........................................ 11.4. Àíàëèòè÷åñêîå ðåøåíèå äèôôåðåíöèàëüíûõ óðàâíåíèé............................................................................ 12. Ïðîãðàììèðîâàíèå â MathCAD......................................... Ïðèëîæåíèå 1........................................................................ Ëèòåðàòóðà...............................................................................
139
Ó÷åáíîå èçäàíèå Øóøêåâè÷ Ãåííàäèé ×åñëàâîâè÷ Øóøêåâè÷ Ñâåòëàíà Âëàäèìèðîâíà
Ââåäåíèå â MàthCAD 2000 ó÷åáíîå ïîñîáèå
Ðåäàêòîð Í.Ï.Äóäêî Êîìïüþòåðíàÿ â¸ðñòêà: Ò.À.Êîâàëåíêî
Ñäàíî â íàáîð 04.07.2001. Ïîäïèñàíî â ïå÷àòü 01.10. 2001. Ôîðìàò 60õ84/16. Áóìàãà îôñåòíàÿ ¹1. Ïå÷àòü îôñåòíàÿ. Ãàðíèòóðà Òàéìñ. Óñë.ïå÷.ë. 8,0. Ó÷.-èçä.ë. 7,59. Òèðàæ 600 ýêç. Çàêàç . Íàëîãîâàÿ ëüãîòà Îáùåãîñóäàðñòâåííûé êëàññèôèêàòîð Ðåñïóáëèêè Áåëàðóñü ÎÊÐÁ 007-98, ÷.1, 22.11.20.600. Ó÷ðåæäåíèå îáðàçîâàíèÿ «Ãðîäíåíñêèé ãîñóäàðñòâåííûé óíèâåðñèòåò èìåíè ßíêè Êóïàëû». Ë ¹96 îò 02.12.97 Óë. Îæåøêî, 22, 230023, Ãðîäíî. Îòïå÷àòàíî íà òåõíèêå èçäàòåëüñêîãî îòäåëà Ó÷ðåæäåíèÿ îáðàçîâàíèÿ «Ãðîäíåíñêèé ãîñóäàðñòâåííûé óíèâåðñèòåò èìåíè ßíêè Êóïàëû». ËÏ ¹111 îò 29.12.97 Óë. Îæåøêî, 22, 230023, Ãðîäíî.
140