acer

33280 Reputation

29 Badges

20 years, 263 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@sreid I don't understand what you mean about Y's 9th value.

As the code stands, it looks like the Fit command is going to receive a Vector X of length 8 and a Vector Y of length 9, and that (in itself) will generate a runtime error.

@sreid I don't understand what you mean about Y's 9th value.

As the code stands, it looks like the Fit command is going to receive a Vector X of length 8 and a Vector Y of length 9, and that (in itself) will generate a runtime error.

@Dragonsoul02 The problem seems to lie with the IC of a(0)=0.

How do you interpret the first system, with that setting?

Specifying a(0) just a small amount above 0.0 seems to do better.

@Dragonsoul02 The problem seems to lie with the IC of a(0)=0.

How do you interpret the first system, with that setting?

Specifying a(0) just a small amount above 0.0 seems to do better.

Maple 15 showed the double attractor nicely for your correction of the code, eg. with just a few more options to DEplot3d such as,

stepsize = .01, thickness=1, orientation=[90,70,135]

acer

Maple 15 showed the double attractor nicely for your correction of the code, eg. with just a few more options to DEplot3d such as,

stepsize = .01, thickness=1, orientation=[90,70,135]

acer

That doesn't look right. You've used  rhs(func(1)[2])*z(t) which is hard-coded to evaluate func at the point 1.

sol1:=dsolve({x(0)=.1,diff(x(t),t)=x(t)},numeric,output=listprocedure);
func := eval(x(t),sol1);
func(2);
sol:=dsolve({z(0)=.1,diff(z(t),t)=func(t)*z(t)}, numeric,known=[func]);
plots:-odeplot(sol,0..4);

Using output=listprocedure makes it a bit easier to understand (I think) than the following, which is more like the original form posed,

restart:
sol1 := dsolve({diff(x(t), t) = x(t), x(0) = 0.1}, numeric):
func := proc(q)
   if not type(q,numeric) then 'procname'(q);
   else rhs( op(2, sol1(q)) ); end if;
end proc:
sol:=dsolve({diff(z(t), t) = func(t) * z(t), z(0) = 0.1},numeric,known=func):
func(2);
plots:-odeplot(sol,0..4);

Perhaps the submitter might also like to know that it is not always necessary to dsolve for a procedural solution to x(t) separately from solving for z(t). For the example given, Maple can solve them together as a coupled system.

restart:
sol:=dsolve({diff(x(t),t)=x(t), x(0)=.1}
            union
            {diff(z(t),t)=x(t)*z(t), z(0)=0.1},
            numeric):
sol(2);
plots:-odeplot(sol,[t,z(t)],0..4);

acer

That doesn't look right. You've used  rhs(func(1)[2])*z(t) which is hard-coded to evaluate func at the point 1.

sol1:=dsolve({x(0)=.1,diff(x(t),t)=x(t)},numeric,output=listprocedure);
func := eval(x(t),sol1);
func(2);
sol:=dsolve({z(0)=.1,diff(z(t),t)=func(t)*z(t)}, numeric,known=[func]);
plots:-odeplot(sol,0..4);

Using output=listprocedure makes it a bit easier to understand (I think) than the following, which is more like the original form posed,

restart:
sol1 := dsolve({diff(x(t), t) = x(t), x(0) = 0.1}, numeric):
func := proc(q)
   if not type(q,numeric) then 'procname'(q);
   else rhs( op(2, sol1(q)) ); end if;
end proc:
sol:=dsolve({diff(z(t), t) = func(t) * z(t), z(0) = 0.1},numeric,known=func):
func(2);
plots:-odeplot(sol,0..4);

Perhaps the submitter might also like to know that it is not always necessary to dsolve for a procedural solution to x(t) separately from solving for z(t). For the example given, Maple can solve them together as a coupled system.

restart:
sol:=dsolve({diff(x(t),t)=x(t), x(0)=.1}
            union
            {diff(z(t),t)=x(t)*z(t), z(0)=0.1},
            numeric):
sol(2);
plots:-odeplot(sol,[t,z(t)],0..4);

acer

@OxidisedLizard Ah, you are using Maple 12.

Better to let us know this detail earlier. I will change the top-post to reflect this.

@OxidisedLizard Ah, you are using Maple 12.

Better to let us know this detail earlier. I will change the top-post to reflect this.

@jeffb Yes, of course that doesn't work.

It doesn't work for those two Matrices with your original code, either.

You cannot multiply a 2x3 Matrix by a 2x3 Matrix, in the usual way. Look at my question to you above, about checking whether the number of columns of A should match the number of rows of B.

@jeffb Yes, of course that doesn't work.

It doesn't work for those two Matrices with your original code, either.

You cannot multiply a 2x3 Matrix by a 2x3 Matrix, in the usual way. Look at my question to you above, about checking whether the number of columns of A should match the number of rows of B.

@Hyperian ...with the op command.

@Hyperian ...with the op command.

@jeffb No, the code I wrote has that op() fragment as it ought to be. op(1,A) should return two values, the row and column dimension of Matrix A.

The code I posted above works for me when I paste it -- as is -- into either Document or Worksheet of the Standard GUI of Maple versions 11.02, 12.02, 13.02, 14.01, 15.01, and 16.00 on MS-Windows.

What version and platform are you using? Can you save your worksheet, once you get the error, and upload it in a Comment here (using the green up-arrow in the Mapleprimes editing menubar)?

First 425 426 427 428 429 430 431 Last Page 427 of 610