applying a set of conditions for first order ord. diff. eqn.
Subject: applying a set of conditions for first order ord. diff. eqn.
From: Edwin Woollett
Date: Mon, 30 Jan 2012 12:12:43 -0800
Hi Jerome,
Thanks for the kind comments.
I don't think you can use ic2 for this type of
first order ordinary differential equation, as
you suggest in your pdf file description of this
problem.
Instead you can use ic1 to evaluate something
unknown in your equation, and then use solve
to satisfy the rest of the conditions.
===================
Your differential equation can be written
as du/dz - a u + b = 0, where the three
conditions are: u = 0 when
z = +/- 1, and integrate(u,z,-1,1) = 2,
(a global condition rather than local)
and a and b are constants.
We can simplify this differential equation
by dividing by a and letting r = b/a and
x = a z, so u = 0 when x = +/- a.
(I use r rather than c because ic1 uses %c as
a constant of integration, and one can
get confused.)
We then have to solve
du/dx - u + r = 0, subject first to
u = 0 at x = +/- a.
After applying these two conditions, to
find a and r, we can
replace x --> a z and apply the integral
condition as written above.
--------------------------------
Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
(%i1) display2d:false$
(%i2) de : 'diff (u,x) - u + r = 0;
(%o2) 'diff (u,x,1) - u + r = 0
(%i3) gsoln : ode2 (de, u, x);
(%o3) u = (r*%e^-x+%c)*%e^x
(%i4) psoln : ic1(gsoln, x = -a, u = 0);
(%o4) u = r - r*%e^(x + a)
(%i5) us : rhs (psoln);
(%o5) r - r*%e^(x + a)
(%i6) solve (subst (x = a, us), a);
(%o6) [a = log (-1), a = 0]
/* We don't want a = 0, so I looked at the
float of log(-1) to guess what it can be
replaced by */
(%i7) map ('float, [log (-1), %i*%pi]);
(%o7) [3.141592653589793*%i, 3.141592653589793*%i]
(%i8) us : subst (a = %i*%pi, us);
(%o8) r*%e^x + r
(%i9) us : subst (x = %i*%pi*z, us);
(%o9) r*%e^(%i*%pi*z) + r
(%i10) solve (integrate (us, z, -1, 1) = 2, r);
(%o10) [r = 1]
(%i11) us : subst (r = 1, us);
(%o11) %e^(%i*%pi*z) + 1
------------------------------
Hope this approach is helpful as
a start.
Ted Woollett
======================
----- Original Message -----
From: Laboratoire.Vulcain
To: woollett at charter.net
Sent: Saturday, January 28, 2012 7:07 AM
Subject: maxima feedback
from Mr Jerome Huck
Dear Professor,
this email to thank you for your Maxima by Example. I am a seniro aerospace
engineer and scientist.
I used more supercomputers to make calculations in the CFD area.
I am reading one old book on MHD and I tried to use Maxima to find
analytical solutions. I read the documentation and your Maxima by Example.
I have some troubles with hyperbolic functions or the simplification of
those functions. I attached my example. I will enjoy to have your point of
view on my questions.
Thanks in advance.
Best regards.
Jerome Huck.