Preben Alsholm

13728 Reputation

22 Badges

20 years, 252 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@GOODLUCK fsolve needs to know the values of the parameters in the equations.
I tried this:

params:=indets(feqns,name) minus convert(fvars,set); #The parameters
paramvals:=`=`~(params,.1); #values set arbitrarily to 0.1 each and everyone
#The command
fsolve(eval(feqns,paramvals),convert(subs(Pi=pi,fvars),set));
#didn't finish before my patience (short) ran out.
#Correction: It is worse:
params:=indets(feqns,{name,name^name}) minus convert(fvars,set);
Also you have to be careful about using alpha and alpha[0] (and alpha[whatever] ) in the same calculations.
Evaluating alpha[0] at alpha=.1 :
eval(alpha[0],alpha=.1);
#returns .1[0] which doesn't evaluate to a float.
My suggestion is that you use other names not involving `^` or `[]`.

If possible it is a good idea to treat a considerably smaller system first, the idea being: if a smaller system cannot be solved there is not much chance of success with a larger one.

@GOODLUCK As Carl is pointing out, it is strange to call mu^H a variable. Assuming that by mu^H you don't mean mu raised to the power H, but just mu with an upper index H, you could freeze mu^H so that Maple doesn't treat it as mu raised to power H:

vars:=[c^B,n^B,h^B,mu^B,mu^H,c^s,n^s,h^s,d^s,c^L,m^F,d^L,mu^c,mu^I,
nu^c,nu^I,c^D,d^D,m^R,m^N,K,q,mu^F,k^L,E^L,k^D,E^D,y,M,w^B,P^H,r^B,r^H,
r^D,Pi,r^F,w^F,w^I,w^R,w^N]; #list
fvars:=freeze~(vars); #freezing
feqns:=subs(`=`~(vars,fvars),{eqn||(1..40)}): #Replacing your "variables" by frozen ones
#You used a "variable" called Pi. Pi in Maple is the usual Pi, so use pi:
solve(feqns,subs(Pi=pi,fvars));
No solution.

From the image it looks like there is possibly missing a multiplication sign, so that what is really attempted is
EC2:= Z=1+beta-(q*beta*(Z-beta)/(Z+epsilon*beta)(Z+sigma*beta));
solve(eval(EC2, P), Z);

In Maple 15 this results in the warning mentioned, whereas in Maple 16 and 17 it results in errors (different though).

From the image it looks like there is possibly missing a multiplication sign, so that what is really attempted is
EC2:= Z=1+beta-(q*beta*(Z-beta)/(Z+epsilon*beta)(Z+sigma*beta));
solve(eval(EC2, P), Z);

In Maple 15 this results in the warning mentioned, whereas in Maple 16 and 17 it results in errors (different though).

Why don't you just write the ode in Maple syntax and use dsolve?

@Axel Vogt Thank you!
You forgot "return" before 'procname'.
I still wonder what goes on in plot and plot3d.

@Axel Vogt Thank you!
You forgot "return" before 'procname'.
I still wonder what goes on in plot and plot3d.

@Axel Vogt There is a difference in the way plot and plot3d handles modp:
restart;
modp(5.4321,2); #An error as expected
plot(x->modp(x,2),-3..3); #Works, surprisingly
plot('modp(x,2)',x=-3..3); #Works, surprisingly
plot3d((x,y)->modp(x,2),-3..3,-1..1); #Doesn't work
plot3d('modp(x,2)',x=-3..3,y=-1..1); #Works


@Axel Vogt There is a difference in the way plot and plot3d handles modp:
restart;
modp(5.4321,2); #An error as expected
plot(x->modp(x,2),-3..3); #Works, surprisingly
plot('modp(x,2)',x=-3..3); #Works, surprisingly
plot3d((x,y)->modp(x,2),-3..3,-1..1); #Doesn't work
plot3d('modp(x,2)',x=-3..3,y=-1..1); #Works


Your solution works, but I wonder why since
F(5.78);
results in the error

Error, (in F) invalid argument for modp or mods

as does also
modp(5.78,2);

Your solution works, but I wonder why since
F(5.78);
results in the error

Error, (in F) invalid argument for modp or mods

as does also
modp(5.78,2);

I fail to understand why you expect answers of type numeric in what you are doing. In fact I don't understand what you are trying to do.
Your equations eq1 and eq2 could be obtained in a somewhat more readable form like this:

restart;
egf := exp(2*x*z-z^2);
test1r := subs(x=dummy,z=x,egf);
test1r2 := solve(test1r=f,x);
b := Matrix([[a1,a2],[a3,a4]]);
invb := b^(-1);
testing1:=<f|f^2>.invb.Matrix([[x,1],[1,x^2]]).b; #Row vector
eq1 := test1r2[1] = testing1[1];
eq2 := test1r2[1] = testing1[2];

To understand why you want to linearize it would be good to see a full example. Is expression supposed to mean expression = 0 and is it part of a system involving a derivative of g?

Since diff(f(r), r$2) is already linear in f you only need to linearize the rest.
The command
mtaylor(exp(-f)*(1 - g)^2,[f,g],2);
linearizes about zero, so it is the same as:
mtaylor(exp(-f)*(1 - g)^2,[f=0,g=0],2);

When making the decision back in 1993 (I think it was) the price and licensing certainly favored Maple. So did the open code. The first version we got was Maple V, Release 2, but we started using it in our teaching with Release 3. That students could have Maple on their own computer at home was essential.

@CarlitosVillalbaGalea You can do
solO1:=subs(sol3,1-C1(t)-C2(t)-C3(t));
allvalues(solO1); #Length of output exceeds limit of 1000000
#But it seems to be OK by checking with
eval(%,params); #Assuming that params has been defined already

First 163 164 165 166 167 168 169 Last Page 165 of 230