taro

490 Reputation

12 Badges

11 years, 222 days
Maple is to me difficult. The first version I bought was Maple9, and it was more than 15 years ago. But, I couldn't use it, feeling it too difficult. But, three years ago, I thought Maple might be helpful to my study, and since then, I have continued to learn Maple. As I got able to read the Maple help, I think that I could get to use maple better now than before. But, I feel that I am a beginner yet.

MaplePrimes Activity


These are questions asked by taro

Dear people in mapleprimes,

 

>define(INT, linear, conditional(INT(a::algebraic, X::name) = a*X, _type(a, freeof(X))), INT(X::name, X::name) = (1/2)*X^2);

>INT(2*x+4, x);

x^2 + 4*x

>INT(z+x, z);

(1/2)* z ^2+ x*z

is written in the help page of maple.

This code is to make a function INT.

What it means is that if INT(a::algebraic, x::name) then this is transformed into a*X, where a is independent from x.

And, INT(X::name,X::name) is transformed into (1/2)*X^2.

 

The first of what I want to ask you is the way of use of "_type", which is not in the help page, and as for names with "_" ahead, 

it is written that "_" means internal command for Maple, so not to use it. Is it right to use a name with "_" ahead of it here?

The second of what I want to know is the way to use "conditional."

Please teach me the meaning of this.

Thanks in advance.

 

I hope you will teach me the above questions.

 

Best wishes.

 

taro

 

 

Hello people in mapleprimes,

I want to ask a question about modification of expression.

Basically, what I want to do is to change the expression of sqrt((-a)^2) to sqrt(a^2).

 

The expression I want to modify is this:

 

aa:=phi[n, j] = a[j, D]-a-sqrt((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j])

 

I want to change this to 

 

phi[n, j] = a[j, D]-a-sqrt((a[j, D]-a-tau[n, j])^2+4*gamma*f[c, n, j]/L[j])

 

To do this, I wrote as 

subs(sqrt((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j]) = sqrt((a[j, D]-a-tau[n, j])^2+4*gamma*f[c, n, j]/L[j]), phi[n, j] = a[j, D]-a-((-a[j, D]+a+tau[n, j])^2+4*gamma*f[c, n, j]/L[j])^(1/2))

 

Or, I wrote as 

subs(op([2,3,2,1,1],aa)=(a[j, D]-a-tau[n, j])^2,aa)

 

If there is better ways, please tell me them.

 

Best wishes.

 

taro

 

Dear people in Maple primes,

 

Please tell me why algsubs would not work well in the following case.

 

algsubs(-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma) = factor(-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma)), (-eta*M[n]/(gamma*(eta*M[n]+gamma))-1/(eta*M[n]+gamma))*p[i]+(int(p[i], i = 0 .. M[n]))*eta/(gamma*(eta*M[n]+gamma))+alpha/(eta*M[n]+gamma));

 

Following error message appeared when the above code is executed:

Error, (in algsubs) cannot compute degree of pattern in eta

 

Best wishes.

 

taro

 

 

 

 

 

 

 

Dear people in Mapleprimes,

 

alpha-gamma*q[k]-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = p[k];

 

Then,

algsubs(-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = -eta*(int(q[i], i = 0 .. M__n)), alpha-gamma*q[k]-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = p[k]);

 

This works fine.

 

But,

applyrule(-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = -eta*(int(q[i], i = 0 .. M__n)), alpha-gamma*q[k]-eta*(int(q[i], i = 0 .. M__n))-eta*q[k] = p[k]);

 

This doesn't bring an right replacement.

 

What difference is there between applyrule and algsubs?

 

Best wishes

 

taro

 

 

Hello people in mapleprimes,

I want to solve the next system of equation for B/A and C/A.

eq1:=A+B=F+G;
eq2:=k*(A-B)=kappa*(F-G);
eq3:=F*exp(I*kappa*a)+G*exp(-I*kappa*a)=C*exp(I*k*a);
eq4:=kappa*F*exp(I*kappa*a)-kappa*G*exp(-I*kappa*a)=k*C*exp(I*k*a);


But, though it is well-known, solve({eq1,eq2,eq3,eq4},{B/A,C/A})
does not work well, as the values I want to solve it for are
expressions: B/A and C/A not variables.

Then, you might thing the next works well.
eq:=subs({B=A/t,C=A/u},{eq1,eq2,eq3,eq4}):
solve(eq,{t,u});

But, this doesn't work well, with the answer was
only the ratio of t and u expressed as the following:

t = t, u = exp(I*k*a)*(exp(-I*kappa*a)*k^2-exp(I*kappa*a)*k^2-exp(-I*kappa*a)*kappa^2+exp(I*kappa*a)*kappa^2)*t/(4*kappa*k*exp(I*kappa*a)*exp(-I*kappa*a))

Isn't there nice way to solve the above system of equation, except that
sol1:=solve({eq3,eq4},{F,G});assign(sol1);
sol2:=solve({eq1,eq2},{A,B});assign(sol2);

Best wishes
taro

First 12 13 14 15 16 17 18 Page 14 of 20