HP Forums

Full Version: Wronskian of a matrix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,
with this program one can calculate wronskian of a matrix.
The CAS program produce the determinant or the matrix of wronskian.

Thanks to Han to have reviewed the program for me!

Syntax:
wronskm([f1,f2,...,fn])
wronskf(fun)


Salvo

Code:

#cas
// Salvo and Han, 2015
wronskm(f):=
BEGIN
  local s,v,m;

  s:=SIZE(f);
  IF s==0 OR TYPE(f)<>6 THEN RETURN("wronskm([f1,f2,...,fn])"); END;
  IF TYPE(s) THEN RETURN("wronskm: expecting vector of functions"); END;
  v:=lname(f);
  IF SIZE(v)<>1 THEN RETURN("wronskm: expecting single-variable functions"); END; 
  v:=v(1);
  m:=makemat((r,c)->diff(f(c),v$(r-1)),s,s);
  return m;
END;

wronsk(f):=
BEGIN
  local m;
  m:=wronskm(f);
  IF TYPE(m)==2 THEN
    return m;
  ELSE
    return det(m);
  END;
END;
#end
(06-15-2015 12:35 PM)compsystems Wrote: [ -> ]Good
+1

thank you!
it helped me very much.
Thanks also to Han that improved it for me!
Salvo
I have installed the program and can not get it to run. It shows no errors. Any help please.
(10-24-2016 02:48 PM)JB1414 Wrote: [ -> ]I have installed the program and can not get it to run. It shows no errors. Any help please.

you must operate in CAS mode.
Use the program from Vars -> CAS -> (both "All" or "Programs" list are ok).
i.e
wronsk([3*x,x^2]) -> 3*x^2
wronskm([3*x,x^2]) -> a matrix [3*x,x^2; 3,2*x]
No other.
Try and let me know.

Salvo
(06-03-2015 02:36 PM)salvomic Wrote: [ -> ]hi,
with this program one can calculate wronskian of a matrix.
The CAS program produce the determinant or the matrix of wronskian.

Thanks to Han to have reviewed the program for me!

Syntax:
wronskm([f1,f2,...,fn])
wronskf(fun)


Salvo

Code:

#cas
// Salvo and Han, 2015
wronskm(f):=
BEGIN
  local s,v,m;

  s:=SIZE(f);
  IF s==0 OR TYPE(f)<>6 THEN RETURN("wronskm([f1,f2,...,fn])"); END;
  IF TYPE(s) THEN RETURN("wronskm: expecting vector of functions"); END;
  v:=lname(f);
  IF SIZE(v)<>1 THEN RETURN("wronskm: expecting single-variable functions"); END; 
  v:=v(1);
  m:=makemat((r,c)->diff(f(c),v$(r-1)),s,s);
  return m;
END;

wronsk(f):=
BEGIN
  local m;
  m:=wronskm(f);
  IF TYPE(m)==2 THEN
    return m;
  ELSE
    return det(m);
  END;
END;
#end


Hi, thanks for the program, but I have a question.

How can I enter trigonometric values ​​in the "f" functions?

Wronskm ([sin (x), cos (x)])


thx
(05-06-2017 01:34 AM)Fernando Wrote: [ -> ]Hi, thanks for the program, but I have a question.

How can I enter trigonometric values ​​in the "f" functions?

Wronskm ([sin (x), cos (x)])


thx

hi Fernando,
sorry for the delay in reply...
You can simply do so:
• type wronskm() or choose it from Vars/Programs
• wronskm([])
•wronskm([SIN(x), COS(x)])
using the functions SIN, COS in the key H and I, insert x via the key D in both, and separate them with the comma (key O).
You'll get a matrix:
\[
\begin{bmatrix}
SIN(x) & COS(x) \\
COS(x) & -SIN(x)
\end{bmatrix}
\]

Please, let me know if it helps.

Salvo
Great program salvomic and Han!
(11-04-2017 02:20 PM)Eddie W. Shore Wrote: [ -> ]Great program salvomic and Han!

thanks, Eddie! :-)
Reference URL's