<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Weird results with MUESLI mfExpm]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=196&amp;type=atom" />
	<updated>2013-05-17T16:47:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=196</id>
		<entry>
			<title type="html"><![CDATA[Re: Weird results with MUESLI mfExpm]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=783#p783" />
			<content type="html"><![CDATA[<p>Thanks for the update!&nbsp; I couldn&#039;t really address your original problem due to my own unfamiliarity with MUESLI, but it sounds like the problem has been resolved.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-05-17T16:47:21Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=783#p783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Weird results with MUESLI mfExpm]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=782#p782" />
			<content type="html"><![CDATA[<p>There was actually a bug in MUESLI, which Édouard Canot plans to fix in the next release. The bug was not in mfExpm, but in msDiag, which I used for creating the matrix A. Matrix A was tagged as diagonal, although it was not. That is why mfExpm gave wrong results. One can check the diagonality tag by command mfIsDiag(A). If the value is erroneously true, one can, for example, set some off-diagonal values nonzero before using msDiag.</p>]]></content>
			<author>
				<name><![CDATA[akemppin]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3418</uri>
			</author>
			<updated>2013-05-17T11:26:54Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=782#p782</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Weird results with MUESLI mfExpm]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=776#p776" />
			<content type="html"><![CDATA[<p>I am using MUESLI-2.6.6 (Optimized, DLL) in SF 1.41. I would like to use the mfExpm function to compute time development. Essentially I am solving a differential equation dp/dt = A(t)*p where p is a probability distribution. The transition rates in A(t) can easily vary by 10 orders of magnitude, making the problem very stiff. I try to compute simply: p(t+dt)=exp(A(t)*dt)*p(t). The computation of A(t) is rather complicated and I will not present it here. If A(t) is kept constant in time, A(t)=A, the probability distribution should in long time scales converge to a certain value. In this example, I test this convergence by computing mfExpm(A * very long time). Here is a simplified version of my test program:</p><p>-------<br />integer, parameter :: dp = kind(0.d0)<br />type(mfArray) :: A, Aascii, Ambf<br />real (dp) :: bignumber</p><p>call createtables&nbsp; !This computes matrix A</p><p>bignumber=1.0e10_dp<br />call msDisplay(mfExpm(bignumber*A),&#039;exp(bignumber*A)&#039;)<br />call msSaveAscii(&#039;A.txt&#039;,A)<br />Aascii=mfLoadAscii(&#039;A.txt&#039;)<br />call msDisplay(mfExpm(bignumber*Aascii),&#039;exp(bignumber*Aascii)&#039;)<br />call msSave(&#039;A.mbf&#039;,A)<br />Ambf=mfLoad(&#039;A.mbf&#039;)<br />call msDisplay(mfExpm(bignumber*Ambf),&#039;exp(bignumber*Ambf)&#039;)<br />------------------</p><p>The output is here:<br />---------------------<br /> exp(bignumber*A) =</p><p>&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.1394&nbsp; &nbsp; 0.2664&nbsp; &nbsp; 0.5053&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 0.5053&nbsp; &nbsp; 0.2664<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000</p><br /><p> exp(bignumber*Aascii) =</p><p>&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000</p><br /><p> exp(bignumber*Ambf) =</p><p>&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000&nbsp; &nbsp; 1.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000<br />&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000&nbsp; &nbsp; 0.0000</p><p>-------------------------------</p><p>The first result is clearly wrong, but the next two are correct. I am wondering, how can it be possible, that saving A to a file (either binary or ascii) and loading it helps to obtain correct numerical results?</p>]]></content>
			<author>
				<name><![CDATA[akemppin]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3418</uri>
			</author>
			<updated>2013-05-08T13:30:08Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=776#p776</id>
		</entry>
</feed>
