-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't convert Num to Float64 #535
Comments
I found that you have to use the function julia> typeof(Symbolics.value(substitute(r_i, dict)))
Float64
julia> r_range = Symbolics.value(substitute(r_i, dict)) : 0.1 : Symbolics.value(substitute(r_o, dict))
3.0:0.1:10.0 Couldn't the conversion be done automatically if there are no help?> Symbolics.value
No documentation found. It is mentioned here on the website, but I can't make sense of it. |
I wonder what is the simplest way to recover a Float64 matrix from a constant Num matrix
Substitution apparently is not working (there is no variable to substitute). |
@andreasvarga what I've done is to just create my own wrapper function:
which then seems to work with:
but it would be nice if this was included in the Symbolics package by default. |
The result of
substitute
sometimes is typeFloat
and sometimes is typeNum
. If the output isNum
, then I cannot seem to use it generally. (These are the same variables from the problem in #533.)Errror Output:
Attempt to Fix:
Error Output:
I am also wondering if my approach is just wrong. In general the steps I am taking are:
@variables x ...
x_solution = solve_for(exp, x)
x_solution_value = substitute(x_solution, dict_of_input_parameters)
x_solution_value
with other numerical data to make plots.Keeping track of whether I should be using
x
,x_solution
, orx_solution_value
has been tough since they all represent the same value. I'd rather just transform x at some point in the code I guess, but then I can't use Pluto.jl.The text was updated successfully, but these errors were encountered: