TheAkashain

Gaia Noseworthy

25 Reputation

One Badge

0 years, 116 days
University of New Brunswick
Student
New Brunswick, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are questions asked by TheAkashain

So, I am trying to write a method for array interpolation. I have a Matrix that is X by 3, where each column holds specific data (column 1 holds independent data 1, column 2 holds independent data 2, column 3 holds dependent data).

This data comes from a function with 2 independent variables, and I am creating a graph of this function, basically, with both independent variables going from 0 to 1 (approximately 300 values per variable, giving me a matrix with 90k values already). My goal is to use interpolation to get a lot of values in between the points I already calculated.

That being said, I don't know how to use the ArrayInterpolation command to achieve this. I will post my code below if anyone can help me out!

Code:

Interpolate := proc(M::Matrix)
  local i; local j;
  local M1 := Matrix(RowDimension(M),1);
  local M2 := Matrix(RowDimension(M),1);
  local M3 := Matrix(RowDimension(M),1);
  for i from 1 to RowDimension(M) do
    M1(i) := M(i,1);
    M2(i) := M(i,2);
    M3(i) := M(i,3);
  end do;
  print(M1,M2,M3);
  local M4 := Matrix(1000,1);
  local M5 := Matrix(1000,1);
  for j from 1 to 1000 do
    M4(j,1) := 0.001*j;
    M5(j,1) := 0.001*j;
  end do;
  ArrayInterpolation([M1,M2],M3,[M4,M5]);
end proc;

Good day,

I was recently using Maple 2019 for work on a project, and ran into an error. This error (which will be copied and pasted below for others to test) occurs when making assumptions across multiple lines (whether using the additionally function or not) while using IntegrationTools[Change]. It seems that, if during the process a variable that was within both the assumptions is subtracted from itself, the subtraction fails to happen and leaves what effectively equals 0 in the workings, making further workings impossible.

I'm wondering if anyone else is able to reproduce this error? I know the fix for it is to not disjoint the assumptions, but I am curious if others can easily reproduce it or if others have experiences with it!

As promised, below you will find my workings in order to reproduce this error!

Base Error:

restart;
assume(a>0,b>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
assume(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Simple Fix:

restart;
assume(a>0,b>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Error Without Interface Change:

restart;
assume(a>0,b>a,c>0,t>0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
assume(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)


Error When Using Additionally:

restart;
assume(a>0,b>a,c>0,t>0);
interface(showassumed=0);
F := Int(sqrt(d-a*c^2*t),d=0...infinity);
additionally(b>a);
IntegrationTools[Change](F,-a*t*c^2+d=-y,y)

 

Page 1 of 1