Items tagged with subs subs Tagged Items Feed

So suppose in one maple worksheet, I run:

>assume(w, real); y:=2*w;
>save y, "test.m";

 
And then I open another, and run

>read "test.m";
>subs(w=1,y);

The substitution won't work, while it works if I don't make any assumptions about the variable w.  However, in the piece of code I'm actually running (this snippet is just to illustrate the problem), I need to make the assumption that w is real for solving a system of equations (otherwise maple seems to run out of memory).  Is there a way to save my result y in such a way so that I can make substitutions for w later?

Hi everyone,

I wanted to plot the fourier series up to a given order of a step function using the code I attached, to change the order I used a sum with upper boundary M. When setting M to a particular value and plotting the function the result is obtained within a second, when on the otherhand using plot(subs(M=11,...),...) it takes close to a minute to produce a picture.

This might be a misuse of subs, in any case, I wanted to share my experience and maybe get an explanation about why this takes that much longer.

Cheers,

Sören

restart

f := proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

(1)

plot(subs(M = 11, f(t)), t = 0 .. 2*Pi)

 

M := 11; plot(f(t), t = 0 .. 2*Pi)

 

Download fourier_subs.mw

I wish to substitute Re=W[0]/V[0] in the expression V[0]/W[0] * diff(u(t),t). I tried using the subs command but it didn't work. Any help would be appreciated !

Help!!

Why do the first two of the following 4 examples not work in Maple 15?

subs(m=21,`mod`(m, 4));
subs(m=21,m mod(4));
                               21
                               21
`mod`(21, 4);
21 mod(4);

                               1
                               1
Is there a (simple) workaround?

Thanks.

Dear all,

I would like to solve the Fredholm Integral equation, using numerical method.
This is my code.

there is a problem with subs, does not working here.
# Then, we obtain from (9) the coeficient A[n] and B[n].

Then I woulk like to recompute (2), and then compute (1).
# Puting x=m*h, in (1), how can we generate a linear Matrix from (1).

 

Fred.mw

Thanks

I want to find the solution in a special form.
How can I do it?
Here is what I tried:

(Maple)

(Maple)


In the left hand side u_1 is not changed in  D(u_1).
I want to substitute and evalute (differentiate) it.

Thanks,  Sandor

 

 

 

 

Hi everybody,

Suppose that in an equation, I have the term x/(t).  I want to substitute it by v(t).  Any suggestion because I am trying but don't find an help page on this.

 

Thank you in advance for your help!

 

--------------------------------------
Mario Lemelin
Maple 17.01 Ubuntu 13.10 - 64 bits
Maple 17 Win 7 - 64 bits messagerie : mario.lemelin@cgocable.ca téléphone :  (819) 376-0987

Hello, I have different values to substitute into my theta in a matrix. I tried to use the subs function but the results came out are all dashes. Have you any idea how to fix it please?

AA:=RandomMatrix(3,5);
BB:=map(cos,AA*theta);
CC:=RandomMatrix(3,5);

I tried method 1:

subs[inplace](theta=CC,BB);

Method 2:

DD:=Matrix(3,5);
for m from 1 to 3 do
for n from 1 to 5 do
DD(m..m,n..n):=subs(theta(m..m,n..n)=CC(m..m,n..n),BB(m..m,n..n));
end do:
end do:
DD;

Thank you.

The following integral is solved easily via a substitution. Why does Maple not evaluate it?


int(tan(x)^(1/3)*sec(x)^2, x)

int(tan(x)^(1/3)*sec(x)^2, x)

(1)

int(surd(tan(x), 3)*sec(x)^2, x)

int(surd(tan(x), 3)*sec(x)^2, x)

(2)

``


Download intsub.mw

Greetings,

I have a differential equation:

an the solution:

I want to substitute

ekf := omega = sqrt(c/m);


algsubs(ekf, sol);
but sol does not change.

This works a bit but does not substitute everything in a way that you would expedect

This is the result:





Thanks in advance

I was doing some practice problems for Maple, when I encountered this problem:

 

My code is

 

w:=x+2+sin(x+2);

subs(x+2=u,w);

 

The output however did not change both `x+2`'s into `u`.

 

The output was: x+2+sin(u)

 

Any ideas as to why? Thanks in advance.

Hi,

The subs command is not working properly for Vector type, see worksheet.

I can use simplify instead, but that's not what I really wanted.

Download vsubs.mw

 

Casper

Hi all,

I am having some problems when solving high order polynomials. When oders are 'high' and systems involve multiple variables, Maple is slow to do so.

See in worksheet for detailed codes.

slow.zip

kappa - gives the vector that i am interested in

sC - a reparameterisation which has 'summation' in it

Aim is to verify that it works (it should!)

I currently ask...

Hi,

Say for a 126 by 18 symbolic matrix, substituting numerical values into the matrix DD1 takes about 10 seconds (using time() );

for a 62 by 16 matrix, take just about 1/5 second.

By when the matrix is about 254 by 20, it take much longer! More than a minute!

I never actually waited how long, but I am wondering if there is something wrong? Am I using the right command?

Say the matrix is DD1 with numpar:=[x=0.3,y=0.2,z=0.98,....]

I'm using Maple to come up with equations, and then I'm substituting in variable names for functions which I can then output to Matlab.

I haven't had any problems until I ran into partial derivates described by the D[] operator.  For example, if i have a function f described by f(x(t),y(t)) and I differentiate it wrt t, I get 

D[1](f)(x(t),y(t))*(x(t)_dot) + D[2](f)(x(t),y(t))*(y(t)_dot)

I want to make a substitution for D[1](f)(x(t),y(t)) and D[2...

1 2 3 Page 1 of 3