MaplePrimes Questions

Hello,

    Has anyone produced a MATLAB command read across?   I was reviewing some MATLAB code for the approach to the proc being written for similar functionality.    They used a command "deal" as a way to distribute a Matrix sizing across multiple Matrix variables at once. 

      -> I.e., EOM matrices of MASS, DAMPENING, And STIFFNESS are all equal size set once initial size is declared with mass being first by number of elements and then the deal function to propgate the sizing to the X, X_Dot, Etc. and other matrices as one definition line assigned to many matrix variables.

   I am not a Matlab coder to know why this command "deal" even exists as it seems quite possible to do this in a couple lines or "I think" with the XX_New := copy(Matrix_basic) maple lines.

  I seem to always have to find the read across when updating or using Matlab function codes with a new Maple project.  I loath retaining the matlab language.  Sorry MathWorks folks.

   P.S., Is the maplet the only menthod to get input from a user at time of running the worksheet.  the "Input" command in other languages has the built in window for user entry.  I find the GetInput, InputDialog, or other via maplet a bit cumbersome and code intensive (esp. tracking the instantiation handle for the interaction.  I also found the return of "list" and "symbol" to be problematic for a simple "get integer" request.

Regards,
Bill

I have differential equation with x as independent variable that I want to convert to state space representation.

But DynamicSystems will not accept y(x) as the output variable, since it defaults to y(t).

Help under "Description of the Model of a Linear System Object" says it is possible to change the independent variable by changing continuoustimevar setting. But help does not give an example how to do this and all my tries failed.

How to do this? Attached is worksheet showing the problem

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;
ode:=diff(y(x),x$2)+y(x) = 0;
DynamicSystems:-DiffEquation(ode,'outputvariable'=[y(x)]);

diff(diff(y(x), x), x)+y(x) = 0

Error, (in DynamicSystems:-DiffEquation) missing output(s): {y(t)}

restart;
ode := diff(y(t),t$2) + y(t) =0;
sys:=DynamicSystems:-DiffEquation(ode,'outputvariable'=[y(t)]);

ode := diff(y(t), t, t)+y(t) = 0

_m2541722345344

Download DS_problem.mw

I have maplesim installed and I get the error "Error, `MapleSim` does not evaluate to a module" when I run A:=MapleSim:-LinkModel(); in a Maple worksheet.

Does anyone know how to solve this error?

how can i get this pde solved ( numeric or analytical)
 

restart

pde__1 := diff(z(x, t), `$`(t, 2))-(diff(z(x, t), `$`(x, 2)))+z(x, t)^2 = 6*x*t*(-t^2+x^2)+x^6*t^6

diff(diff(z(x, t), t), t)-(diff(diff(z(x, t), x), x))+z(x, t)^2 = 6*x*t*(-t^2+x^2)+x^6*t^6

(1)

conds__1 := z(x, 0) = 0, z(0, t) = 0, z(1, t) = t^3

pdsolve([pde__1, conds__1])

``

NULL


 

Download pde.mw

Hi guys,

I know how to plot inequality system through using with(plots) and inequal term. however, I couldn't plot following system of inqulity equations:

alpha <= 0.0002500000000*(-18000.*m^2 + 47271.*m + 39514. + sqrt(3.24000000*10^8*m^4 - 1.701756000*10^9*m^3 - 4.266980559*10^9*m^2 - 3.036299412*10^9*m - 6.95987804*10^8))/(9.*m^2 + 12.*m + 4.), 0.00005000000000*(-90000.*m^2 + 237237.*m + 198158. + sqrt(8.100000000*10^9*m^4 - 4.270266000*10^10*m^3 - 1.069976858*10^11*m^2 - 7.612670111*10^10*m - 1.744924704*10^10))/(9.*m^2 + 12.*m + 4.) <= alpha, -0.6666666667 < m, m < -0.6665522013

please let me know how we can plot it.

with best

u(x,t)=sin(x)cos(t) exact solution 

approxmation solution u(x,t) =sin(x)sin(t)

 

Using t=0 .. 3*Pi the plot is truncated. Changing the 3*Pi to a number, then the full plot shows.

Also keeping 3*Pi but changing y=-1..1 to y=-1.01 .. 1.01 now the full plot shows again.

Is the above normal behaviour or it it a bug?


 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi, y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

#replacing 3*Pi by a number, then it shows the full plot
restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 10, y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

#keeping 3*Pi but changing the y range, it now also show the full plot
restart;
ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi, y=-1.01 .. 1.01,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

 


 

Download strange_result_of_DEplot.mw

 

hallo every body 

please can you help me 

how do i solve this differential linear system with respect lambda is positive number  

i use maple 18

Let the differential system with $\lambda>0$

\begin{equation}
\begin{array}{ccc}
\dot{x}=y(t)\\
\dot{y}=z(t)\\
\dot{z}=-\lambda y(t)-h(t)
\end{array}
\end{equation}

prob.pdf

Is there any chance to sort the array in maple and add the non-zero values? PFA the screenshot. I actually intend to add the non-zero values (leaving behind the dumX entries). How can I add the numerical values only?

I installed just today the 15-day trial version of Maple Flow. 

I could get simple 2D plots of functions but did not succeeded in using fieldplot.

Does fieldplot() work in Maple Flow?

.Hello everybody

.In the attached code how I can compute \lambda2(t,s) and Vbar(s) symbolically

 when I run them, some parts can't be computed. how should I solve this problem?

2.mw

Question 1: Given: c^3 = 1000
How can I have MapleFlow 2022 solve for c?

I can do this manually, of course... by entering...
c=1000^1/3 =
But I haven't been able to figgure out how to have MapleFlow solve for "c" automatically.

Question 2: How to find the log to the base 10?
As it  seems the default is base e.

Question 3: What is antilog function for a given base?

Thanks for any help.

 

Why maple give empty solutions? See ref. (12) in the attached wokrsheet. Is there anything missing when deriving Sols?

sols_tw.mw

hi im currently doing my thesis and can somebody help me to develope the code? pls im stuck..

restart;
_local(I);
Digits := 15;
de1 := (1 - p)*(diff(S(t), t) + mu*S(t)) + p*(diff(S(t), t) + mu*S(t) + beta*S(t)*I(t) - rho*R(t) - varepsilon);
de2 := (1 - p)*(diff(E(t), t) + (alpha1 + mu)*E(t)) + p*(diff(E(t), t) + (alpha1 + mu)*E(t) - beta*S(t)*I(t));
de3 := (1 - p)*(diff(I(t), t) + (alpha2 + delta + mu)*I(t)) + p*(diff(I(t), t) + (alpha2 + delta + mu)*I(t) - alpha1*E(t));
de4 := (1 - p)*(diff(R(t), t) + (mu + rho)*R(t)) + p*(diff(R(t), t) + (mu + rho)*R(t) - alpha2*I(t));
ibvc := S(0) = 2304219, E(0) = 84929, I(0) = 299, R(0) = 71411;
sys1 := eval([de1, de2, de3, de4], p = 1);
dsolve(sys1);
sys0 := eval~(sys1, [{I = 0, R = 0}, {I = 0, S = 0}, {E = 0}, {I = 0}]);
sys_p := `*`~(1 - p, sys0) +~ `*`~(p, sys1);
ode1, ode2, ode3, ode4 := seq(sys_p[j], j = 1 .. 4);
ode1;
de1;
collect(expand(ode1 - de1), S(t), factor);
ode2 - de2;
ode3 - de3;
ode4 - de4;
mu := 0.133*10^(-5);
varepsilon := 0.99879;
delta := 0.004554;
beta := 0.1009*10^(-6);
alpha1 := 0.0008999;
alpha2 := 0.1997;
rho := 0.00090021;
res := dsolve({ibvc, ode1, ode2, ode3, ode4}, numeric, parameters = [p], abserr = 0.1*10^(-14), relerr = 0.1*10^(-12));
res(parameters = [0.5]);
res(50);
plots:-odeplot(res, [t, S(t)], 0 .. 100);
res(parameters = [1]);
plots:-odeplot(res, [t, S(t)], 0 .. 100);
Q := proc(p, {scene::list := [t, S(t)], range::range := 0 .. 100}) if not p::realcons then return 'procname(_passed)'; end if; res(parameters = [p]); plots:-odeplot(res, scene, range, _rest); end proc;
Q(0.5, color = blue);
plots:-animate(Q, [p, range = 0 .. 50], p = 0 .. 1, trace = 24);
n := 4;
s := unapply(add(g[k](t)*p^k, k = 0 .. n), t);
e := unapply(add(h[k](t)*p^k, k = 0 .. n), t);
i := unapply(add(i[k](t)*p^k, k = 0 .. n), t);
r := unapply(add(j[k](t)*p^k, k = 0 .. n), t);
Error, (in i[0]) too many levels of recursion
DE1 := series(eval(ode1, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE2 := series(eval(ode2, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE3 := series(eval(ode3, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE4 := series(eval(ode4, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
M := eval([ibvc], {E(0) = e(0), I(0) = i(0), R(0) = r(0), S(0) = s(0)});
Error, (in i[0]) too many levels of recursion

I have say  I am taking for example purpose only i need in general

v:="1:1":
k:=4

printf("%s]  is %g, v, k) 

Now i want the %s] part in some other color say green or red some dark color.

the %s is inside which need to replaced by the v which will keep coming

I want it for a general say for some part of the printf in some color

At present atleast i want

let F be a function say F(v,k) and it prints out 

printf("%s]  is %g, v, k)  where it prints out the %s] part in dark color

First 288 289 290 291 292 293 294 Last Page 290 of 2426