Robert Israel

6577 Reputation

21 Badges

18 years, 216 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

dsolve(..., implicit) tries to find a closed-form solution.  Presumably that does not exist, which is why nothing is returned.
 

 

dsolve(..., implicit) tries to find a closed-form solution.  Presumably that does not exist, which is why nothing is returned.
 

 

By the way, you shouldn't use .mpl as the extension for a worksheet file.  It should be .mw (or .mws for a Classic worksheet).  The .mpl extension is for text files in the Maple language.

Since your system contains this second derivative, it's not necessary to use rifsimp: we can simply use solve.

> RedSys := {58.86000000*cos(X[9](t))*cos(X[5](t))-58.86000000*sin(X[9](t))*sin(
X[5](t))+9.040000000*diff(diff(X[9](t),t),t)+9.040000000*diff(diff(X[5](t),t),
t)+6.000000000*diff(diff(X[9](t),t),t)*cos(X[5](t))+6.000000000*sin(X[5](t))*
diff(X[9](t),t)^2 = 0., 58.86000000*cos(X[9](t))*cos(X[5](t))-58.86000000*sin(
X[9](t))*sin(X[5](t))+14.08000000*diff(diff(X[9](t),t),t)+9.040000000*diff(
diff(X[5](t),t),t)+12*diff(diff(X[9](t),t),t)*cos(X[5](t))-12.*diff(X[9](t),t)
*diff(X[5](t),t)*sin(X[5](t))+58.86000000*cos(X[9](t))+6.000000000*diff(diff(X
[5](t),t),t)*cos(X[5](t))-6.000000000*diff(X[5](t),t)^2*sin(X[5](t)) = 0.};
incons1 := {X[5](0) = 0, X[9](0) = 0, D(X[5])(0) = 0, D(X[9])(0) = 0};
dsol := dsolve(RedSys union incons1, numeric);
secondderivs:= solve(RedSys,{diff(X[5](t),t$2),diff(X[9](t),t$2)});
d2x5:=subs(secondderivs,diff(X[5](t),t$2));
plots[odeplot](dsol, [t, d2x5], t = 0 .. 5,numpoints=250);

 

By the way, you shouldn't use .mpl as the extension for a worksheet file.  It should be .mw (or .mws for a Classic worksheet).  The .mpl extension is for text files in the Maple language.

Since your system contains this second derivative, it's not necessary to use rifsimp: we can simply use solve.

> RedSys := {58.86000000*cos(X[9](t))*cos(X[5](t))-58.86000000*sin(X[9](t))*sin(
X[5](t))+9.040000000*diff(diff(X[9](t),t),t)+9.040000000*diff(diff(X[5](t),t),
t)+6.000000000*diff(diff(X[9](t),t),t)*cos(X[5](t))+6.000000000*sin(X[5](t))*
diff(X[9](t),t)^2 = 0., 58.86000000*cos(X[9](t))*cos(X[5](t))-58.86000000*sin(
X[9](t))*sin(X[5](t))+14.08000000*diff(diff(X[9](t),t),t)+9.040000000*diff(
diff(X[5](t),t),t)+12*diff(diff(X[9](t),t),t)*cos(X[5](t))-12.*diff(X[9](t),t)
*diff(X[5](t),t)*sin(X[5](t))+58.86000000*cos(X[9](t))+6.000000000*diff(diff(X
[5](t),t),t)*cos(X[5](t))-6.000000000*diff(X[5](t),t)^2*sin(X[5](t)) = 0.};
incons1 := {X[5](0) = 0, X[9](0) = 0, D(X[5])(0) = 0, D(X[9])(0) = 0};
dsol := dsolve(RedSys union incons1, numeric);
secondderivs:= solve(RedSys,{diff(X[5](t),t$2),diff(X[9](t),t$2)});
d2x5:=subs(secondderivs,diff(X[5](t),t$2));
plots[odeplot](dsol, [t, d2x5], t = 0 .. 5,numpoints=250);

 

I never use Ctrl+P.

According to ?commandline,reference,shortcutkeys, Ctrl+P is the hotkey for previous command in the command-line interface. 

According to ?worksheet,reference,hotwin, in the Windows interface it is for Print Worksheet.  If you want the previous command, you can simply go back there with the mouse, or use copy-and-paste if you want it in a new execution group.

 

> plots[implicitplot](tan(2.1*x*sqrt(0.7e-1*y^2-1))-1.3*sqrt((1.5-0.6e-1*y^2)/(0.7e-1*y^2-1)),
     x = 0 .. 6, y = 0 .. 5, gridrefine = 6, signchange=false);

:-add doesn't work either when Units[Standard] is loaded, because the second argument has Units[Standard]:-`=` instead of the ordinary =.  Thus:

> with(Units[Standard]):
    X:= <1,2,3>;
    :-add(X[i],i=1..3);

Error, invalid input: add received Units:-Standard:-=(i,1 .. 3), which is not valid for its 2nd argument, i
 

I guess that's why the Units[Standard] package contains its version of add

A work-around is to use quotes:

> add('X[i]', i=1..3);

 

:-add doesn't work either when Units[Standard] is loaded, because the second argument has Units[Standard]:-`=` instead of the ordinary =.  Thus:

> with(Units[Standard]):
    X:= <1,2,3>;
    :-add(X[i],i=1..3);

Error, invalid input: add received Units:-Standard:-=(i,1 .. 3), which is not valid for its 2nd argument, i
 

I guess that's why the Units[Standard] package contains its version of add

A work-around is to use quotes:

> add('X[i]', i=1..3);

 

Sorry about that... It worked with add when I tried it.  That is, I changed sum to add and pressed the !!! button, and it worked.  But it seems that the lines

restart:
Units[UseSystem](SI):
with(Units[Standard]):
with(LinearAlgebra):

were not executed. 

The problem seems to be this:  In Document Mode, if you have a Document Block that has never been executed, pressing !!! will not execute it.  I haven't found this mentioned in the help pages.  This is very annoying... another reason to avoid Document Mode?

 

Sorry about that... It worked with add when I tried it.  That is, I changed sum to add and pressed the !!! button, and it worked.  But it seems that the lines

restart:
Units[UseSystem](SI):
with(Units[Standard]):
with(LinearAlgebra):

were not executed. 

The problem seems to be this:  In Document Mode, if you have a Document Block that has never been executed, pressing !!! will not execute it.  I haven't found this mentioned in the help pages.  This is very annoying... another reason to avoid Document Mode?

 

Well, you could always replace Data by -Data.

Well, you could always replace Data by -Data.

I don't think this has anything to do with Units, it's just a case of premature evaluation. 

If X is a Vector (or Matrix or Array), any attempt to evaluate X[i] with i symbolic will produce an error. 
Since sum, like most Maple procedures, evaluates its arguments, the error will occur if you call
sum with an argument involving X[i].  This doesn't happen with add, because add has special evaluation rules.

I don't think this has anything to do with Units, it's just a case of premature evaluation. 

If X is a Vector (or Matrix or Array), any attempt to evaluate X[i] with i symbolic will produce an error. 
Since sum, like most Maple procedures, evaluates its arguments, the error will occur if you call
sum with an argument involving X[i].  This doesn't happen with add, because add has special evaluation rules.

plots[odeplot](dsol, [t, (D@@2)(X[5])(t)], t = 0 .. 5, numpoints = 250);

or

plots[odeplot](dsol, [t, diff(X[5](t), t$2)], t = 0 .. 5, numpoints = 250);

 

First 81 82 83 84 85 86 87 Last Page 83 of 187