Items tagged with variable variable Tagged Items Feed

Hello,

I am using algorithmic variables to generate questions about the greatest common divisor of two integers.

Unforuntately the integers come out as 1,664 instead of simply 1664 (for example). How can I change the format to the simple version ?

Thanks for your help!

Elisabeth

I got a set of ecuations to solve, like this one:

eq[1]:=W[1,0]*(a*HRa[1,0]+b*ga[1,0]+c)=d*SR[1,1]

a,b,c,d are numbers, like 2.0458 and so on.

 

When I want to solve the set, I need to tell Maple the command solve:

solve( {seq(eq[i],i=1..N)},{variables});  (N is an integer of course)

 

To set the variables, one must check each equation to write: {W[1,0],HRa[1,0],ga[1,0]...} and so on.

I know that I can use the command is(variable,assignable) to check if a variable has not a value assigned already and, according to true/false I can construct the set {variables} and solve the set of equations.

That´s an easy solution if I need to check variables under a certain pattern, like: X[1].X[2],X[3] since I can create a loop and check them one after the other. But my problem is that I have different names for variables or that variables change to assignable from assigned according to other conditions, so I can never be sure if W[1,0] is going to be a variable to compute in all steps instead of SR[1,1].

for example:

if a>3 then
SR[1,1]:=1/2;
else
W[1,0]:=300:
end if;

So, when I need to type solve, the {variables} part is different according to each case. Is there any command that allow me to insert an expression and Maple can return me the variables or parameters in the expression that are not numeric already?


Thanks in advance.

Dear all

I have problem related to collection of coefficient of differtials in differential expression containing multiple dependent variables and we want to collect coefficient wrt to selected dependent variables. Please see attached Maple file for details.

 


with(PDEtools):

DepVars := [u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

[u(x, t), v(x, t), a[1](t), a[2](t), a[3](t), b[1](t), b[2](t), b[3](t), r(x, t), s[1](x, t), p[1](x, t), s[2](x, t), p[2](x, t)]

(1)

alias(u = u(x, t), v = v(x, t), a[1] = a[1](t), a[2] = a[2](t), a[3] = a[3](t), b[1] = b[1](t), b[2] = b[2](t), b[3] = b[3](t), r = r(x, t), s[1] = s[1](x, t), p[1] = p[1](x, t), s[2] = s[2](x, t), p[2] = p[2](x, t))

u, v, a[1], a[2], a[3], b[1], b[2], b[3], r, s[1], p[1], s[2], p[2]

(2)

Suppose we differential expression like:

a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]+diff(p[1], t)+a[3]*(diff(p[1], x, x, x))+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]-3*(diff(r, x))*p[1]+(diff(a[1], t))*u*(diff(u, x))+(diff(a[2], t))*v*(diff(v, x))+a[2]*(diff(v, x))*p[2]+a[2]*v^2*(diff(s[2], x))+a[2]*v*(diff(p[2], x))+a[1]*u*(diff(p[1], x))+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))+3*a[3]*(diff(s[1], x))*(diff(u, x, x))+3*a[3]*(diff(s[1], x, x))*(diff(u, x))+a[3]*(diff(r, x, x, x))*(diff(u, x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+a[3]*(diff(s[1], x, x, x))*u+3*a[3]*(diff(r, x, x))*(diff(u, x, x)) = 0

3*a[3]*(diff(diff(r, x), x))*(diff(diff(u, x), x))+3*a[3]*(diff(s[1], x))*(diff(diff(u, x), x))+3*a[3]*(diff(diff(s[1], x), x))*(diff(u, x))+a[3]*(diff(diff(diff(r, x), x), x))*(diff(u, x))+a[3]*(diff(diff(diff(s[1], x), x), x))*u+diff(p[1], t)+(diff(r, t))*(diff(u, x))+(diff(s[1], t))*u-3*(diff(r, x))*p[1]+a[3]*(diff(diff(diff(p[1], x), x), x))-(diff(a[3], t))*a[1]*u*(diff(u, x))/a[3]-(diff(a[3], t))*a[2]*v*(diff(v, x))/a[3]+a[1]*(diff(u, x))*s[1]*u-2*a[1]*u*(diff(r, x))*(diff(u, x))+2*a[2]*(diff(v, x))*s[2]*v-2*a[2]*v*(diff(r, x))*(diff(v, x))-(diff(a[3], t))*r*(diff(u, x))/a[3]-(diff(a[3], t))*s[1]*u/a[3]-s[1]*a[2]*v*(diff(v, x))+(diff(a[1], t))*u*(diff(u, x))+a[1]*u*(diff(p[1], x))+a[2]*v*(diff(p[2], x))+a[2]*v^2*(diff(s[2], x))+a[2]*(diff(v, x))*p[2]+a[1]*(diff(u, x))*p[1]+a[1]*u^2*(diff(s[1], x))-(diff(a[3], t))*p[1]/a[3]-3*r*(diff(r, x))*(diff(u, x))-3*(diff(r, x))*s[1]*u+(diff(a[2], t))*v*(diff(v, x)) = 0

(3)

We can collect coefficients of differential like u[x], u[x, x], v[x], u, vin following manner:

The Procedure

   

 

 

Now how can we collect coefficents with respect to u[x], u[x, x], v[x], u, vso that differential expression (3) appear as
"(......)*u+(.......)*v+(......)*u[x]+(........)*uu[x]+(.........)vv[x]+(........)u[xx]  =0....................."????????""

``


Download Collecting_Coefficients_in_Differential_Expression.mw

Regards

I have written the following coade in Maple:
r := 50;
l1 := 0.2742e-10;
s := I*w;
l := (-1.342110665*10^22*c^2*(Pi^4)-4.225000000*10^25*c^2*(Pi^2)+2.316990000*10^11*c1*(Pi^2)-1)/(-1.342110665*10^22*c^2*c1*(Pi^4)-7.140250000*10^43*c^2*c1*r^2*(Pi^4)+1.957856550*10^33*c^2*(Pi^4)+9.789282750*10^32*c*c1*(Pi^4)-1.690000*10^22*c*(Pi^2)-4.22500*10^21*c1*(Pi^2));
z1 := (c*l1*s^2+1)/(c*s);
z2 := l*s/(c1*l*s^2+1);
h := (z1+2*z2)*((z1+2*r)*(z1+3*z2)/(2*r)-2*z2)/z2-(1/2)*z2*(z1+2*r)*r;
f := h*(z1+3*z2)/z2-(z1+2*r)(2*r)*(z1+3*z2)+2*z2;
gain := 2*z2/f;
a := abs(gain);
d := diff(a, w);
s := subs(w = 2*pi*0.325e11, d)
Now, I have a function named "s" which I want to set to zero, and calculate the relationship between variables c & c1 in order to achieve this. How should it be done?
Thanks.

Hi, does anyone know how to choose the variables that populate the DAE Variables box when you use "equation extraction"?

I want the result to be in terms of the voltage source and the voltage drop across the capacitor for a RLC circuit.  I want to be able to choose the input-output variables for the final equation.

 

 

I try to make a question with an equation with numbered variables. This works fine when evaluating:

y=x1/x2

I need to have the lefthand variable indexed also like this:

y2=x1/x2

When entering y2=x1/x2 as the answer Maple TA won't evaluate it as a correct answer!?

I have the following equation:

Diff(W(t), t) = -q*V*(sin(Phi)-sin(Psi[s]))/(2*h*Pi);

I solve it for rhs() = 0:

soln := solve([rhs((2)) = 0, Phi < 2*Pi], [Phi], allsolutions = true,explicit);

This works and I get this result:

Now I want to get the first zeros, which occur for _Z1 and _Z2 equal to 0. So I substitute:

subs(_Z2=0,(3));

and get

In other words, the substitution did not work.

The original problem is embedded in a larger sheet created with Maple 15 and there it does work. It fails on Maple 2015.2. I then pulled out the relevant pieces to make this example demonstrating the problem (see the attached sheet, which has some of my other (unsuccessful) attempts to diagnose what is going on). It seems like the created variables _Z1 and _Z2 are somehow not recognized at all.

The only way I can get the _Z2 terms out is to substitute 2=0. This is really too icky to seriously consider, though.

Anyone has seen this before?

FWIW: Maple 2015.2 on Mac OS X 10.10.5.

Thanks,

Mac Dude

Assumptions_test.mw

Hi

i am working on a simple control project.i should make a transfer function from the below equation (as an example):

 (s^2*m1+I1*(s^2)*(1/r^2))*x(s)+(-(1/2)*s^2*b*m1-s^2*m1*r-I1*(s^2)*(1/r)+m1*g)*theta(s)+(1/2)*theta(0)*s*b*m1+theta(0)*s*m1*r-x(0)*s*m1+(1/2)*(D(theta))(0)*b*m1+(D(theta))(0)*m1*r-(D(x))(0)*m1+I1*s*theta(0)*(1/r)+I1*(D(theta))(0)*(1/r)-I1*s*x(0)*(1/r^2)-I1*(D(x))(0)*(1/r^2) = 0

in order to make the T.F i have to make " x(s)/theta(s) " on the lhs and put the rest on the rhs. i have no idea how to do so.(the underlined part involves no x(s) and theta(s). obviously a theta(s) will appear on the rhs in the one of the denominators which doesn't matter.)

please help me with this problem.since i don't know what the commands are called in english, i failed in searching for it.

thanks.

How do you check an indexed variable in Maple TA?

For instance the question might be: enter 6x1   (or 6xA1)

I have tried using a Maple-graded question specifying as correct answer 6*x[1]   (or 6*x[A,1]) without any success (works only for 6x).

Hi,

Another newbie question...

I have an excel file with lots of named ranges. I can use the ExcelTools WorkbookData command to get a list of all the available named ranges, and then I can assign the contents of each named range to a Maple variable with the Import command.

I'm thinking that there must be an elegant way to create a Maple variable for each string in the list of named ranges and assign it to the contents. Something like looping through each named range in the list, creating a variable of that name, and then assigning the contents of that named range. I hope I'm clear without repeating myself too much.

Am I explaining my need?

Thanks in advance. This looks like a good forum, and I hope to be able to contribute someday.

Mike McDermott

I would like to get some sort of table (maybe also a plot) that shows me the effect on the function if I change a variable.

For example, I have f(x,y,z)=x+yz

Now I would like to get a list with the results for f if I run z from, say, -10 to +10.

Is it also possible to do this with all variables at the same time?

I can read a .m file written using "save" command, However the variable list (pallete) doesn't get updated. Is there any way to see the list of variables and their values that has been read with "read" command from the .m file?

I want to test linearly dependence of a polynomial f on a list of polynomials F by additional condition on parametric coefficients of linear parametric polynomial (linear for variables not parameters). Please note that:

  1. The polynomialand the members of are always homogenous in the variables.
  2. The coefficients of f, the coefficients of the members of F are all always polynomials in the parameters or contant and the members of N and W are all always polynomials in the parameters.

 

For example let

and

(a,b,c,d,e,h are parameters and A1,A2,A3 are variables).

If I use PolyLinearCombo(F,f,{A1,A2,A3}) (see http://www.mapleprimes.com/questions/204469-How-Can-I-Find-The-Coefficients-Of-Linear#comment217621)then its output is false,[].

Now we let to condition sets for parameters as the following:

N:=[ebc+ahd]

W:=[a,c]

The elements of N must be zero means that ebc+ahd=0

and the elements of W are non-zero that is a<>0 and c <>0.

Let a=b=c=d=h=1 and e=-1. This specialization satisfy in the above condition sets N and W. By this specialization we have:

and

Now if I use PolyLinearCombo(F,f,{A1,A2,A3}) then its output is true,[-1,1].

By this additional two condition sets I have to check that whether f is linearly independent of F or not. How can I do this without specialization? In fact I want an algorithm that its input is (null condition N, not-null condition W, list of polynomials F, a polynomial f, the set of variables) and its output is true and coefficients if f is linearly dependent of F w.r.t. null and not-null conditions N and W, else its output is false.

If the name of new procedure is ExtPolyLinearCombo and 

N:=[ebc+ahd]

W:=[a,c]

I want the output of

ExtPolyLinearCombo(N,W,F,f,{A1,A2,A3}) be true,[coefficients]

Thank you very much in advance.

 

 

Hi everyone:

I have two functions in terms of theta variable, how can I expressed function Y(X)?

X :=(theta)->cos(theta)+0.8e-1*cos(3.*theta)

Y :=(theta)->-sin(theta)+0.8e-1*sin(3.*theta)

I will earn Y(X) infact.

Thanks alot...

Mehran.

 

 

 

1 2 3 4 5 6 Page 1 of 6