You are still tied to your previous conventions and notations. You say
that y is not a function of x.
Then you say that you wish to manipulate dy/dx. Sorry, but if y is not
a function of x, then dy/dx is
always zero.
nijso beishuizen wrote:
> On Sunday 30 November 2008 22:18:24 Richard Fateman wrote:
>
>> Rather than ask how to implement your traditional, yet ambiguous
>> notation on Maxima, I suggest that you start by changing your notation
>> completely to correspond to what is supported in Maxima.
>>
>
> Actually, I'd rather have a piece of code that is self-explanatory and has
> some resemblance to what it mathematically means.
> I've only used maxima for six weeks now so I write functions with what I know
> and improve it later with what I've learned.
>
>
>> I think this will then make your problem easy to compute, instead of
>> hard to even explain.
>>
>
> I think this problem is not easy to compute and even harder to explain. And
> this is just one simple recursion formula. But you are right that it is
> easier to do both if you write good code.
>
>
>> For example, Maxima can operate with computational functions, arrays,
>> and array functions like n[i](x,y), and infix operations like +, *.
>>
>> The notation you present using includes operators like Dx and ', which
>> are not supported.
>>
> I have no idea what you mean. the operator Dx should be a function in maxima,
> and I don't use ' in the example code.
>
In your explanation, you use
n(1) = Dx(n) - y' * Dx(xi)
Now if you wish n (or eta) to be notated as n(1) and you also wish to
use it as an argument to Dx(n),
then you either need to have 2 different names, or use the name the same
way, with one argument.
>
>> If you define a function n of one argument, then
>> n() or just n is wrong.
>>
> So? n always has one argument, which is k, the integer number of prolongations
> that you want to have. The code doesn't even work yet, so handling wrong
> input is not really an issue yet.
>
So you mean to say that n[1]:= Dx(n[1]) - 'diff(y,x)*Dx(xi) ??
When you say "wrong input", you miss the point. The line is
syntactically wrong with Dx(n) in it.
It is as though you say that your Fortran program can have missing
characters in it, and that is OK because
you haven't worried about wrong input. Your program is incorrect.
>
>> if xi means x_i perhaps it should be
>> X[i], and if it is a function of x and y
>> perhaps X[i](x,y). and if y is a function of x, then perhaps it should
>> always be written as y(x).
>>
> xi is xi. not x_i If I write xi, it will become a nice latex \xi in emacs,
> which corresponds with the traditional way it is written in mathematics
> literature. There is only one xi, which is xi(x,y)
>
OK, so please write it as xi(x,y) !
>
>> You have not distinguished between bound and local variables, either
>>
> Sorry about that ;-(
>
>>
>>
>> n[1](x,y):= Totalderiv(n[0](x,y))
>> -diff(y(x),x)*Totalderiv(X[i]x,y)); ;;; should be n[0](x,y(x)) ???
>> n[k](x,,y):= Totalderiv(n[k-1](x,y))- diff(y(x),x,k)*Totalderiv(X[i]x,y));
>> Totalderiv(z):=diff(z,x)+diff(y(x),x)*diff(z,y); ;;; totally ambiguous
>> if z contains y, is y the same regardless?
>>
>
> I know my code was ambiguous and I also don't like it. but in that way, it
> resembles the mathematical recursion equation the most.
> y is never a function of x, but to get a dy/dx term, I needed to use either
> y(x) or the 'diff(y,x). Why? Because this is the current limit of my maxima
> knowledge.
>
If you want to indicate that y depends on x but in some way you do not
know, try using dependencies.
>
>
>> Please look at examples of using Maxima.
>>
>
> I think discussing my problem here is more fruitful than looking again at
> maxima examples, although I am very grateful for the link to the macsyma code
> of Hereman where similar problems are solved by using defrule and putting
> everything in lists.
>
This is true for you, but probably not for other people responding to
you. I think it would be better if you learned more Maxima.
in particular how to use n[i]:= ... array functions.
RJF