## 489 Reputation

10 years, 316 days

## One way...

One method with polynomial fit

restart: with(Statistics):with(plots):X := Vector([2019, 1546, 1298, 1157, 1052, 963, 901, 852, 802, 780, 747], datatype=integer):
Y := Vector([0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000], datatype=integer):
fit1:=Fit(a+b*t+c*t^2+d*t^3, X, Y, t);
points:= {seq([X[i],Y[i]],i=1..11)}:

pointplot(points);

plot(fit1,t=500..2000);

## diff...

This is an example from help of Maple

?InitialValueProblem

You must write it like in the help

Your error is DE1 := diff(y(t),t) = y(t)-t^2+1;

## round...

HI

If I understand, you want:

return round(y)

## assume...

For the first question:

assume(x1::real, x2::real, y1::real, y2::real):

## assume or assuming...

Hi

You can do:

assume(diff(V(q),q)>0,diff(diff(V(q),q),q)<0); d1:=diff(V(q),q); d2:=diff(diff(V(q),q),q);d1*d2; # d1*d2 for example

or

d1:=diff(V(q),q); d2:=diff(diff(V(q),q),q);d1*d2 assuming d1>0, d2<0; # d1*d2 for example

## y(x) not x ?...

Hi,

The unknown in your differential equation is y(x) and not x.

restart:deq := diff(y(x), x) = y(x)/(x*(ln(x)-ln(y(x))));

x1:=dsolve(deq);

To verify the solution you have to eval deq for the solution:

simplify(eval(deq,y(x)=rhs(x1)));

## with(MTM) ?...

The MTM package do the problem of subs when you with(MTM) is before subs. I don't know why. For your calculation, you don't need it, I think.

jprime:=size(lambda[i,1]);

j:=jprime[2];

The first jprime is a scalar and the second is a vector. What is the value of jprime[2];

Those are errors. lambda is matrix and must be declared.

## t:=t1*Unit(s);...

Hi

add t:=t1*Unit(s); before expression of x and replace plot(x, t); by plot(x);

## Errors...

Hi

First: j:=jprime[2] is always equal to 0 and then while j<=15 never stops. You must declare your vector and matrix: lambda, jprime. There are some errors in your code.

Second: Declare Cat2:=Vector(2) and your subs must work

## plot3d...

Hi,

plot3d(tan(x*sqrt(cp^2/3220^2-1))*(cp^2/3220^2-2)^2+4*tan(x*sqrt(cp^2/6450^2-1))*sqrt((cp^2/3220^2-1)*(cp^2/6450^2-1)), x = 0 .. 14, cp = 0 .. 7000);

Kamel

## list[3..6];...

To select from [4,8] to [5,3], do list[3..6];

[[4, 8], [5, 7], [8, 1], [5, 3]]

## Try using evalf(f(a)*f(m))...

Hi

f:= x-> x-2^(-x);
>
> a:=0; b:=1;
>
>  while b-a> 0.00001 do
>
>       m:= (a+b)/2:
>
>       if evalf(f(a)*f(m)) > 0 then a:= m: else b:=m: end if:
>
>         print(a,b);
>
>       end do:

## The problem...

Hi

The objective function is the variation of the function f (function ripple) : f[max]-f[min])/fmoy.

Hi

In my example, it is not necessary to have f[max]=-f[min].

The problem is in NLPSolve or Search, the objective function f[max]-f[min])/fmoy is constituated with three variables in the same time with respet to ranges and constraints and are not separables, I think.

If you look in your programm, a, b, c, .. for fmax, fmin, and taux are different.

I must get a unique a, b, c... for objective function which is f[max]-f[min])/fmoy.

Search or NLPSolve must calculate at the same time with values of constraints and ranges, fmax, fmin, fmoy and f[max]-f[min])/fmoy and to minimize it and then to give the values of parameters.

Best regards

Kamel

## plot/options...

You should take a look at ?plot/options, in particular at the third example given on that help page.