1
$\begingroup$
delFunc[funcform_, lstofparams_,lstoferrs_] := √Total[Table[(D[funcform, lstofparams[[i]]]*lstoferrs[[i]])^2, {i,Length[lstofparams]}]]
funcanderr[funcform_, lstofparams_,lstofvals_] := {funcform,delFunc[funcform, lstofparams, #[[2]] & /@ lstofvals]} /.Table[lstofparams[[i]] -> lstofvals[[i, 1]],{i,Length[lstofparams]}]

I want to evaluate the numerical value of "funcanderr" with some region of variables.

Suppose funcform[x_,y_]:=(A*Sin[x y])+B lst={{A,5,0.05},{B,8,0.08}

x = 45 Degree y = 135 Degree

N[funcanderr[A*Sin[x y] + B, #[[1]] & /@ lst, #[[2 ;; 3]] & /@ lst]]

Result is {12.8056, 0.0933241}

Now, how to evaluate "funcanderr" with the exclusion limit Pi/3<x<2Pi/3; Pi/3<y<2Pi/3 within the range {{x,0,Pi},{y,0,Pi}}

$\endgroup$
2
  • 1
    $\begingroup$ Presumably this code does not do what you want or you would not be asking the question. However, you have not told us what you want the code to do. We have to guess what you want using only code that does not do what you want. At a minimum, add an example of an explicit use of funcanderr and the expected output. $\endgroup$
    – Bob Hanlon
    Commented Dec 21, 2020 at 17:19
  • $\begingroup$ Please see the corrected version. I have got the result as a central value with error. Now I need to find out the same with a range of variables and a exclusion condition. $\endgroup$
    – PRI_YA
    Commented Dec 21, 2020 at 19:16

1 Answer 1

2
$\begingroup$
Clear["Global`*"]

delFunc[funcform_, lstofparams_, lstoferrs_] := √Total[
   Table[(D[funcform, lstofparams[[i]]]*lstoferrs[[i]])^2, {i, Length[lstofparams]}]]

funcanderr[funcform_, lstofparams_, lstofvals_] := {funcform, 
   delFunc[funcform, lstofparams, #[[2]] & /@ lstofvals]} /. 
  Table[lstofparams[[i]] -> lstofvals[[i, 1]], {i, Length[lstofparams]}]

cons = (0 <= x <= Pi/3 || 2 Pi/3 <= x <= Pi) && (0 <= y <= Pi/3 || 2 Pi/3 <= y <= Pi);

f[x_, y_] = ConditionalExpression[A*Sin[x y] + B, cons];

lst = {{A, 5, 0.05}, {B, 8, 0.08}};

g[x_, y_] = funcanderr[f[x, y], #[[1]] & /@ lst, #[[2 ;; 3]] & /@ lst]

enter image description here

Plot3D[Evaluate@g[x, y], {x, 0, Pi}, {y, 0, Pi},
 PlotLegends -> Automatic]

enter image description here

Since the scales are significantly different, plotting the second function separately:

Plot3D[g[x, y][[2]], {x, 0, Pi}, {y, 0, Pi}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.