Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Why Maple gives different looking solution when calling  

dsolve(sys);

vs.

dsolve(sys,deps);

? Both solution are actually correct. But look different.  Here is an example

restart;
sys:=[
diff(x(t),t) = 2*x(t)-z(t), 
diff(y(t),t) = 2*y(t)+z(t), 
diff(z(t),t)=2*z(t),
diff(w(t),t)=-z(t)+2*w(t)];
deps:=[x(t),y(t),z(t),w(t)];

dsolve(sys);

dsolve(sys,deps);

Notice the difference:

In first case, the x(t) and y(t) solutions have 2 constants of integrations, and in the second case, they have 3 constants of integration.

If we solve this using the matrix exponential method, the solution comes out to match the first one:

A:=Matrix([[2,0,-1,0],[0,2,1,0],[0,0,2,0],[0,0,-1,2]]):
sol:=Vector([x(t),y(t),z(t),w(t)])=LinearAlgebra:-MatrixExponential(A,t).Vector([_C1,_C2,_C3,_C4]);
simplify(sol)

Again, both solution verify to 0, using odetest, and I assume now it is correct (have no reason to think odetest is not correct).

But I'd like to understand more why when passing the unknowns to dsolve, the solution comes out different looking (3 constants of integrations, vs. two in this case). Should the solution be the same looking in both cases? 

This came out, since I thought my solution was wrong, since it did not look like Maple's. 

 

Maple 2020.1

 

In a recent question, the solution involved [...]::[list$3].

H:= proc(n, x, y)
    if n=0 then y+1
    elif n=1 and y=0 then x
    elif n=2 and y=0 then 0
    elif y=0 then 1
    elif not [n,x,y]::[nonnegint$3] then 
        'procname'(n-1, x, 'procname'(n, x, y-1))
    else
        thisproc(n-1, x, thisproc(n, x, y-1))
    fi
end proc

Where is  the  form [...]::[list$3] documented?

 

 

Please refer to this for the definition(s):

http://www.mrob.com/pub/math/largenum-3.html#hyper

The hy(a,n,b) recursion turns  into the following Maple code:

 

Unfortunately this code depends on x and y being explicit numeric values (x,y \in N), otherwise the recursion crashes (if I ask for example H(2,x,y) or H(2, x, 2))

Is there any way to transform the code so that the final construct can be shown symbolically?

I don't see anything obvious, especially since if y is not a specific natural number the recursion will crash. Can we maybe force Maple to not evaluate it for natural number arguments and return the final construct as either a sum, product or tower of the symbols for x and y (i.e. symbols of the digits of x and y like a tower of 2's 3's, etc)?

I do remember something about putting primes around functions prevents premature evaluation, but in this case it doesn't do anything like I'd want. This definition is not primitive recursive (like that of the Ackerman function), so I don't expect it to be able to be called abstractly (H(2,x,y) or something else such), but maybe we can turn it into something that shows the structure of the final construct as symbols of the digits of x and y?

Thanks.

Yannis

PS: One can improve the situation a bit, by implementing the extended definition as:

hy := proc (n, x, y) if n = 0 then y+1 elif n = 1 then x+y else if y = 1 then x else if n = 2 then x*y elif n = 3 then x^y elif n = 4 then x^hy(4, x, y-1) else hy(n-1, x, hy(n, x, y-1)) end if end if end if end proc

(which can be called abstractly for n=0,1,2,3,4 (hy(n,x,m) for natural m), but for higher n it crashes similar to H, since the definition falls back to the previous if n>4.

How to use spacecurve with two variables and how to use display? 

Thanks!!

I want to make a procedure that takes a function as an input, but everything I've tried has turned the function into a string.
This is what I want to do.

newtons := proc( f::function, x, n::integer)

But when I try and use the the function f that I defined, it just gets treated like a string or something. I can't put variables into it, I cant evaluate anything from it.

How do I get proc to see f as a function?

There are some answers up here, but they are for given known functions.
I need to place parentheses around functions that are automatically created.
For example, the function $f(x)$ takes many polynomial values during the execution
of a procedure. For examplle, it takes the values, 2x-1, x^2+3x+2, x^3-2x-3, etc.
How do I automatically place parentheses around these polynomials?
Thank you!
mapleatha

Hello, 
I have this problem to my system:

sol := pdsolve(sys2, {bcs, ics}, numeric)
sol:-plot3d(u1(x, t), x = 2 .. 3.2, t = 100 .. 1000)
Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.0):
unable to store HFloat(undefined)+HFloat(undefined)*I when datatype=float[8]

It is 1 pde and 1 ode.

What can I do to solve it?


Best
 

Dear Maple community,

I am trying to solve a system of linear equations, each of which is homogenous of degree 1 (i.e., defined up to a scale/constant factor), and was wondering whether one can use Maple to solve for ratios of variables (defined relative to a numeraire). An example of my problem is attached (Example.mw). More specifically:

- Equation (1) defines the system,

- Equations (2) through (4) exemplify the system for J=3 and S=1 (creating the system of 3 equations in 3 unknowns: {dlog R[1,1], dlog R[2,1], dlog R[3,1]},

- Function A solves this system for the unknowns and the subsequent commands simplify dlog R[1,1] (and dlog R[2,1]) using the model's constraints (side relations). Not surprizingly, I get the error message "Error, (in simplify/siderels:-Recurse) indeterminate expression of the form 0/0", which results from the fact that the system is homogenous of degree 1 (and, hence, each dlog R is defined only up to a scale),

- However, in principle, it should be possible to choose one of the dlog R's, say, dlog R[1,1] as a numeraire and express the other two "unknowns" (dlog R[2,1], and dlog R[3,1]), relative to it, in order to ultimately solve this system for dlog R[2,1]/dlog R[1,1] and dlog R[3,1]/dlog R[1,1] as functions of exogenous variables only.

I'd appreciate any advice how I can use Maple to tackle this problem. Thank you very much in advance!

 

Hi all,

There is issue with saving big numbers to txt file on WIndows

Please look at the file:

txt_issue.mw

Function save just cutting a big number.

Thank you.

Hi, Maple seems to automatically sort my list in some numerical order. Is there a way to overcome this? I want my list as it is.

 

Hello, 

I'm trying to calculate the convolution of the radiation forve in the time domain. I need to do a state space representation of a function K(t), where :

t=[0; 1; 2; 3];

k=[0.1; 0.2; 0.3; 0.4];

If you could help me with finding the appropriate command that give the matrix A, B C and D

just a remarque that in matlab used imp2ss (based on the Hankel SVD method)

thanks

Hello there, 

Is there any way to make the equation 'Given_eq_3_37a' in the calculation below to be 'desired'?

Perhaps, the issue of the 'L__1' and '1/L__1' might have been in the way, but perhaps that might be overcome in a different way. 

Thank you, 

In Kwon Park 


 

restart;

Given_eq_3_37 := M = k_ * sqrt(L__1 * L__2);

M = k_*(L__1*L__2)^(1/2)

(1)

Given_eq_3_30 := k_ = sqrt((L__m)^2 / (L__1 * L__2p));

k_ = (L__m^2/(L__1*L__2p))^(1/2)

(2)

Given_eq_3_37a := simplify(subs([Given_eq_3_30], Given_eq_3_37));

M = (L__m^2/(L__1*L__2p))^(1/2)*(L__1*L__2)^(1/2)

(3)

desired := M = sqrt(L__m^2/(L__1*L__2p)*(L__1*L__2));

M = (L__m^2*L__2/L__2p)^(1/2)

(4)

 


 

Download Q20201001.mw

Hello everyone. I want to know how I can extract terms from a multivariate polynomial with the following 2 conditions:

  1. It should have the lowest sum of the degree of x and of y; and
  2. deg(x) - deg(y) should be either 0 or -1.

For instance, if I've f(x) = 100x^2y^2 + 35yx + 45x, I want an output of 35yx (not 45x; even though degree sum is 1, less than 2).

On the other hand, if I've g(x) = 13x^2y^2 + xy^2 + 2yx^2, I want an output of xy^2 (not yx^2 also).

Hello everyone, I have some weird problems with the maple. The problems are different for the document mode and the worksheet mode, however I strongly believe that they are connected. Starting with the document mode:

I simply cannot execute any command with the symbolic notation. As you can see below, I can execute basic mathematical calculations but I can't do any symbolic math. 


On the other hand, I can execute all the commands in the worksheet mode. For example check the screenshot. 
However, when I try to save that file in the worksheet mode, I get this error:

And, when I close the file and re-open again, I find all the stuff I wrote in the "math mode" disappeared 

 

First 368 369 370 371 372 373 374 Last Page 370 of 2097