nm

11458 Reputation

20 Badges

13 years, 77 days

MaplePrimes Activity


These are answers submitted by nm

I can't read your code well, since it is not well formated and seems to have many synatx errors (may be it is the cut/paste that did that).

But the while loop is clearly not terminating.

Just look at the logic. It says WHILE P1<>q1 DO.... END DO, then inside the WHILE loop, there is nothing that would change this conditions. You seem to forgotten to assign P1 or q1 to something.

To use a WHILE loop, you need something inside the loop to cause the condition to change, else you'll get stick in an infinite loop.

In addition, it is "or" not "OR".  i.e. lower case. I do not see "OR" in maple help. How did you code run like this? Which Maple version are you using?

 

 

Iam sure there is a better way than this (I am newbie) using some build-in function, but how about this:

restart;
vars:={c1,c2,c3,c4,c5,c6,c7,c8,c9}:
e1 := c1 + 2*c2 + (c3+3*c4)*x*y + (c5+c6)*y^2 +(c8-2)*y^3*x^2 = 0:
e2 := (c4 + 2*c5 + c7)*x + (c9+ 2*c3+5*c4)*x^2 + (2*c7+5*c5+c6)*y^2*x^3 =0:
sys := map(coeffs,lhs~({e1,e2}),{x,y}) =~ 0:
print~(sys)[];

                         c1 + 2 c2 = 0
                         c3 + 3 c4 = 0
                          c5 + c6 = 0
                           c8 - 2 = 0
                       c4 + 2 c5 + c7 = 0
                      2 c7 + 5 c5 + c6 = 0
                      c9 + 2 c3 + 5 c4 = 0           

solve(sys,vars);

eq:= (x+y)^2+ 1/(x + y) ;
algsubs((x+y)=m,eq);
simplify(%);
subs(m=(x+y),%);

   


 

f:=x->min(x^2 +1, 2*x+3) ;
plot({f(x),diff(f(x),x)},x=-3..3); %should also add labels, legend, etc....

 

 

If the determinant of the vectors is not zero, then the vectors are L.I. So simply take the determinant.

with(LinearAlgebra):
A := `<|>`(`<,>`(-1, -3, -6), `<,>`(3, 5, 6), `<,>`(-3, -3, -4));
v,e := Eigenvectors(A);
Determinant(e);
   

       -1

Hence L.I.

 

You do need to eventually specify an actual u(t) function

 

restart;

ode:=diff(x(t),t$2)+4*diff(x(t),t)+3*x(t)=u(t);

dsolve({ode,x(0)=0,D(x)(0)=0},x(t));

 

First 18 19 20 Page 20 of 20