MaplePrimes Questions

Hi,

I want to get the coefficient of some terms but I can't define suitable codes to do it:

I used the codes of one question on this site namely

https://www.mapleprimes.com/questions/229770-How-To-Find-The-Coefficient-Of-X-X2and

but they do not work for my case.

My case is as follows:

restart;
F:=2*y*sin(beta*x)+6*z*cos(beta*x)+24*sin(beta*x)*cos(beta*x):

coeff(F,sin(beta*x));
                      2 y + 24 cos(beta x)
coeff(F,cos(beta*x));
                      6 z + 24 sin(beta x)

coeff(coeff(F,cos(beta*x)),sin(beta*x));
                      24
The last one is true but for the first two cases, I want to get 2y and 6z respectively.

Maple code for finding optimum maximum value of function TOTP given below when D is kept in the range of 300 to 2000?Also give maple code to find 3Dplot to determine the convexity of function TOTP with respect to y and Sr?

D^γ S(t)=(b-ev)S-α_1 (1-ev)SI_1-α_2 (1-ev)SI_2-dS,
D^γ I_1 (t)=α_1 (1-ev)SI_1-(β_1+d_1+d)I_1,                                           
D^γ I_2 (t)=α_2 (1-ev)SI_2-(β_2+d_2+d) I_2                  , 
D^γ R(t)=β_1 I_1+β_2 I_2+evS-dR 

Found case where PDEtools:-Solve gives exception but not solve.

Is this known issue?

interface(version);

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

restart;

result:=1/2*(Dirac(1,-t+4+k)+Dirac(1,t-4+k)-Dirac(1,-t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1,t-4+k)*cos(t-4+k))/k;
result:=simplify(result) ;
PDEtools:-Solve(result = 0,t) assuming t::real

(1/2)*(Dirac(1, -t+4+k)+Dirac(1, t-4+k)-Dirac(1, -t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1, t-4+k)*cos(t-4+k))/k

(1/2)*(Dirac(1, -t+4+k)+Dirac(1, t-4+k)-Dirac(1, -t+4+k)*cos(-t+4+k)+2*Dirac(-t+4+k)*sin(-t+4+k)+2*sin(t-4+k)*Dirac(t-4+k)-Dirac(1, t-4+k)*cos(t-4+k))/k

Error, (in assuming) when calling 'RootOf'. Received: 'expression independent of, _Z, RootOf'

solve(result = 0,t) assuming t::real

 

Download exception_from_Solve_august_8_2022.mw

I create a plot, then later on, I want to use the same view for a second plot or using the same starting x, ending x and starting y and ending y. For reasons no need to get into into, I need to do this and I have no access to this information at this time. I only have access to the p variable used to store the plot into as in this example below.

I am not sure what is the correct way to do read this information from the PLOTS structure as I never used it before. 

Help describes the PLOTS structure under "PLOT and PLOT3D Data Structures" , but do not see how is one supposed to read different parts of it. I could have missed it. Maple help pages are very hard for me to read in order to obtain the information needed. From help it says:

The Maple plotting functions, plot, plot3d, and others, produce PLOT and PLOT3D data structures describing the images to be displayed.

By trial and error, for standard plot this worked

p:=plot(sin(x),x=-1..10):
op([4,1,2,2],p)

returns

           "originalview" = [-0.9862500000 .. 9.9862500000, -1.0000000000 .. 1.0000000000]

I see also that command plottools:-getdata(p):  returns the data. So I could also do (it is stored in matrix, in third entry):

p0:=plottools:-getdata(p);
startingx:=p0[3][1,1];
startingy:=p0[3][1,2];
endingx:=p0[3][-1,1];
endingy:=p0[3][-1,2];

Will the above work all the time? should this command be used to obtain this information or is there a better way?

When I lprint(p) I see these fields have actual names. For example  , here is screen shot of lprint(p)  

 

it looks like  a RECORD data structure. But when I tried p:-originalview  Error, `p` does not evaluate to a module 

The question is: What is the correct way to find what x range and y range was used for an earlier plot, given one has access only to p variable used to store the output of the plot command?  This is for 2D plot only.

in MapleFlow 2022 ...
1i means 1*sqrt(-1) while 2i means 2*sqrt(-1) ... etc ... right?

In electronics "j" is used for  the sqrt(-1) ... since "i" is used for electric current.

That said I just discovered that MapleFlow will also interperit "j" as sqrt(-1) when used in this context...
1j = 1*sqrt(-1)
2j= 2*sqrt(-1)
Right?

But how can I have MapleFlow express answers using j as sqrt(-1) instead of using i?

I want 2 * 2j= 4j
not 2*2j = 4i

Also, on another topic...
On this forum... what is the difference between a "Post" and a "Question"... as when I ask a question ...
 consider it "posting" a question.

Thanks for any help or  clairfication.

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?

First 170 171 172 173 174 175 176 Last Page 172 of 2308