MaplePrimes Questions

The rational expression at the beginning of the code is approximant. p1-p5 are conditions imposed on t, and are to be solved simultaneously to obtain a[0]-a[4] which are then substituted into t to obtain Cf. S1-S4 are to be obtained from Cf and its derivative.

However, I observed that Cf is not providing the desired results. What have I done wrong? Please Can someone be of help?

Thank you and kind regards

 

restart:
t:=sum(a[j]*x^j,j=0..2)/sum(a[j]*x^j,j=3..4):
F:=diff(t,x,x):
p1:=simplify(eval(t,x=q))=y[n]:
p2:=simplify(eval(t,x=q+h))=y[n+1]:
p3:=simplify(eval(F,x=q))=f[n]:
p4:=simplify(eval(F,x=q+h))=f[n+1]:
p5:=simplify(eval(F,x=q+2*h))=f[n+2]:
vars:= seq(a[i],i=0..4):
Cc:=eval(<vars>, solve({p||(1..5)}, {vars}));
for i from 1 to 5 do
	a[i-1]:=Cc[i]:
end do:
Cf:=t;
M:=diff(Cf,x):
s4:=y[n+2]=collect(simplify(eval(Cf,x=q+2*h)),[y[n],y[n+1],f[n],f[n+1],f[n+2]], recursive);
s3:=h*delta[n]=collect(h*simplify(eval(M,x=q)),{y[n],y[n+1],f[n],f[n+1],f[n+2]},factor);
s2:=h*delta[n+1]=collect(h*simplify(eval(M,x=q+h)),{y[n],y[n+1],f[n],f[n+1],f[n+2]},factor):
s1:=h*delta[n+1]=collect(h*simplify(eval(M,x=q+2*h)),{y[n],y[n+1],f[n],f[n+1],f[n+2]},factor):

 

After I define a Ckt (a ladder network) such as :


Ckt := [v1(4), R1(50) &+ L2(0.9600), Cp(0.8200), L1(0.5000) &+ R2(0.2000), RL(1.3430) &+ LL(0.1550)]

How would I then use the value of R1 as defined above, for example, in a subsequent calculation?

Assuming the results from Solve are in (sol,rest), how can I use R1 (defined in Ckts)as a variable  --something like:

P_R1_ave := (abs(eval(v[R1], rest))/sqrt(2))^2/Ckt[R1]

t-match_impedance.mw

 

BTW, I can no longer "insert contents" .  I get the following error:

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/t-match_impedance.mw .
 

I have no idea what may have changed --perhaps something on our server?

The following code completes apparently without error on Maple 2020.2, but with Maple 2021.1 I get a deconnection from the kernel:

restart:
with(LinearAlgebra):
A:=Statistics:-Sample(Normal(0,1),[2500,2500]):
U,S,Vt:=SingularValues(A,output=['U','S','Vt']):
Norm(U.DiagonalMatrix(S).Vt-A);

The crash occurs when running the last line.

The code works on both versions with a smaller matrix (256x256).

Is there something obviously wrong with this piece of code, or a change in Maple 2021 that could explain this?

Note: I'm running Maple on Windows 10, the machine has 16 GB RAM, and the memory usage stays low.

I am trying to represent and compute integrals of closed 1-forms in 2 variables (the result of the integral does not depend on the path chosen), I would like them to display in the usual way

$$\int f(x,y) dx + g(x,y) dy$$

ideally both in the inert form (equivalent to the function Int) and active form (int, where Maple would if possible try to express the integral). The only computation requirement for the inert form would be that the x derivative gives $f$, and the y derivative gives $g$.

Is it possible to modify the possible arguments of the functions Int, int, such that they accept to represent such integral and implement a program to compute them if possible?

I know how to write a program to compute this, but the output display will not use the symbol $\int$ and will not behave nicely when differentiating.

I use a personal licensed copy of Maple (Maple 2020.2).  In the "help about" dialog there is a clickable box titled "Reactivate License".  Does this imply that my license is not activated?  I have not had any issues with using the software.

Regards

Frank

[Moderator: removed image of help-about dialog showing purchase code]

I am using Maple 2020.2 and it seems that the Linear Algebra package is incompatable with the Vector Calculus package:

Why not a friendly error message?
I want to use the Jacobian and the Hessian. Are there alternatives? MTM package can give a Jacobian, but no Hessian (but MTM is also tricky to use).

Harry

 

I am attaching the maple sheet in which you may see the function f I defined. I am using MacBook Pro and Maple 2020

test1.mw

Which one of these two versions, is the recommened one to use? For example, to check for type  integer*x, where x is literal x. i.e. identical(x)

restart;
TypeTools:-AddType('type_1', `&*`(integer,identical(x)));
type(3*x,type_1);

restart;
TypeTools:-AddType('type_1', '`*`'({integer,identical(x)}));
type(3*x,type_1)

Both work.  The difference is that `*` needs {} while `&*` does not.

I read the help page  and I do not understand what it says about the difference, and when is one supposed to use `*` vs. `&*`. it says 

              | `*`(type)  a product of factors of the given type
              | `&*`(type*)  a product of factors in which the nth factor is of the nth type specified in type*

Could possibly someone please explain in simple plain english what is the difference? If I use `&*`  vs. `*` with {}, will they work the same all the time or are there cases when to use one vs. the other?  Any rules of thumb to follow?

I need to simplify terms such as (cos(x)^2+sin(x)^2) to 1 if present in input, but I do not Maple to also do any other simplification rewriting polynomials that might be present in the expression.

And example will make it clear. Given this

expr:= (cos(x)^2+sin(x)^2)+5+(1+x+x^2+x^3)*(cos(x)^2+sin(x)^2)*exp(x);

I want expr to become  6+(1+x+x^2+x^3)*exp(x).   i.e. only simplify trig terms

But simplify(expr,trig); gives

                 6 + (x + 1)*(x^2 + 1)*exp(x)

Which is not what I want. Then I tried the trick of thaw and freeze to tell Maple to freeze polynomial type, like this

restart;
expr:= (cos(x)^2+sin(x)^2)+5+(1+x+x^2+x^3)*(cos(x)^2+sin(x)^2)*exp(x);
thaw(simplify(subsindets[flat](expr,satisfies(Z->type(Z,polynom(integer, x))),(freeze))));

And it actually worked, giving

           6 + (x^3 + x^2 + x + 1)*exp(x)

Question is: Why did simplify(expr,trig) not do what expected, which is to only simplify trig terms in expression and not mess around with the polynomial there? 

Is the above method of thaw/freeze to control which parts of expression gets simplify a recommended way to work around this, or is there a better way?

 

Please help to solve the equation 

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Coefficients.mw .
 

Download Coefficients.mw

Hello everyone,

im new here and i've nerly no expertise in pd-equations. I was trying to solve this pd-system with the following-code:

 

with(plots);
with(DEtools);
with(PDEtools);


`&epsilon;g` := .4;
`&epsilon;s` := .6;
mg := 1;
mgs := 1;
`&rho;g` := 1.2;
`&rho;s` := 1100;
cpg := 1006;
cps := 880;
cpwa := 1920;
`&alpha;GS` := 20;
as := 800;
h_ads := 2700000;
pdgl1 := `&epsilon;g`*`&rho;g`*(diff(xG(t, z), t)) = -mgs-mg*(diff(xG(t, z), z));
pdgl2 := `&epsilon;s`*`&rho;s`*(diff(xS(t, z), t)) = mgs;
pdgl3 := `&epsilon;g`*`&rho;g`*(cpg+xG(t, z)*cpwa)*(diff(TG(t, z), t)) = -mg*(cpg+xG(t, z)*cpwa)*(diff(TG(t, z), z))+`&alpha;GS`*as*(TS(t, z)-TG(t, z));
pdgl4 := `&epsilon;s`*`&rho;s`*(diff(TS(t, z), t))*(cps+xS(t, z)*cpwa) = mgs*h_ads-`&alpha;GS`*as*(TS(t, z)-TG(t, z));
Init := {TG(0, z) = 401.15, TG(t, 0) = 401.15, TS(0, z) = 293.15, TS(t, 0) = 293.15, xG(0, z) = 0.5e-1, xG(t, 0) = 0.5e-1, xS(0, z) = .33, xS(t, 0) = .33};
sol := pdsolve({pdgl1, pdgl2, pdgl3, pdgl4}, Init, type = numeric, range = 0 .. 1, time = t);


Error, (in pdsolve/numeric/par_hyp) Incorrect number of boundary conditions, expected 2, got 4

 

 

When i change initial conditions to 4 it says he expected 2 and when i put 2 it says he expected 4.

Can anyone tell me where my misstake is or in what direction i have to look for an answer.

 

Thanks from before.

 

Can 

 

Hi,

I have the following problem with plots in Maple 2020: I wanted to create several plots which should have the exact same size. I used the command size = [400,400] and Maple is creating a plot with that size, but Maple applies a white frame to my plots which does not have the same size in all cases (see the red mark of different length in the pictures below), so that the effective size differs, which is extremely ugly if you want to arrange several pictures in a document. So my question is

1.) How to remove this white frame, so that the efftictive picture size is actually 400x400?

2.) If 1.) is not possible, how can I adjust the frame so that it always has the same size?

My Code:

with(plots);
with(ColorTools);
with(plottools);
plot1 := inequal(0 <= y^3 + x^2, x = -5 .. 5, y = -5 .. 5, filledregions, color = blue, background = "Gainsboro", size = [400, 400]);
plot2 := plot(x = -5 .. 5, y = -5 .. 5, background = "Gainsboro");
ll := line([-3, 0], [3, 0]), color = blue, thickness = 5;
l := line([-3, 2], [5, 5]), color = blue, thickness = 2;
display(plot2, l, size = [400, 400]);

Thanks for your help.

I can't figure how to make my own type, which is rational and greater than one.

There are buildin types for postive and posint, and so on. But what if I want to make for rational and greater than some value, say 1?

This is easy to do using patmatch, using the conditional. But do not know how to do it to make my own type.

Here is a simple example. I want to check for sin(x)^n, where n is rational and must be >1.  Using pathmatch

restart;
patmatch(sin(x)^(1/2),conditional(sin(x)^a::rational,a>1),'la');la;

does it. Using structured type, the best I could do is this

restart;

TypeTools:-AddType('my_sin',specfunc(sin)^And(rational,positive));
type(sin(x)^(1/2),'my_sin');

But this does not check for >1, only positive.

Any suggestions? I know I could do this using other means, by direct parsing, using op, and so on. But I'd like to learn how to do it using structured type, just to learn the syntax if there is one.

is it possible to use conditional with structured types? But need  name to do that, like with patmatch, but there is no such syntax in structured types. 

ps. I think conditional does not make much sense with structured type. But I need to figure how to make my own type, which is rational and say >1, or integer and say >2 and so on. I just do not know how to do that yet. But I am sure there is a way. Will try to figure it out.

 

 

Hi please  help me in this problem in maple 18 

How do I solve the system K=B and find values 

x_{0},y_{0},z{0}

I posed the problem in the form pdf and mw

thank you 

problem.mw

problem.pdf

 

 

First 102 103 104 105 106 107 108 Last Page 104 of 2141