Kitonum

21435 Reputation

26 Badges

17 years, 27 days

MaplePrimes Activity


These are answers submitted by Kitonum

M. Hirnyk!
Of course, the eliminate command is not always able to find an explicit equation relating B and A. In this case, the problem can be solved numerically by the following scheme (the simplest way):

1) Construct the plot of the function  B(t)  and on it we find the range in which the function is monotonic.
2) For each value of  B  through some step find the corresponding value of t .

3) Substitute these  t in A (t) .
4) Using these lists we build the plot A (B) .

Solution for your example:

plot(t^5-sin(t)-2, t=0..2, labels=[t,B]);

T:=[seq(fsolve(B = t^5-sin(t)-2, t=0.63..2), B=-2.4..29, 0.1)];

X:=[seq(B, B=-2.4..29, 0.1)];
Y:=[seq(eval( t^3-exp(t)), t in T)];

plot(X, Y, labels=[B,A]);

 

 

You have 2 functions  A=A(t)  and B=B(t) .To plot A in terms of B you should to eliminate the variable  t

An example:

F := eliminate({A = t^3-t, B = t^3-t^2}, t);

plots[implicitplot](op(F[2]), B = -1 .. 1, A = -1 .. 1, scaling = constrained, numpoints = 50000);

 

 

If I understand your question, you need to build a point plot of the function  x->x/(x+1)  for a sets of points  0.5, 0.9, 0.99, 0.999  and  1.001, 1.01, 1.1, 1.5  to illustrate the concept of limit of a function when the variable tends to 1. This can be done as follows

X1, X2 := [.5, .9, .99, .999], [1.001, 1.01, 1.1, 1.5]:

f := x->x/(x+1):

Y1, Y2 := map(f, X1), map(f, X2):

plots[display](plot(X1, Y1, style = point, symbol = solidcircle, color = blue, symbolsize = 8), plot(X2, Y2, style = point, symbol = solidcircle, color = red, symbolsize = 8), view = [0 .. 2, 0 .. 1], scaling = constrained);

 

 

restart;

f := -k*x1(t)+k*(x2(t)-x1(t))-lambda*(diff(x1(t), t)) ;

g := -k*(x2(t)-x1(t));

eq1 := m*(diff(x1(t), t, t))-f = 0;

eq2 := m*(diff(x2(t), t, t))-g = 0;

fcns := {x1(t), x2(t)};

ICS := {x1(0) = 1, x2(0) = 0, D(x1)(0) = 0, D(x2)(0) = 0};

sys := {eq1, eq2}; m := 1; k := 1; lambda := 1;

sysdiff := sys union ICS;

Sol := dsolve(sysdiff, fcns, numeric);

plots[odeplot](Sol, [[t,x1(t)],[t,x2(t)]], t=0..30, color=[red, blue], numpoints=5000, thickness=2);

restart :

f := -k*x1(t)+k2*(x2(t)-x1(t))-lambda*(diff(x1(t), t)):

g := -k2*(x2(t)-x1(t)): fcns := x1(t), x2(t):

eq1 := m*(diff(x1(t), t, t))-f = 0:

eq2 := m*(diff(x1(t), t, t))-g = 0:

ICS := {x1(0) = 1, x2(0) = 0, D(x1)(0) = 0}:

sys := {eq1, eq2}:

m := 1: k2 := 1: k1 := 1: lambda := 1: k:=1:

sysdiff := `union`(sys, ICS):

Sol_N := dsolve(sysdiff, {fcns}, numeric):

plots[odeplot](Sol_N , [x1(t),x2(t)],0..100, numpoints=5000, thickness=2, view=[-0.5..0.5, -0.5..0.5]);

 

 

a[n] is `in` S;

 

 

plot([[4*cos(t), 3*sin(t), t=0..2*Pi], [2*cos(t), 3*sin(t), t=0..2*Pi]], scaling=constrained, color=[red, blue]);

f:=x->x^2+2*x-3:
D(f)(2);

                  6

restart;

L:=[]:

 for A  from .1 by .01 to 3 do

  for B  from .1 by .01 to 3 do

  l1:=(exp(B)-A)-1:

  l2:=(exp(B)-A/2)-1.5:

  if l1>0 and l2>0 then L:=[op(L), [A,B]]: break: end if:

  end do:

 end do:

L; 

In total there are 192 solutions:

with(combinat):

S:=permute(9): L:=[]:

for a in S do

if  a[9] = add(a[2*k-1]/a[2*k], k= 1..4) then L:=[op(L), a]: fi:

od:

nops(L);

                                               192

 

The first solution in the list  L  is Carl's solution, the last is

It is interesting that  there is no solution in which all the fractions are irreducible.

There are several solutions.

solve({c2+vc = .34, 

c2+c3 = .519,

t8+c3-c4-vc = .132,

t1+t5-c2+0.0435=0., 

t1-t2-c2+c3-1.334*vc = 0.,

t2+t6-c3-c4+0.0435+1.334*vc=0.,

-112.5*t1+112.5*t5+300*c2^2+1000*vc = 38.25, 

112.5*t1-112.5*t2-300*c2^2+300*c3-300*c3^2-2000*vc+23.4 = 0.,

-112.8*t8+112.5*t2-112.5*t6+300*c4^2-300*c3+300*c3^2+1000*vc+14.85 = 0.}, 

{t1,t2,t5,t6,t8,c2,c3,c4,vc});

{c2 = .3099822380, c3 = .2090177620, c4 = .2431877898e-1, t1 = .2247720450, t2 = .8376387448e-1, t5 = .4171019302e-1, t6 = .6602897199e-1, t8 = -.2268122102e-1, vc = .3001776198e-1}, {c2 = 3.167226095, c3 = -2.648226095, c4 = .2431877898e-1, t1 = 2.201508587, t2 = .1575760075, t5 = .9222175084, t6 = .9465362873, t8 = -.2268122102e-1, vc = -2.827226095}, {c2 = .3099822380, c3 = .2090177620, c4 = .7266812210, t1 = .2247720450, t2 = .8376387448e-1, t5 = .4171019302e-1, t6 = .7683914140, t8 = .6796812210, vc = .3001776198e-1}, {c2 = 3.167226095, c3 = -2.648226095, c4 = .7266812210, t1 = 2.201508587, t2 = .1575760075, t5 = .9222175084, t6 = 1.648898729, t8 = .6796812210, vc = -2.827226095}

The original code has been executed in Maple 12 (classical worksheet). Found mistake in Dist2 (bracket in the wrong place).
  
Here's another variant of the code:

M1 := [-2, 3, -4]: M2 := [4, -1, 3]:

A := [-t+3, 2*t-4, t+2]:

B := [s+4, 2*s, 2*s-1]:

Dist1 := sqrt((M1[1]-A[1])^2+(M1[2]-A[2])^2+(M1[3]-A[3])^2)+sqrt((B[1]-A[1])^2+(B[2]-A[2])^2+(B[3]-A[3])^2)+sqrt((B[1]-M2[1])^2+(B[2]-M2[2])^2+(B[3]-M2[3])^2):

Dist2 := sqrt((M1[1]-B[1])^2+(M1[2]-B[2])^2+(M1[3]-B[3])^2)+sqrt((B[1]-A[1])^2+(B[2]-A[2])^2+(B[3]-A[3])^2)+sqrt((A[1]-M2[1])^2+(A[2]-M2[2])^2+(A[3]-M2[3])^2):

Optimization[Minimize](Dist1); Optimization[Minimize](Dist2);

min(%[1], %%[1]);


[17.8369577415605676,

[s = 0.602330835119798569, t = 1.52243814242405584]]


[14.4132655077310190,

[s = -0.189757117490280680, t = 0.845165089700380400]]


14.4132655077310190

 

 

This is quite simply:

 

M1:=[-2,3,-4]:  M2:=[4,-1,3]:

A:=[-t+3,2*t-4,t+2]:  B:=[s+4,2*s,2*s-1]:

Dist1:=sqrt((M1[1]-A[1])^2+(M1[2]-A[2])^2+(M1[3]-A[3])^2)+sqrt((B[1]-A[1])^2+(B[2]-A[2])^2+(B[3]-A[3])^2)+sqrt((B[1]-M2[1])^2+(B[2]-M2[2])^2+(B[3]-M2[3])^2):

Dist2:=sqrt((M1[1]-B[1])^2+(M1[2]-B[2])^2+(M1[3]-B[3])^2)+sqrt((B[1]-A[1])^2+(B[2]-A[2])^2)+(B[3]-A[3])^2+sqrt((A[1]-M2[1])^2+(A[2]-M2[2])^2+(A[3]-M2[3])^2):

evalf(minimize(Dist1));  evalf(minimize(Dist2));

min(%, %%); 


                                                                         21.59170144


                                                                         16.24881940


                                                                         16.24881940

1) If you consider the function y=psi(x)  in the real range, then you should write surd(1-x, 3)  instead  (1-x)^(1/3). Else for  (1-x)^(1/3)  if  x>1 , you get complex values.

2) By the code  q:=y->fsolve(y=psi(x), x)  you are looking the function inverse to the function y=psi(x) . For correct solution of the problem the function y=psi(x) should be monotonic in the corresponding range. Such ranges simpliest can be found using the plot of the function. Function  y=psi(x)  in the entire domain does not have an inverse function.

V:=1.8e-5:  R:=8.314:  T:=298:  k:=0.841:  G:=1e6:

psi:=unapply((ln(x)-x+k*(1-x)^2+(V*G)/(R*T)*(surd(1-x,3)-(1-x)/2))*(R*T/V), x);

plot(psi(x), x=0..3, title="The plot of function y=psi(x)");

q:=y->fsolve(psi(x)=y, x):

plot('q'(y), y=-.9e9..-.1.4e9);

 

First 264 265 266 267 268 269 270 Last Page 266 of 289