reinhardsiegfried

25 Reputation

4 Badges

10 years, 129 days

MaplePrimes Activity


These are questions asked by reinhardsiegfried

I know this has been asked a lot, but I just want to know if there is a way to ask Maple to only show like maybe the first 1000 results instead of the whole 100000+ results? That way I don't need to overload Maple.

I googled everywhere for this and most results just tell me what diff and D does...

 

Basically I have a function, let's say

 

f:= x -> x^2

How do I turn the derivative of f into a function?

 

I tried

 

fprime := x -> diff(x^2,x)

 

But tihs just shows me diff(x^2,x), instead of x -> 2x

This question is 99% similiar to an previously posted question, but this one has a little twist(s).

 

http://www.mapleprimes.com/questions/200101-Solving-For-Coefficients-Of-Polynomial-Equations

 

Here is the sample problem. Let's say I have the following equations

 

e1:=(a+b+1)x^2 + (a+1)*x^4 = 0;

e2:=(a-b)*x+ (a^2 - 1)*x^3 = 0;

 

One can immediately tell the system is inconsistent because on x^3, we have a = -1,1 but on x and x^2 we have a = -1/2

This is precisely the problem I am facing, my e1 and e2 will eventually get bigger (bigger as in the order of the polynomial will increase) and I keep facing inconsistencies.

However if I could find a way to code it so that I can ask Maple to solve only up to a certain degree it would be great. This will eliminate any inconsistency

 

For example, using the system I have here, the system is consistent up to order 2 (it will always start from constants and up to a certain power). So I will ask Maple to solve the above system up to order 2.

Here is a pseudocode I have been working on.

 

For i = 1..2 //this might be increased, but it will of course be finite and probably won't go past 10.

For j = 0..N


//N is the degree of polynomial

f[i]:= coeff(e[i],x,j);

end

end

 

//the above generates the equations, below will solve it

 

solve( { f[i], i=1..?} ,{a,b})

 

Note that the pseudocode assumes e[i] are expressions and not equations set to 0 (which is what I have). Is there an "un"unapply on maple?

 

edit1: have to sleep  (late where I am! Will check for responses tomorrow) thank you

I have two polynomials, say

 

x(t) = a[0] + a[1]t + a[2]t^2

y(t) = b[0] + b[2]t + b[3]t^2

 

with the following conditions, x(0) = 2 and y(0) = 1. The polynomial are related by

 

x'(t) = y(t)

y'(t) = x(t)

 

and x(0) = 2, y(0) = 1.

 

One can show that the solution is x(t) = 2 + t + t^2 + O(t^3) and y(t) = 1 + 2t + 0.5t^2 + O(t^3).

 

I am trying to write something so that it works on a larger system. I have a set of nonlinear DEs which i want to solve this way. Here is a sample code of a much simplifed problem.

 

See the uploaded file for details.

 

edit: link is reparied. I uploaded the wrong file initially

 

edit2: Some improvements were made, but Maple still not returning.

 

 

 

2-2_tests_01.mw

Here is a sample code:

 

restart;
N := 3;

for i to 2 do

   f[i] := unapply(a[0][i]+Sum(a[j][i]*t^j, j = 1 .. N), t) end

do;

sys : = {diff(x(t),t) = y(t), diff(y(t),t) = x(t) }

syssub := subs([x(t) = f[1](t), y(t) = f[2](t)],sys)

simplify(syssub)

   solve(simplify(syssub) union {simplify(f[1](0))=2, simplify(f[2](0))=1}),
     {a[0][1], a[0][2], a[1][1], a[1][2], a[2][1], a[2][2]}
);

 

Now for some reason solve returns nothing. This doesn't make sense to me since the system is determinable.

Here is a proof,

 ans: = dsolve(sys union {x(0) = 2, y(0) = 1},{x(t), y(t)}, type = series)

 

will actually return the result.

 

The reason I am doing this is because I am currently working on a bigger nonlinear DE system and it couldn't be done with just dsolve and since there isn't a package in Maple that makes a series representation and plug and chug, I have to write out the necessary steps.

 

Something tells me that Maple has a lot of trouble getting around the variable "t". But it still makes no sense why it can't even return a[0][1] = 1,a[0][2]=2

1 2 3 Page 2 of 3