Preben Alsholm

13728 Reputation

22 Badges

20 years, 246 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

Just replace y=0..1 by y=0..1-x:
plot3d(78.9*x+49.1*y+15.7*(1-x-y), x = 0 .. 1, y = 0 .. 1-x);

@laporte bernard Well, you can do
ode := diff(y(x),x)=2*x*y(x);
res:=dsolve(ode);
convert(rhs(res),FormalPowerSeries,x=0);
 or

res:=dsolve(ode,y(x),formal_series);
convert(%,factorial);



The assignments g1(t):=....; g2(t):=...; do not define functions, but assign to the memory tables for g1 and g2. Thus after those assignments the values of (literally) g1(t) and g2(t) will be known, but g1 or g2 of anything else will not. The solution is simple: use unapply. For g1 you can use the simple assignment g1:=1; since numbers are accepted as constant functions. For g2 use:
g1:=unapply(add(add(c[n,m]*b[n,m](t), m=0..M), n=1..N),t);

You could use events to find tf from eq1 and ics1 since only x is involved.
res:=dsolve({eq1,ic1,b(0)=0},numeric,discrete_variables=[b(t)::float],events=[[x(t)=30,b(t)=t]]);
plots:-odeplot(res,[t,x(t)],0..2.4);
res(2.4);
tf:=subs(%,b(t));
res(tf);
MM:=t->sin(t); #Example
NN:=t->cos(t); #Example
ic2:=y(0)=MM(tf),D(y)(0)=NN(tf);
resy:=dsolve({eq2,ic2},numeric);
plots:-odeplot(resy,[t,y(t)],0..15);

In my answer to your question in the link
http://www.mapleprimes.com/questions/202438-Solution-Of-Wave-Equations

I showed how to use animate on d'Alembert's formula 'res' for the particular example where
f=(x->1/2*exp(-x^2)), and g=(x->exp(-x^2)).
Did you try that and do you have any problems with that?

Change the definition of b to:
b:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, sqrt(N)*OB[m,M](N*t-(n-1)*tj), 0),n,m);
and then let the output be
Array(1..N, 0..M , b)

#There is no use of linear algebra, but certainly linalg should not be used as it is a relic from before Maple 6 and is now deprecated.

This would work:
subs(x+2=NULL,a);

Your syntax for differentiation is way off. See ?diff.
de1 := diff(y(t),t,t) = y(t)+3*x(t);
de2 := diff(x(t),t,t) = 4*y(t)-4*exp(t);
ICs := y(0) = 2, (D(y))(0) = 3, x(0) = 1, (D(x))(0) = 2;
dsolve({de1,de2,ICs},{x(t),y(t)},method=laplace);

Do you have the correct sign on the air resistance?
When the vertical velocity is negative (diff(sy(t),t)<0) then the resistance to the movement is upwards, thus it seems to me that you need a signum(diff(sy(t),t)) multiplied on to the diff(sy(t),t)^2 term.
Alternatively, solve in 2 steps: Find the time when diff(sy(t),t)=0 and then change to an ode with another sign.
As things are:
With the distance you have (2.5) and the angle you may not have any solution.
But a way to find a solution is to use fsolve on a system:
#I reduce distance by dividing it with 1.5. You may try another number.
fsolve({rhs(displacementy)=0,rhs(displacementx)=distance/1.5},{v0=0..infinity,t=0..infinity});
#This gives you a result, but you will have to limit the search intervals.
#Should it be rhs(displacementx)=distance+s0x? That doesn't make things better, though.

The reason you get no output from dsolve({ics, ode}); is that dsolve simply cannot solve the ode symbolically. Even without the initial condition it fails to solve. Try dsolve(ode);
You must solve numerically:
res:=dsolve({ics, ode},numeric);
odeplot(res,[x,y(x)],0..20);

You could use DEplot for the whole problem instead.

A:=(1/GAMMA(0.5))*Int((x-tau)^(0.5-1)*(tau^2+(tau^(1.5))*(8/(3))-tau-(2)*tau^0.5),tau=0..x);
Av:=value(A) assuming x>0;

As you notice replacing 2.5 by 2 helps, but a better idea of course is to replace 2.5 by 5/2 either by typing or in this way:
M1:=convert(M,rational); #This will handle other floats in the matrix as well
LinearAlgebra:-Eigenvalues(M1);
#The problem is that floats are present together with the name 'a'.
The following works fine since it is what is referred to in the error message as a "Matrix of complex(numeric) values".
M2:=eval(M,a=9);
LinearAlgebra:-Eigenvalues(M2);

If you want to find solutions which are independent of a,b,c then you could do:
L:=[b+c = a*a1+b*a4+c*a7, a+c=a*a2+b* a5+c* a8, a+b = a*a3+b*a6+c*a9];
diff(L,a);
diff(L,b);
diff(L,c);

eval~( x^3-3*x^2-24*x+8, x=~[-2,4,6,9]);

Here is a way:
s:=a*b+a*c;
subs({_Inert_SUM=_Inert_PROD,_Inert_PROD=_Inert_SUM},ToInert(s));
FromInert(%);

First 74 75 76 77 78 79 80 Last Page 76 of 160