Clarins

10 Reputation

2 Badges

9 years, 154 days

MaplePrimes Activity


These are questions asked by Clarins

Hello,

 

I am trying to find the interpolation of a 3D function.

I have the vector x, the vector y and a matrix M at my disposition.
I know how to do the pointplot3d , but I can not find the function: f(x,y) 

any suggestion?

 

Thank you for help

I would like to extrapolate some values from a table:

What I have now is something like this: 

table [
(1,100)=1,
(1,200)=12,
(2,300)=33,
(3,100)=1,
(1,300)=43,
(3,200)=52,
(2,100)=31,
(2,200)=22,
(3,300)=3,
(4,...)=...]

I would like to have a table with the same value in the first position with changing the second value, for example:

table[
(2,100)=31,
(2,200)=22,
(2,300)=33,
(2,...)=..]


How can I do it?

I have to use the optimization package. 

- The objective function is non linear,

- I have constrains and bounds,

- The constrains are not linear.

 

I have reading the help page on maplesoft.com

 

My question are:
Can you confirm me that the only algorithm I can use is : NLPSolve with method ''sqp''?


And if I would like to use the gradient method how can I do?

I have use a ''for cycle'' in order to get a series of points. I would like to save those points in a vector in order to use it for the ''PolynomialFit'' comand. The problem is that the points that I save are sort randomly. How can I take the value of the vector A in the right sequence? in the underline string you can plot the walue of A over t (which is not sorted). I can not use the sort command as I used for t even for A because the points are not increasing.

This is my code:

restart;

Atot := 0:

for ii from 0 by 0.01 to 2 do

PtotFkt := ii->  ii^2 :

Ptot := PtotFkt(ii):

Atot := Atot+0.01*Ptot:

A[ii] := Atot: #Save points in a Table

t[ii] := ii: #Save point in a table

end do;

AV := convert(A, list): #conversion from table to list
nops(AV);  #number of points

timme := convert(t, list): #conversion from table to list
nops(timme); #number of points

 

with(Statistics); #PolynomialFit

X := Vector(AV, datatype = float);

Y := Vector(sort(timme), datatype = float);

plot(Y, X, style = point, symbol = asterisk, color = blue);

regress := PolynomialFit(10, X, Y, time);

curve1 := plot(regress, time = 0 .. 2);

Good Morning,

This is the script that I have used to to an integration, as the command ''int'' didn't work because the coputation was really heavy.


p_old := 0;

g := 0; #index

E_tot_net_Point := 0;

for g to 2 do

 h := g+1;

 loopstart := SP_time[g];

 loopend := SP_time[h];

  for tt from loopstart by 0.01 to loopend do

   t := tt;

   P_tot_net_Fkt := t -> C_motore[g]*omega_motore[g]

if t≠SP_time[g] and t ≠ SP_time[h] then

 P_tot_net_Point := P_tot_net_Fkt(t);

 P_tot_net_Point_next := P_tot_net_Fkt(t+0.001);

 plt_P_tot_net_plt[t] := pointplot([t, P_tot_net_Point]);

 E_tot_net_Point := E_tot_net_Point+(P_tot_net_Point*0.01);

 plt_E_tot_net_plt[t] := pointplot([t, E_tot_net_Point]);

 p_old := P_tot_net_Point;

end if;      

  end do:

end do:

plots:-display(entries(plt_E_tot_net_plt, 'nolist'), title = "Energy", color = "Red", symbol = point, symbolsize = 20, gridlines = true, size = [1000, 500], labels = ['[s]', '[Watt*s]'], font = [axes, 12])


I have plotted the function as a series of points over the orizontal axis (t).

 

Now I would like to calculate the last value of the curve (which is itself a point) as a function of the orizontal axes t. How can I do it?

Something like E_tot_net_Point = f(t)

 

Thank you for the help

1 2 Page 1 of 2