# exponential matrix

Is there a command to compute the exponential of a matrix using GAUSS? I am not talking about the element by element exponential. I talking about the exponential of a matrix as given in the following definition:

https://en.wikipedia.org/wiki/Matrix_exponential

0

GAUSS does not have a built-in function for this yet, however, this code should do what you want:

``````A = { -0.57417717      -0.87184947       0.72815309      -0.75585604,
2.5429514       0.81242011    -0.0053033693      -0.67348003,
-0.50066776       -2.1355249        1.8998340       -2.0122135,
-1.6892236      -0.77342078      -0.77691244      -0.27255544 };
emat = expm(A);

proc (1) = expm(A);
local eval, evec, out;
{ eval, evec } = eigv(A);

out = evec * (eye(rows(eval)) .* exp(eval)) * inv(evec);

retp(real(out));
endp;``````
``` Where emat should end up as: -0.84691011 -2.2387765 2.0983160 -1.1356752 2.5053272 -0.71110282 3.5202087 -3.1394592 -4.2278307 -6.5585548 7.4120945 -3.6513710 -0.57884903 2.3984690 -4.1551865 3.3012497 ```
``` link aptech 1,773 ```
``` ```
``` Your Answer ```
``` ```
``` 1 Answer 0 GAUSS does not have a built-in function for this yet, however, this code should do what you want: A = { -0.57417717 -0.87184947 0.72815309 -0.75585604, 2.5429514 0.81242011 -0.0053033693 -0.67348003, -0.50066776 -2.1355249 1.8998340 -2.0122135, -1.6892236 -0.77342078 -0.77691244 -0.27255544 }; emat = expm(A); proc (1) = expm(A); local eval, evec, out; { eval, evec } = eigv(A); out = evec * (eye(rows(eval)) .* exp(eval)) * inv(evec); retp(real(out)); endp; Where emat should end up as: -0.84691011 -2.2387765 2.0983160 -1.1356752 2.5053272 -0.71110282 3.5202087 -3.1394592 -4.2278307 -6.5585548 7.4120945 -3.6513710 -0.57884903 2.3984690 -4.1551865 3.3012497 linkaptech1,773 You must login to post answers. ```
``` ```
``` Forum Search Login Username Password Remember Me RegisterLost PasswordRecent TopicsCurvefit _cv_IterDataComment on CurvefitBai and Carrion-i-Silvestre (2009) Panel unit root testsVariable Initialized Error: Bhat MDCEV(2008)MDCNEV_bhat_code_undefined_symbol_lpr errorUser Forum Join our community to see why our users are considered some of the most active and helpful in the industry! User Forum ```
``` ```
``` Have a Specific Question? Get a real answer from a real person Need Support? Get help from our friendly experts. ```
``` Have a Specific Question? Get a real answer from a real person CONTACT US GAUSS is the product of decades of innovation and enhancement by Aptech Systems, a supportive team of experts dedicated to the success of the worldwide GAUSS user community. Aptech helps people achieve their goals by offering products and applications that define the leading edge of statistical analysis capabilities. NAVIGATION Products Industry Solutions Support Where to Buy Resources Blog Contact Us CONTACTS [email protected] (360) 886-7100 FAX: (360) 886-8922 Monday-Thursday: 8:00 AM - 4:00 PM Friday: 8:00 AM - 3:00 PM Aptech Systems, Inc PO Box 618 Higley, AZ 85236 © 2024 Aptech Systems, Inc. All rights reserved. Privacy Policy ```
``` .saboxplugin-wrap{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;border:1px solid #eee;width:100%;clear:both;display:block;overflow:hidden;word-wrap:break-word;position:relative}.saboxplugin-wrap .saboxplugin-gravatar{float:left;padding:0 20px 20px 20px}.saboxplugin-wrap .saboxplugin-gravatar img{max-width:100px;height:auto;border-radius:0;}.saboxplugin-wrap .saboxplugin-authorname{font-size:18px;line-height:1;margin:20px 0 0 20px;display:block}.saboxplugin-wrap .saboxplugin-authorname a{text-decoration:none}.saboxplugin-wrap .saboxplugin-authorname a:focus{outline:0}.saboxplugin-wrap .saboxplugin-desc{display:block;margin:5px 20px}.saboxplugin-wrap .saboxplugin-desc a{text-decoration:underline}.saboxplugin-wrap .saboxplugin-desc p{margin:5px 0 12px}.saboxplugin-wrap .saboxplugin-web{margin:0 20px 15px;text-align:left}.saboxplugin-wrap .sab-web-position{text-align:right}.saboxplugin-wrap .saboxplugin-web a{color:#ccc;text-decoration:none}.saboxplugin-wrap .saboxplugin-socials{position:relative;display:block;background:#fcfcfc;padding:5px;border-top:1px solid #eee}.saboxplugin-wrap .saboxplugin-socials a svg{width:20px;height:20px}.saboxplugin-wrap .saboxplugin-socials a svg .st2{fill:#fff; transform-origin:center center;}.saboxplugin-wrap .saboxplugin-socials a svg .st1{fill:rgba(0,0,0,.3)}.saboxplugin-wrap .saboxplugin-socials a:hover{opacity:.8;-webkit-transition:opacity .4s;-moz-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s;box-shadow:none!important;-webkit-box-shadow:none!important}.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-color{box-shadow:none;padding:0;border:0;-webkit-transition:opacity .4s;-moz-transition:opacity .4s;-o-transition:opacity .4s;transition:opacity .4s;display:inline-block;color:#fff;font-size:0;text-decoration:inherit;margin:5px;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;overflow:hidden}.saboxplugin-wrap .saboxplugin-socials .saboxplugin-icon-grey{text-decoration:inherit;box-shadow:none;position:relative;display:-moz-inline-stack;display:inline-block;vertical-align:middle;zoom:1;margin:10px 5px;color:#444;fill:#444}.clearfix:after,.clearfix:before{content:' ';display:table;line-height:0;clear:both}.ie7 .clearfix{zoom:1}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-twitch{border-color:#38245c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-addthis{border-color:#e91c00}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-behance{border-color:#003eb0}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-delicious{border-color:#06c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-deviantart{border-color:#036824}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-digg{border-color:#00327c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-dribbble{border-color:#ba1655}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-facebook{border-color:#1e2e4f}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-flickr{border-color:#003576}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-github{border-color:#264874}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-google{border-color:#0b51c5}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-googleplus{border-color:#96271a}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-html5{border-color:#902e13}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-instagram{border-color:#1630aa}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-linkedin{border-color:#00344f}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-pinterest{border-color:#5b040e}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-reddit{border-color:#992900}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-rss{border-color:#a43b0a}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-sharethis{border-color:#5d8420}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-skype{border-color:#00658a}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-soundcloud{border-color:#995200}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-spotify{border-color:#0f612c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-stackoverflow{border-color:#a95009}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-steam{border-color:#006388}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-user_email{border-color:#b84e05}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-stumbleUpon{border-color:#9b280e}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-tumblr{border-color:#10151b}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-twitter{border-color:#0967a0}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-vimeo{border-color:#0d7091}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-windows{border-color:#003f71}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-whatsapp{border-color:#003f71}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-wordpress{border-color:#0f3647}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-yahoo{border-color:#14002d}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-youtube{border-color:#900}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-xing{border-color:#000202}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-mixcloud{border-color:#2475a0}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-vk{border-color:#243549}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-medium{border-color:#00452c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-quora{border-color:#420e00}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-meetup{border-color:#9b181c}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-goodreads{border-color:#000}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-snapchat{border-color:#999700}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-500px{border-color:#00557f}.saboxplugin-socials.sabox-colored .saboxplugin-icon-color .sab-mastodont{border-color:#185886}.sab-patreon{border-color:#fc573b}.sabox-plus-item{margin-bottom:20px}@media screen and (max-width:480px){.saboxplugin-wrap{text-align:center}.saboxplugin-wrap .saboxplugin-gravatar{float:none;padding:20px 0;text-align:center;margin:0 auto;display:block}.saboxplugin-wrap .saboxplugin-gravatar img{float:none;display:inline-block;display:-moz-inline-stack;vertical-align:middle;zoom:1}.saboxplugin-wrap .saboxplugin-desc{margin:0 10px 20px;text-align:center}.saboxplugin-wrap .saboxplugin-authorname{text-align:center;margin:10px 0 20px}}body .saboxplugin-authorname a,body .saboxplugin-authorname a:hover{box-shadow:none;-webkit-box-shadow:none}a.sab-profile-edit{font-size:16px!important;line-height:1!important}.sab-edit-settings a,a.sab-profile-edit{color:#0073aa!important;box-shadow:none!important;-webkit-box-shadow:none!important}.sab-edit-settings{margin-right:15px;position:absolute;right:0;z-index:2;bottom:10px;line-height:20px}.sab-edit-settings i{margin-left:5px}.saboxplugin-socials{line-height:1!important}.rtl .saboxplugin-wrap .saboxplugin-gravatar{float:right}.rtl .saboxplugin-wrap .saboxplugin-authorname{display:flex;align-items:center}.rtl .saboxplugin-wrap .saboxplugin-authorname .sab-profile-edit{margin-right:10px}.rtl .sab-edit-settings{right:auto;left:0}img.sab-custom-avatar{max-width:75px;}.saboxplugin-wrap .saboxplugin-authorname {font-family:"Lato";}.saboxplugin-wrap .saboxplugin-desc {font-family:Lato;}.saboxplugin-wrap {margin-top:0px; margin-bottom:0px; padding: 0px 0px }.saboxplugin-wrap .saboxplugin-authorname {font-size:18px; line-height:25px;}.saboxplugin-wrap .saboxplugin-desc p, .saboxplugin-wrap .saboxplugin-desc {font-size:14px !important; line-height:21px !important;}.saboxplugin-wrap .saboxplugin-web {font-size:14px;}.saboxplugin-wrap .saboxplugin-socials a svg {width:18px;height:18px;}.saboxplugin-tabs-wrapper { width: 100%; display: block; clear: both; overflow: auto; } .saboxplugin-tabs-wrapper ul{ margin:0px; padding: 0px; } .saboxplugin-tabs-wrapper ul li { list-style: none; float: left; color: #222222; padding: 8px 20px; background-color: #e4e4e4; box-sizing: border-box; margin-right: 1px; border-bottom: 1px solid #c7c7c7; } .saboxplugin-tabs-wrapper ul li.active, .saboxplugin-tabs-wrapper ul li:hover{ color: #222222; background-color: #efefef; border-bottom: 1px solid #c7c7c7; cursor:pointer; } .saboxplugin-tab{ padding:20px; } .saboxplugin-tab ul{ margin:0px; padding: 0px; } .saboxplugin-tab ul li{ list-style: none; }.saboxplugin-authorname .sabox-job-title{font-size:12px;opacity:.7;display: inline-block;margin-left: 10px;} /* <![CDATA[ */ var wpcf7 = {"api":{"root":"https:\/\/www.aptech.com\/wp-json\/","namespace":"contact-form-7\/v1"}}; /* ]]> */ /* <![CDATA[ */ var wpcf7cf_global_settings = {"ajaxurl":"https:\/\/www.aptech.com\/wp-admin\/admin-ajax.php"}; /* ]]> */ /* <![CDATA[ */ var wpcf7_recaptcha = {"sitekey":"6Lf8Ln0UAAAAALE3vXP6zpQ4lsuw93talItU7HWt","actions":{"homepage":"homepage","contactform":"contactform"}}; /* ]]> */ /* <![CDATA[ */ var sidebar_login_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","force_ssl_admin":"1","is_ssl":"1","i18n_username_required":"Please enter your username","i18n_password_required":"Please enter your password","error_class":"sidebar-login-error"}; /* ]]> */ jQuery(document).ready(function(\$) { \$( '.search-trigger' ).on( 'focus, click', function( event ) { event.preventDefault(); \$( '#full-screen-search' ).addClass( 'open' ); \$( '#full-screen-search input' ).focus(); }); \$( '#full-screen-search button.close' ).on( 'click', function( event ) { // Prevent the default event event.preventDefault(); // Hide the Full Screen Search \$( '#full-screen-search' ).removeClass( 'open' ); } ); }); ```