Post Reply 
Input function - bad argument value
06-10-2023, 08:02 PM (This post was last modified: 06-10-2023 09:08 PM by Amer7.)
Post: #4
RE: Input function - bad argument value
Is there any way to write the function in a matrix like
d1*cos(alpha),d2*cos(alpha)... without it returning an Error?

Ok, when I MAKEMAT(0,3,1) and then i view it, end I edit the 0 to be my function. I can save it to some variable like Ss0. It will appear in matrix menu. I vectorize it.
But when i do the diff(Ss0(1)/Ss1(1)) it again throws an error bad argument value

"(expression,variable=value) Error Bad Argument Value"

   
   

I need to make this but with functions in x and y
[Image: 43b8c31f61f8b2bbe6f0df4d62012d8ba86ba420]

vector by vector derivative matrix

Guys I found some code for jacobian matrix, it compiles no Errors, but I doesn't want to run

Code:
#cas
jacob2(args):=
// Jacobian Matrix by Salvo Micciché
// input vectorial expression, vector of variables
BEGIN
local argv, argc, mat, f, var, fn, fg, j, k, gr, vd;
argv:=args;
argc:=size(argv);
IF argc !=2 THEN
return "Input:[f1(x),f1(y),f1(z)...], [x,y,z,...]";
ELSE
f:=argv(1);
var:=argv(2);
fn:=size(f);
vd:=size(var);
IF fn:=1 THEN
fg:=grad(f(1),var);
f:=fg;
fn:=size(f);
END;
mat:=makemat(0,fn,vd);
FOR j FROM 1 TO fn DO // gradients
gr:=grad(f(j),var);
FOR k FROM 1 TO vd DO // items
mat[j,k]:=factor(gr(k));
END; // for k
END; // for j
return mat;
END; // if-else
END;
#end

https://www.hpmuseum.org/forum/thread-3852.html

Ahhh, just type jacob() in home

EDIT: I think this solves my issue.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Input function - Amer7 - 06-07-2023, 08:05 PM
RE: Input function - bad argument value - Amer7 - 06-10-2023 08:02 PM



User(s) browsing this thread: 1 Guest(s)