janhardo

700 Reputation

12 Badges

11 years, 43 days

MaplePrimes Activity


These are replies submitted by janhardo

more abstract procedure for adomian 2 variable polynome , not subscripted, general use

abstracte_adomian_polynoom_2_variable_mapleprocedure_engels_.mw

Adomian polynomes for two variables

adoniam_polynoom_voor_2_variabelen_6-11-2024.mw

@salim-barzani 
There are two procedures for calculating adomian procedures for one variable here in this thread
- you can use code after using : AP1 := proc(f, M) or AP2 := proc(f, M)
- or built in the code by yourself as exercise into the two procedures code

Note: why would you want to destroy it..seems to be not useful for you?

# Define the list L
L := [%][]: # Adjust this list as desired
# Display the entire list
#print("The list L is:", L);
# Display each element individually with the name A[i]
for i from 1 to nops(L) do
    A[i-1] := L[i];
    #print(A[i-1]);
end do;

You can use this at the end of the procedures after calculation  or built it in. 

adomian_polynomenvia_mathematica_-boek_ode_zwillingr_info_A.mw

@salim-barzani 
Getting a procedure for 2 variables adomian polynoms ?
Seems to be in Mathematica no problem ( must test this), but a translation to maple code is unsure

# Define the list L
L := [%][]: # Adjust this list as desired
# Display the entire list
#print("The list L is:", L);
# Display each element individually with the name A[i]
for i from 1 to nops(L) do
    A[i-1] := L[i];
    #print(A[i-1]);
end do;

You can use this at the end of the procedures after calculation  or built it in. 

@salim-barzani 
This must be added in the two procedures , in the right way, because the list  is different 

# Define the list L
L := [a, b, c, d, e]; # Adjust this list as desired

# Display the entire list
#print("The list L is:", L);

# Display each element individually with the name A[i]
for i from 1 to nops(L) do
    A[i-1] := L[i];
    #print(A[i-1]);
end do;

Here are two procedures different programmed  to calculate a adomian polynome for one variable 

AP1 := proc(f, M)
    local F, i, A, u, s, expr, k;
    
    # Initialize F[0]
    F[0] := f(add(u[k] * s^k, k = 0 .. M));
    
    # Loop to define A[i] and update F[i+1]
    for i from 0 to M do
        A[i] := expand((1/factorial(i)) * subs(s = 0, F[i]));
        F[i+1] := diff(F[i], s);
    end do;
    
    # Return the list of A[i]
    [seq(A[i], i = 0 .. M)]
end proc:
 

# Define f as an anonymous function (Maple uses arrow syntax for functions)
f := x -> x^2;

# Execute the procedure with f and M = 3
result := AP1(f, 3);

proc (x) options operator, arrow; x^2 end proc

 

[u[0]^2, 2*u[0]*u[1], 2*u[0]*u[2]+u[1]^2, 2*u[0]*u[3]+2*u[1]*u[2]]

(1)

# Define the function f(x) = exp(x^2)
f1 := x -> exp(x^2);

proc (x) options operator, arrow; exp(x^2) end proc

(2)

# Execute the procedure with f1 and M = 3
result := AP1(f1, 3);

[exp(u[0]^2), 2*u[0]*u[1]*exp(u[0]^2), u[1]^2*exp(u[0]^2)+2*u[0]*u[2]*exp(u[0]^2)+2*u[0]^2*u[1]^2*exp(u[0]^2), 2*u[1]*exp(u[0]^2)*u[2]+2*u[1]^3*u[0]*exp(u[0]^2)+2*u[0]*u[3]*exp(u[0]^2)+4*u[0]^2*u[2]*u[1]*exp(u[0]^2)+(4/3)*u[0]^3*u[1]^3*exp(u[0]^2)]

(3)

 

 

restart;

"maple.ini in users"

(4)

AP2 := proc(f, M)
    local c, n, k, j, der, A;

    # Initialize c[n, k] for the tables we need
    c := array(1..M, 1..M):
    A := array(0..M):

    # Create a list of the derivatives of f with respect to u[0]
    der := [seq(diff(f(u[0]), u[0]$k), k = 1 .. M)];

    # Set the initial value of A[0]
    A[0] := f(u[0]);

    # Outer loop for n from 1 to M
    for n from 1 to M do
        c[n, 1] := u[n];

        # Inner loop for k from 2 to n
        for k from 2 to n do
            c[n, k] := expand((1/n) * add((j + 1) * u[j + 1] * c[n - 1 - j, k - 1], j = 0 .. n - k));
        end do;

        # Calculate A[n] by taking the first n derivatives and multiplying by c[n, k]
        A[n] := add(der[k] * c[n, k], k = 1 .. n);
    end do;

    # Return the result as a list of A[n] for n from 0 to M
    [seq(A[n], n = 0 .. M)]
end proc:

# Define f as an anonymous function (Maple uses arrow syntax for functions)
f := x -> x^2;

# Execute the procedure with f and M = 3
result := AP2(f, 3);

proc (x) options operator, arrow; x^2 end proc

 

[u[0]^2, 2*u[0]*u[1], 2*u[0]*u[2]+u[1]^2, 2*u[0]*u[3]+2*u[1]*u[2]]

(5)
 

 

Download adomian_polynomenvia_mathematica_-boek_ode_zwillingr_info.mw

That moderator has already taken care of it that you don't dare to post it again for the 2nd time from the adomian polynomials.
This is absurd and curtails your freedom of movement.
Do understand that you still want to stay connected to these mapleprimes to get to know Maple better and need help
Well, I think it's just a pathetic display like this

You sit and do your best to move forward with the adoniam polynomials and add a worksheet and information.
Asks for help and then comes some half-assed moderator who just removes your work from the maple primes forum
This is really all wrong, sick

@salim-barzani , I was willing to put my teeth into it to get this procedure working, after all I am B ed math

I was also studying that other deleted post from today about the adomian polynomials with a worksheet attached which also showed a lot of information for me .
That one is much more valuable then this post.
Just get removed from the forum, this is just really very wrong and this way you deserve no respect and you can get the hell out too.
Sitting maples primes dead with these actions ,goofball.

That moderator is just stirring things up, jerk
Indeed different questions are asked all the time 
Now if you're a man respond to this,sneaky
 

@one man 
I do suspect someone who has flicked this more to delete post, thinking the topic has been discussed enough.

"this time delete my post i will upload 1000 of nonsense question and post  and go delete all of them "
Yes, fantastic ...
Spamrobot to this server 

Why are your two post deleted about Adomian polynomials ?, by whom 
Now you getting me angry..
Probably no one will answer from th emoderators ,because this behavior is so narrow-minded and arrogant.
Looks like someone is bullying and enjoys deleting someone else's post
It's Monday again and have nothing to do and go bother someone else 
There will probably be no response from that sneaky moderator 
What a doltishly immature state of affairs here on this forum
You sure feel like a big shot now that you can just delete someone's post?
This whole maple primes forum doesn't amount to shit ( in dutch: dit hele forum stelt geen reet voor)

Question : did you remove your other earlier  question about adomian polynomials ?
If yes: not handy
if no : madness ..have to deal with a half-witted moderator

It's an interesting study topic the odes and pdes, but that requires me to really dive into it if I want to understand more about it.
There are users here on the maple primes forum who are scientifically educated and can help better.
 

First 20 21 22 23 24 25 26 Last Page 22 of 73