I am trying to train a physics model and then check its profile. For this model, data for physics model is defined with:
data = Table[{x, physics[20, 20, 2, x]}, {x, 0, 0.5, 0.01}];
I also did something similar with a neural network and define its data with:
NNdata = Table[{data[[i]][[1]]} -> {data[[i]][[2]]}, {i, 1, Length[data]}];
Now for the profiles, I can check model profile with:
Plot[physics[20, 20, 2, x], {x, 0, 1}]
and for NN model,
Plot[trainedNN[[1]][i], {i, 0, 1}]
I wish to modify the models to take extra input such that I could now make plots as follows:
Plot3D[physics[20, y, 2, x], {x, 0, 1},{y, 0, 1}]
Now, my question is this: how do I modify code lines 2 and 4 (shown above) to accommodate y as a variable instead of a constant? Thank you in anticipation of your kind suggestions.
Note:
physics[C1_, y_, w_, x_] := Module[{B, D, cos, sin, z},
B = w*x;
D = w*y;
cos = Cos[D];
sin = Sin[B];
z = (C1)*sin*cos;
z // N
]
physics[2, y, x]
instead ofphysics[2, 20, x]
$\endgroup$