Preben Alsholm

13728 Reputation

22 Badges

20 years, 241 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

If you change

TransferFunction(linmod);

to

TransferFunction(linmod[1]);


things seem to work.


 

It makes a difference whether you use MultiSeries or not.

The limit is 0 if S > 1 and -Theta0*F/k if S < 1.

restart;

A1:=-1*C/k*F*exp(-Pec_i*C/k*F*S)/(-1+exp(-Pec_i*C/k*F*S))+Theta0/k*F*exp(-Pec_i*F*S)/(exp(-Pec_i*F)-exp(-Pec_i*F*S));
limit(A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S>1;
limit(A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S<1;

#Now with MultiSeries, where it seems to be necessary to take limits of each term. Multiseries has its own version of limit

restart;
with(MultiSeries);
1:=-1*C/k*F*exp(-Pec_i*C/k*F*S)/(-1+exp(-Pec_i*C/k*F*S))+Theta0/k*F*exp(-Pec_i*F*S)/(exp(-Pec_i*F)-exp(-Pec_i*F*S));
limit(A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S>1;
limit(A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S<1;
map(limit,A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S>1;
map(limit,A1,Pec_i=infinity) assuming C>0,F>0,k>0,H>0,Theta0>0,S>0,S<1;

You could use algsubs:

algsubs(a*c='F',K);

But as soon as a new evaluation takes place, e.g. just by doing %; you are back where you started.

0^k simplies automatically to 0, which can be seen by placing unevaluation quotes aound it

'0^k';

Thus

sum(0^k,k=0..0);

and also

add(0^k, k=0..0);

evaluate to 0.

My Maple 14 (with worksheet interface and 1D-input) doesn't complain about the assignment you mention, and it ought not.

However, it is a bad idea in general to do like that. You may think that you defined a function, but all you did was to tell Maple that the literal input (x,0) should result in 'piecewise(x < -h, 0, -h <x and x <h, 1, h<x, 0)'. Maple wouldn't know what to do with the input 7.1234 for example.

Remember that my comment relates to worksheet interface and 1D-input, which I use exclusively.

I recommend doing like this instead:

restart;

u:=x->piecewise(x < -h, 0, x<h, 1,0);
#See the result of the assignment:
u(x);
#In order to plot, h needs to have a value other than its name:
h:=2:
plot(u(x),x=-3..3,thickness=3);

Also note that your piecewise can be simplied as shown.

You could take a look at

?assign

Personally, I usually don't assign values to unknowns, which is inconvenient if you like to keep using them as variables. Instead I do something like the following, where I have used the syntax with curly brackets around the variables.

res:=solve([eq1(x,y,z) , eq2 (x,y,z) , eq3(x,y,z)] , {x , y , z});

When you need to insert values into an expression E you could say

res2:=eval(E, res);


You have picked infinity = 25. Could it be that you should have chosen infinity = 15.6?

Something seems to be going on around there.

restart;
Eqs:= {diff(f(eta),eta,eta,eta)+3*f(eta)*diff(f(eta),eta,eta)-2*diff(f(eta), eta)^2+g(eta)=0,
diff(g(eta),eta,eta)/Pr+3*f(eta)*diff(g(eta), eta)=0}:
inf:=15.6:
BCs := {f(0)=0, D(f)(0)=0, D(f)(inf)=0, g(0)=1, g(inf)=0};
eqs:=eval(Eqs,Pr=1e-2):
sol := dsolve(BCs union eqs, {f(eta), g(eta)}, numeric, output = array([seq(i, i = 0 .. inf),inf]));
sol2 := dsolve(BCs union eqs, {f(eta), g(eta)}, numeric):
plots:-odeplot(sol2,[[eta,f(eta)],[eta,g(eta)]],0..inf);

It appears that the answer can be expressed in terms of BesselI:

Start by replacing btp*s by s (for convenience).

fc := exp(s*cos(2*Pi*x/a))*exp(-(I*2)*Pi*n*x/a);
F:=Int(fc,x=0..a);
#By making a change of variable
IntegrationTools:-Change(F,x=a*y/2/Pi,[y]);

#we see that we need only consider

f:=eval(fc,a=2*Pi);

#Maple doesn't find an answer here

int(f, x = 0 .. 2*Pi)  assuming s> 0, n::integer;

#However, the following numerical evidence suggests that the answer to the integral K is 2*Pi*BesselI(n,s)
K:=Int(f,x=0..2*Pi);
seq(evalf(eval(K-2*Pi*BesselI(n,s),s=1.234)),n=0..30):
simplify(fnormal([%]));
#which results in {0.}

I don't use MapleSim, but tried it in Maple itself.

Not knowing the values of m, k, or Fc, I justed picked some.

eq:=m*diff(x(t),t,t)+k*x(t)+Fc*signum(diff(x(t),t))=0:
eq2:=eval(eq,{m=1,k=1,Fc=.1}):
res:=dsolve({eq2,x(0)=1,D(x)(0)=0},numeric,maxfun=0):
plots:-odeplot(res,[t,x(t)],0..16);

The curve looks rather smooth. It appears that the solutions actually joins the zero solution, at about t = 15.71.

Without maxfun = 0, you get a warning saying


"Warning, cannot evaluate the solution further right of 15.713408, maxfun limit exceeded (see ?dsolve,maxfun for details)"

If I understand you correctly, then the command

interface(displayprecision=5);

does the job.

As it says in the help page for interface, it

"Controls the number of decimal places to be displayed. .... . This allows simplification of display without introducing round-off error."

Another way to do it is to go to "Tools/Options/Precision/Round screen display to".

Since the rewriting as an explicit first order system is ambiguous in this case, you can do as follows.

The second equation doesn't contain diff(theta(rho,rho) and is only of 4th order in diff(r(ho),rho). The two first roots are real at start, the next two imaginary. I selected the first.

I also made some unimportant syntactic changes

restart;
Eq[1] := .1*(diff(r(rho), rho))^5*r(rho)^4*sin(theta(rho))+(diff(r(rho), rho))^3*cos(theta(rho))^2*sin(theta(rho))*(r(rho)^4-.1*rho^4)+(diff(r(rho), rho))*rho^4*cos(theta(rho))^4*sin(theta(rho))+(r(rho)^2*rho^2*(diff(r(rho), rho))^4*cos(theta(rho))-rho^4*cos(theta(rho))^5+.1*r(rho)^4*(diff(r(rho), rho))^4-.1*r(rho)^2*rho^2*cos(theta(rho))^5)*(diff(theta(rho), rho))*r(rho):
Eq[2] := p*(diff(r(rho), rho))*cos(theta(rho))^3*rho-(diff(r(rho), rho))^4*r(rho)^2*sin(theta(rho))+rho^2*cos(theta(rho))^4*sin(theta(rho))-.1*r(rho)^4*(diff(r(rho), rho))^4*sin(theta(rho))+.1*cos(theta(rho))^4*sin(theta(rho))*r(rho)^2:
ICs := {r(1) = 1., theta(1) = 1.4}:
eqs:=eval([Eq[1],Eq[2]],{p=4}):
S2:=solve(eqs[2],diff(r(rho),rho),explicit):
eval(S2,{rho=1,theta=1.4,r=1.});
Ldiff2:=diff(r(rho),rho)=S2[1]:
vars := {r(rho), theta(rho)}:
sol := dsolve({eqs[1],Ldiff2} union ICs, vars, numeric, output = array([seq((1/20)*i, i = 20 .. 40)]));

A minor problem is that you use P in parameters, but p in Eq[2].

More serious is it that you expect Maple to find the solution to the 5th order equation which diff(r(rho),rho) satisfies according to Eq[1].

That Maple reports


Error, (in DEtools/convertsys) unable to convert to an explicit first-order system

doesn't surprise me one bit.

tf1 is a module which among other things exports 'tf'

type(tf1,`module`);
                              true
exports(tf1);
tf, inputcount, outputcount, statecount, sampletime, discrete, systemname, inputvariable, outputvariable, statevariable, systemtype, ModulePrint

So try,

tf1:-tf[1,1];

or

tf1:-tf;

To get an expression on a particular form can be very difficult and next to impossible for several reasons.

Even writing down the answer you want as input:

(1-(omega/omega[n])^2)^2+ (2*epsilon*omega/omega[n])^2;

will result in a slightly different form and can only be avoided by somewhat artificial means.

The following ad hoc method accomplishes some of what you want:

S,R:=selectremove(has,den, epsilon);
factor(R)+S;

But since you know what you want, I suggest subtracting the two versions from each other to confirm that they are equal.

The primary purpose of Maple after all, is not word processing.

If you use solve instead of fsolve you will find 24 imaginary solutions.

If you try fsolve({ee}, complex) you will get one of them,

{x12 = -.3436403369+.2379982525*I, x21 = -.4643201521+.1014536939*I, x22 = -1.370173079+1.136597450*I, y11 = -.1348660900-.5550624325*I, y12 = -.4429607321-0.1563727711e-1*I, y21 = -1.262993665-1.633138471*I, y22 = -1.004590271+.4561076626*I}

The other imaginary solutions could also be found by providing start values for the unknowns.

The result of

with(RootFinding):
HasRealRoots(convert~({ee},rational));

is false.

So if you were expecting real solutions, the conclusion is that there aren't any.

First 148 149 150 151 152 153 154 Last Page 150 of 160