|
From: Barton W. <wi...@un...> - 2025-06-14 10:36:36
|
In case you didn't notice, the second email in the thread of my previous post contains a quickly written Maxima implementation of the apply_noun function, contributed by Stavros. Specifically
(%i1) apply_noun(expr,noun) :=
(noun:nounify(noun),
apply_noun_freenoun(expr))$
(%i2) apply_noun_freenoun(expr):= (
if atom(expr) then expr
else
block([rec: map('apply_noun_freenoun,args(expr))],
if subvarp(expr)
then arraymake(apply_noun_freenoun(op(expr)),rec)
elseif op(expr)=noun then
apply(verbify(noun),rec)
else funmake(apply_noun_freenoun(op(expr)),rec)))$
Example:
(%i3) e : 'diff(x^2+y,x);
(e) 'diff((y+x^2),x,1)
(%i4) apply_noun(e,'diff);
(%o4) 2*x
________________________________
From: Barton Willis via Maxima-discuss <max...@li...>
Sent: Friday, June 13, 2025 2:29 PM
To: Stavros Macrakis <mac...@gm...>; Aleksas Domarkas <ale...@gm...>
Cc: <max...@li...> <max...@li...>
Subject: Re: [Maxima-discuss] solve identity
Caution: Non-NU Email
https://sourceforge.net/p/maxima/mailman/message/36618714/<https://urldefense.com/v3/__https://sourceforge.net/p/maxima/mailman/message/36618714/__;!!PvXuogZ4sRB2p-tU!DgQsXpZN8wpM2a87O3fGI6hGxVuq7hVlzmSkU9drdlOgmTyiwjKLVuWgwBkK4r1iE49fiUQON7j2CzW0l_pA8cqtCxuhv8CgQg$>
Sent from my U.S.Cellular© Smartphone
Get Outlook for Android<https://urldefense.com/v3/__https://aka.ms/AAb9ysg__;!!PvXuogZ4sRB2p-tU!DgQsXpZN8wpM2a87O3fGI6hGxVuq7hVlzmSkU9drdlOgmTyiwjKLVuWgwBkK4r1iE49fiUQON7j2CzW0l_pA8cqtCxuN30Vebg$>
________________________________
From: Stavros Macrakis <mac...@gm...>
Sent: Friday, June 13, 2025 8:08:16 AM
To: Aleksas Domarkas <ale...@gm...>
Cc: Barton Willis <wi...@un...>; <max...@li...> <max...@li...>
Subject: Re: [Maxima-discuss] solve identity
Caution: Non-NU Email
Hello, Aleksas,
Thanks for your contribution.
I strongly recommend that you not use ev to perform substitutions. Rather than ev(eq,tr), use subst(tr,eq). This avoids surprising effects from ev.
Unfortunately, we don't currently have an alternative to ev(...,nouns). Even worse, we have no way of applying that to an expression without evaluating variables in that expression. We should fix that. In the meantime, I would recommend using ev(...,diff) to be more precise about why you're using nouns. I would also recommend that you use the syntax factor(...) rather than ev(...,factor).
-s
On Wed, Jun 11, 2025 at 9:10 AM Aleksas Domarkas <ale...@gm...<mailto:ale...@gm...>> wrote:
Let y=f(x) is particular solution of Riccati equation.
Applying the transformation y=u+f(x) gives
Bernoulli ODE for u=u(x), which is easy to solve.
You can easily perform each step of the solution by hand or computer.
Example from
Problem 246<https://urldefense.com/v3/__https://www.12000.org/my_notes/solving_ODE/current_version/chapters/Ordinary_differential_equations_and_their_solutions_By_George_Moseley_Murphy_1960/indexsubsection239.htm*x251-16510002.9.6__;Iw!!PvXuogZ4sRB2p-tU!D0DOIsZabVeGZPpnFWZPfY3IwDy6du1lMMp6vehiAWIOy4-mkiz-zH97k6w5SCn10HyU2qQPIRoYB34$>
Particular solution or Riccati equation
eq:3*x*'diff(y,x)=3*x^(2/3)+(1-3*y)*y
is y=-x^(1/3)
load(contrib_ode)$
eq:3*x*'diff(y,x)=3*x^(2/3)+(1-3*y)*y$
%e_to_numlog:true$
tr:y=u(x)-x^(1/3)$
ev(eq,tr),nouns$
solve(%,diff(u(x),x))[1],expand$
ode2(%,u(x),x)$
sol:ev(tr,%),factor;
y=(x^(1/3)*(%e^(6*x^(1/3))-2*%c))/(%e^(6*x^(1/3))+2*%c)
ode_check(eq,sol);
0
Aleksas
2025-06-10, an, 14:20 Barton Willis <wi...@un...<mailto:wi...@un...>> rašė:
I'm guessing that the Maple function identity(T,x,[a,b]) determines conditions on 'a' and 'b' that makes the expression 'T' vanish.
If so, that seems like a handy function. If it hasn't been done already, maybe somebody could implement something like this in Maxima. It's the kind of function that cannot be perfect, but it could be useful.
________________________________
From: Aleksas Domarkas <ale...@gm...<mailto:ale...@gm...>>
Sent: Monday, June 9, 2025 11:39 PM
To: <max...@li...<mailto:max...@li...>> <max...@li...<mailto:max...@li...>>
Subject: [Maxima-discuss] solve identity
Caution: Non-NU Email
In Maple
T:=3*a^2*x^(2*b)+(3*a*b-a)*x^b-3*x^(2/3)=0:
solve(identity(T,x,[a,b]);
return
[[a=-1,b=1/3],[a=1,b=1/3]]
How to do it with Maxima ?
I am looking solution y=a*x^b of Riccati eguation
3*x*'diff(y,x)=3*x^(2/3)+(1-3*y)*y;
Aleksas
_______________________________________________
Maxima-discuss mailing list
Max...@li...<mailto:Max...@li...>
https://lists.sourceforge.net/lists/listinfo/maxima-discuss<https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/maxima-discuss__;!!PvXuogZ4sRB2p-tU!D0DOIsZabVeGZPpnFWZPfY3IwDy6du1lMMp6vehiAWIOy4-mkiz-zH97k6w5SCn10HyU2qQPKGW_tSQ$>
|