Using the Omega CAS Explorer, we can confirm the solution(s) for a given differential equation.
Fig. 1
In Fig. 1, for instance, applying ‘ode2’ to the following differential equation:
yields an explicit expression for :
To validate as a solution, we substitute (2) into (1) for evaluation. The simplified result confirms that expressed in (2) indeed satisfies the given differential equation.
Now, consider
Fig. 2
The solver gives an implicit solution
Obtaining an explicit from (4) is challenging. However, the verification is surprisingly simple: By declaring that is a function of and then differentiating (4), we recover the solved differential equation! This is an indication that implicit solution (4) satisfies the differential equation. i.e., (4) is a solution of (3).
Fig. 3
Alternatively, the verification process can be simplified by employing the ‘ode_check’ function (see Fig. 3 ) in the ‘contrib_ode’ package, as illustrated in Fig. 4.
Fig. 4
It is noteworthy that while the differential equation is solved using ‘ode2’, if ‘contrib_ode’ is chosen instead, the solution for verification needs to be extracted from a list before invoking ‘ode_check’:
Fig. 5
“Austrian trains are always late. A Prussian visitor asks the Austrian conductor why they bother to print timetables. The conductor replies “If we did not, how would we know how late the trains are?” – Victor Weisskopf
Exercise-1 Obtain (4) without using a CAS.
Exercise-2 For grins, let us solve (4) for the s and show that they are the solutions of (3).
Maxima’s vector is implemented as a list. For example, v: [1,2].
How a vector in Maxima behaves depends on the context it is in.
v:[1,2];
m:matrix([1,2], [3,4]);
m.v;
outputs:
so v is a column vector:
.
However, given
v:[1,2];
m:matrix([1,2], [3, 4]);
v.m;
v behaves as a row vector:
i.e.,
.
Maxima is smart enough to compute the inner product of two vectors:
That is,
.
Notice we multiply vectors by ‘.’ . If ‘*’ is used instead then the result is a list which is incorrect:
In the past, I wrote the row vector as a 1 by n matrix and the column vector n by 1 matrix. Thanks to Josef Leydold and Martin Petry, the authors of “Introduction to Maxima for Economics“, I now express the vector as a list and let maxima figure out whether the list is a row vector or column vector.