I've been trying to convert a part of mathematica code to a Matlab one, in order to integrate it for other calculations, but I am having some trouble getting the solver to run.
If by any chance this helps, this is the script that I am trying to convert:
And this is my approach.
U_R04 = sol_Um * sin(omega*t)
U0_R04 = Uf/k_Karman*log(30*y/ks)
eq_R04 = sol_Um * sin(omega*t) == Uf/k_Karman*log(30*delta/ks)
sol_delta = solve(eq_R04,delta)
ME_R04 = int(diff(U0_R04,t),y,[0 sol_delta]) == sol_delta*diff(U_R04,t)-Uf^2
I believe that this far, I would be getting a matching result from the example below, however, I am unable to prepare the command line for the evaluation.
This was my initial attempt, but I have a feeling that is the wrong approach to take for this specific case as I am getting an error for the 'Vars' definition.
[VF,Sbs] = odeToVectorField(ME_R04);
Uffcn = matlabFunction(VF, 'Vars',{x,Y});
[x,Ufx] = ode15s(Uffcn, [0 Tp/2], 0);
Error using sym/matlabFunction>getOptions
The value of 'Vars' is invalid. 'Vars' value must be a character vector, a 1-dimensional cell array of character vectors, a 1-dimensional cell array of symbolic variables
or arrays of symbolic variables, or an array of symbolic variables.
Initial attempt was done for initial conditions of y0=0, as I am not aware of a way to define it the way mathematica script allows for Uf(0.001*Tp)=0.001*sol_Um